Skip to content

Commit fa4a533

Browse files
committed
Automatic merge of T1.5.1-376-g885592329 and 12 pull requests
- Pull request #570 at de7a14f: Experimental glTF 2.0 support with PBR lighting - Pull request #732 at 2451991: Improvements for air brakes - Pull request #751 at 00981a2: Web interface to control cab controls with external hardware - Pull request #799 at dc03850: Consolidated wind simulation - Pull request #802 at 4d198e4: Added support for activity location events to the TrackViewer - Pull request #803 at 7157e08: Various adjustments to steam adhesion - Pull request #813 at 001e285: Refactored garbage generators - Pull request #815 at a5cc165: chore: Add GitHub automatic release notes configuration - Pull request #818 at 73b637f: Allow independent drive axles for locomotives - Pull request #820 at 6e7a5b6: delay option for masterkey does not delay switch off - Pull request #821 at e0fa5a8: Adds suppression of safety valves - Pull request #822 at 82ef736: battery switch two buttons option in combination with a delay
14 parents a10abc0 + 8855923 + de7a14f + 2451991 + 00981a2 + dc03850 + 4d198e4 + 7157e08 + 001e285 + a5cc165 + 73b637f + 6e7a5b6 + e0fa5a8 + 82ef736 commit fa4a533

File tree

1 file changed

+3
-17
lines changed
  • Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies

1 file changed

+3
-17
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies/BatterySwitch.cs

+3-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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
}

0 commit comments

Comments
 (0)