Skip to content

Commit 596a03a

Browse files
committed
Improve interaction between high speed reducing valve, quick action, and graduated release triple valves
1 parent e626a4f commit 596a03a

File tree

1 file changed

+6
-4
lines changed
  • Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS

1 file changed

+6
-4
lines changed

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

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -916,7 +916,7 @@ public void UpdateTripleValveState(float elapsedClockSeconds)
916916
}
917917
TripleValveState = ValveState.Release;
918918
}
919-
else if (TripleValveState != ValveState.Emergency)
919+
else if (TripleValveState != ValveState.Emergency || (TripleValveState == ValveState.Emergency && BrakeLine1PressurePSI > AuxResPressurePSI))
920920
{
921921
TripleValveState = ValveState.Lap;
922922
}
@@ -1040,8 +1040,10 @@ public override void Update(float elapsedClockSeconds)
10401040

10411041
if (threshold < InitialApplicationThresholdPSI * AuxCylVolumeRatio) // Prevent brakes getting stuck with a small amount of air on distributor systems
10421042
threshold = 0;
1043-
if (MRPAuxResCharging && HighSpeedReducingPressurePSI > 0 && threshold > HighSpeedReducingPressurePSI)
1044-
threshold = HighSpeedReducingPressurePSI; // Small workaround to improve compatibility between modern systems and HSRV (such systems shouldn't have an HSRV equipped)
1043+
// Prevent air from being perpetually vented by the HSRV in graduated release systems
1044+
if (HighSpeedReducingPressurePSI > 0 && threshold > HighSpeedReducingPressurePSI
1045+
&& ((MRPAuxResCharging && !(Car as MSTSWagon).SupplyReservoirPresent) || BrakeLine1PressurePSI > AuxResPressurePSI))
1046+
threshold = HighSpeedReducingPressurePSI;
10451047
}
10461048
else
10471049
{
@@ -1133,7 +1135,7 @@ public override void Update(float elapsedClockSeconds)
11331135
// Amount of air vented is proportional to pressure reduction from external sources
11341136
dpPipe = MathHelper.Clamp(-SmoothedBrakePipeChangePSIpS.SmoothedValue * AcceleratedApplicationFactor, 0, AcceleratedApplicationLimitPSIpS) * elapsedClockSeconds;
11351137
}
1136-
if (TripleValveState == ValveState.Emergency && !QuickActionFitted)
1138+
if (TripleValveState == ValveState.Emergency && (!QuickActionFitted || BrakeLine1PressurePSI < AutoCylPressurePSI))
11371139
dp = elapsedClockSeconds * MaxApplicationRatePSIpS;
11381140
else
11391141
dp = elapsedClockSeconds * ServiceApplicationRatePSIpS;

0 commit comments

Comments
 (0)