File tree Expand file tree Collapse file tree 1 file changed +3
-17
lines changed
Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies Expand file tree Collapse file tree 1 file changed +3
-17
lines changed Original file line number Diff line number Diff line change 1- // COPYRIGHT 2020 by the Open Rails project.
1+ // COPYRIGHT 2020 by the Open Rails project.
22//
33// This file is part of Open Rails.
44//
@@ -211,6 +211,7 @@ public virtual void Update(float elapsedClockSeconds)
211211 if ( Timer . Triggered )
212212 {
213213 On = false ;
214+ CommandButtonOff = false ;
214215 Wagon . SignalEvent ( Event . BatterySwitchOff ) ;
215216 Timer . Stop ( ) ;
216217 }
@@ -235,6 +236,7 @@ public virtual void Update(float elapsedClockSeconds)
235236 if ( Timer . Triggered )
236237 {
237238 On = true ;
239+ CommandButtonOn = false ;
238240 Wagon . SignalEvent ( Event . BatterySwitchOn ) ;
239241 Timer . Stop ( ) ;
240242 }
@@ -279,29 +281,13 @@ public virtual void HandleEvent(PowerSupplyEvent evt)
279281 }
280282 break ;
281283
282- case PowerSupplyEvent . CloseBatterySwitchButtonReleased :
283- if ( Mode == ModeType . PushButtons && CommandButtonOn )
284- {
285- CommandButtonOn = false ;
286- Wagon . SignalEvent ( Event . BatterySwitchCommandOff ) ;
287- }
288- break ;
289-
290284 case PowerSupplyEvent . OpenBatterySwitchButtonPressed :
291285 if ( Mode == ModeType . PushButtons && ! CommandButtonOff )
292286 {
293287 CommandButtonOff = true ;
294288 Wagon . SignalEvent ( Event . BatterySwitchCommandOn ) ;
295289 }
296290 break ;
297-
298- case PowerSupplyEvent . OpenBatterySwitchButtonReleased :
299- if ( Mode == ModeType . PushButtons && CommandButtonOff )
300- {
301- CommandButtonOff = false ;
302- Wagon . SignalEvent ( Event . BatterySwitchCommandOff ) ;
303- }
304- break ;
305291 }
306292 }
307293 }
You can’t perform that action at this time.
0 commit comments