Skip to content

Commit 82afb61

Browse files
committed
Use plain triple valve if no distributor defined
1 parent e9b7c48 commit 82afb61

File tree

1 file changed

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

1 file changed

+13
-6
lines changed

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

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,20 @@ public AirTwinPipe(TrainCar car)
2828
}
2929
public override void UpdateTripleValveState(float targetPressurePSI)
3030
{
31-
if (targetPressurePSI < AutoCylPressurePSI - (TripleValveState != ValveState.Release ? 2.2f : 0f)
32-
|| targetPressurePSI < 2.2f) // The latter is a UIC regulation (0.15 bar)
33-
TripleValveState = ValveState.Release;
34-
else if (!BailOffOn && targetPressurePSI > AutoCylPressurePSI + (TripleValveState != ValveState.Apply ? 2.2f : 0f))
35-
TripleValveState = ValveState.Apply;
31+
if (!(Car as MSTSWagon).DistributorPresent)
32+
{
33+
base.UpdateTripleValveState(targetPressurePSI);
34+
}
3635
else
37-
TripleValveState = ValveState.Lap;
36+
{
37+
if (targetPressurePSI < AutoCylPressurePSI - (TripleValveState != ValveState.Release ? 2.2f : 0f)
38+
|| targetPressurePSI < 2.2f) // The latter is a UIC regulation (0.15 bar)
39+
TripleValveState = ValveState.Release;
40+
else if (!BailOffOn && targetPressurePSI > AutoCylPressurePSI + (TripleValveState != ValveState.Apply ? 2.2f : 0f))
41+
TripleValveState = ValveState.Apply;
42+
else
43+
TripleValveState = ValveState.Lap;
44+
}
3845
}
3946
}
4047
}

0 commit comments

Comments
 (0)