Skip to content

Commit 29a066e

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 45a72f3: 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 ff454eb: 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 e994961 + 8855923 + de7a14f + 45a72f3 + 00981a2 + dc03850 + 4d198e4 + 7157e08 + ff454eb + a5cc165 + 73b637f + 6e7a5b6 + e0fa5a8 + 82ef736 commit 29a066e

File tree

4 files changed

+32
-1
lines changed

4 files changed

+32
-1
lines changed

Source/Documentation/Manual/physics.rst

+4
Original file line numberDiff line numberDiff line change
@@ -2952,6 +2952,7 @@ MaxAuxilaryChargingRate and EmergencyResChargingRate.
29522952
single: BrakePipeVolume
29532953
single: ORTSEmergencyValveActuationRate
29542954
single: ORTSEmergencyDumpValveRate
2955+
single: ORTSEmergencyDumpValveTimer
29552956
single: ORTSMainResPipeAuxResCharging
29562957
single: ORTSMainResChargingRate
29572958
single: ORTSEngineBrakeReleaseRate
@@ -2982,6 +2983,9 @@ MaxAuxilaryChargingRate and EmergencyResChargingRate.
29822983
emergency mode.
29832984
- ``Wagon(ORTSEmergencyDumpValveRate)``-- Rate at which BP is locally discharged
29842985
at every wagon during an emergency brake application.
2986+
- ``Wagon(ORTSEmergencyDumpValveTimer)``-- Timer for emergency dump valve to close
2987+
after it is activated. If set to 0, it will close as soon as BP is discharged.
2988+
Default value will prevent BP from being charged for 2 minutes.
29852989
- ``Wagon(ORTSMainResPipeAuxResCharging`` -- Boolean value that indicates,
29862990
for twin pipe systems, if the main reservoir pipe is used for charging the auxiliary
29872991
reservoirs. If set to false, the main reservoir pipe will not be used

Source/Documentation/Manual/sound.rst

+3
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,9 @@ Trigger Function
403403
243 GenericItem2Off
404404
========= =====================================
405405

406+
Trigger 252 is activated when the braking system detects an
407+
emergency brake application and starts venting air from the Brake Pipe.
408+
406409
Variable Triggers
407410
-----------------
408411

Source/Orts.Simulation/Common/Events.cs

+2
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,7 @@ public enum Event
255255

256256
OverchargeBrakingOn,
257257
OverchargeBrakingOff,
258+
EmergencyVentValveOn,
258259

259260
// Cruise Control
260261
LeverFromZero,
@@ -523,6 +524,7 @@ public static Event From(Source source, int eventID)
523524

524525
case 250: return Event.OverchargeBrakingOn;
525526
case 251: return Event.OverchargeBrakingOff;
527+
case 252: return Event.EmergencyVentValveOn;
526528

527529
// Cruise Control
528530
case 298: return Event.LeverFromZero;

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/AirSinglePipe.cs

+23-1
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ public class AirSinglePipe : MSTSBrakeSystem
5252
protected float BrakeInsensitivityPSIpS = 0;
5353
protected float EmergencyValveActuationRatePSIpS = 0;
5454
protected float EmergencyDumpValveRatePSIpS = 0;
55+
protected float EmergencyDumpValveTimerS = 120;
56+
protected float? EmergencyDumpStartTime;
5557
protected float EmergResChargingRatePSIpS = 1.684f;
5658
protected float EmergAuxVolumeRatio = 1.4f;
5759
protected string DebugType = string.Empty;
@@ -118,6 +120,7 @@ public override void InitializeFromCopy(BrakeSystem copy)
118120
BrakeInsensitivityPSIpS = thiscopy.BrakeInsensitivityPSIpS;
119121
EmergencyValveActuationRatePSIpS = thiscopy.EmergencyValveActuationRatePSIpS;
120122
EmergencyDumpValveRatePSIpS = thiscopy.EmergencyDumpValveRatePSIpS;
123+
EmergencyDumpValveTimerS = thiscopy.EmergencyDumpValveTimerS;
121124
EmergResChargingRatePSIpS = thiscopy.EmergResChargingRatePSIpS;
122125
EmergAuxVolumeRatio = thiscopy.EmergAuxVolumeRatio;
123126
TwoPipes = thiscopy.TwoPipes;
@@ -235,6 +238,7 @@ public override void Parse(string lowercasetoken, STFReader stf)
235238
case "wagon(ortsbrakeinsensitivity": BrakeInsensitivityPSIpS = stf.ReadFloatBlock(STFReader.UNITS.PressureRateDefaultPSIpS, null); break;
236239
case "wagon(ortsemergencyvalveactuationrate": EmergencyValveActuationRatePSIpS = stf.ReadFloatBlock(STFReader.UNITS.PressureRateDefaultPSIpS, 15f); break;
237240
case "wagon(ortsemergencydumpvalverate": EmergencyDumpValveRatePSIpS = stf.ReadFloatBlock(STFReader.UNITS.PressureRateDefaultPSIpS, 15f); break;
241+
case "wagon(ortsemergencydumpvalvetimer": EmergencyDumpValveTimerS = stf.ReadFloatBlock(STFReader.UNITS.Time, 120.0f); break;
238242
case "wagon(ortsmainrespipeauxrescharging": MRPAuxResCharging = this is AirTwinPipe && stf.ReadBoolBlock(true); break;
239243
}
240244
}
@@ -346,6 +350,7 @@ public override void LocoInitializeMoving() // starting conditions when starting
346350

347351
public void UpdateTripleValveState(float elapsedClockSeconds)
348352
{
353+
var prevState = TripleValveState;
349354
var valveType = (Car as MSTSWagon).BrakeValve;
350355
if (valveType == MSTSWagon.BrakeValveType.Distributor)
351356
{
@@ -377,6 +382,15 @@ public void UpdateTripleValveState(float elapsedClockSeconds)
377382
{
378383
TripleValveState = ValveState.Release;
379384
}
385+
if (TripleValveState == ValveState.Emergency)
386+
{
387+
if (prevState != ValveState.Emergency)
388+
{
389+
EmergencyDumpStartTime = (float)Car.Simulator.GameTime;
390+
Car.SignalEvent(Event.EmergencyVentValveOn);
391+
}
392+
}
393+
else EmergencyDumpStartTime = null;
380394
prevBrakePipePressurePSI = BrakeLine1PressurePSI;
381395
}
382396

@@ -446,7 +460,15 @@ public override void Update(float elapsedClockSeconds)
446460
EmergResPressurePSI -= dp;
447461
AuxResPressurePSI += dp * EmergAuxVolumeRatio;
448462
}
449-
if (EmergencyDumpValveRatePSIpS > 0)
463+
if (EmergencyDumpValveTimerS == 0)
464+
{
465+
if (BrakeLine1PressurePSI < 1) EmergencyDumpStartTime = null;
466+
}
467+
else if (Car.Simulator.GameTime - EmergencyDumpStartTime > EmergencyDumpValveTimerS)
468+
{
469+
EmergencyDumpStartTime = null;
470+
}
471+
if (EmergencyDumpValveRatePSIpS > 0 && EmergencyDumpStartTime != null)
450472
{
451473
BrakeLine1PressurePSI -= elapsedClockSeconds * EmergencyDumpValveRatePSIpS;
452474
if (BrakeLine1PressurePSI < 0)

0 commit comments

Comments
 (0)