File tree 1 file changed +3
-17
lines changed
Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies
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.
2
2
//
3
3
// This file is part of Open Rails.
4
4
//
@@ -211,6 +211,7 @@ public virtual void Update(float elapsedClockSeconds)
211
211
if ( Timer . Triggered )
212
212
{
213
213
On = false ;
214
+ CommandButtonOff = false ;
214
215
Wagon . SignalEvent ( Event . BatterySwitchOff ) ;
215
216
Timer . Stop ( ) ;
216
217
}
@@ -235,6 +236,7 @@ public virtual void Update(float elapsedClockSeconds)
235
236
if ( Timer . Triggered )
236
237
{
237
238
On = true ;
239
+ CommandButtonOn = false ;
238
240
Wagon . SignalEvent ( Event . BatterySwitchOn ) ;
239
241
Timer . Stop ( ) ;
240
242
}
@@ -279,29 +281,13 @@ public virtual void HandleEvent(PowerSupplyEvent evt)
279
281
}
280
282
break ;
281
283
282
- case PowerSupplyEvent . CloseBatterySwitchButtonReleased :
283
- if ( Mode == ModeType . PushButtons && CommandButtonOn )
284
- {
285
- CommandButtonOn = false ;
286
- Wagon . SignalEvent ( Event . BatterySwitchCommandOff ) ;
287
- }
288
- break ;
289
-
290
284
case PowerSupplyEvent . OpenBatterySwitchButtonPressed :
291
285
if ( Mode == ModeType . PushButtons && ! CommandButtonOff )
292
286
{
293
287
CommandButtonOff = true ;
294
288
Wagon . SignalEvent ( Event . BatterySwitchCommandOn ) ;
295
289
}
296
290
break ;
297
-
298
- case PowerSupplyEvent . OpenBatterySwitchButtonReleased :
299
- if ( Mode == ModeType . PushButtons && CommandButtonOff )
300
- {
301
- CommandButtonOff = false ;
302
- Wagon . SignalEvent ( Event . BatterySwitchCommandOff ) ;
303
- }
304
- break ;
305
291
}
306
292
}
307
293
}
You can’t perform that action at this time.
0 commit comments