Skip to content

Commit 7285d21

Browse files
committed
Initialize EP and twin pipe brakes to correct pressure
1 parent f5b2085 commit 7285d21

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,7 @@ public override void Initialize(bool handbrakeOn, float maxPressurePSI, float fu
315315
EmergResPressurePSI = maxPressurePSI;
316316
FullServPressurePSI = fullServPressurePSI;
317317
AutoCylPressurePSI = immediateRelease ? 0 : Math.Min((maxPressurePSI - BrakeLine1PressurePSI) * AuxCylVolumeRatio, MaxCylPressurePSI);
318-
AuxResPressurePSI = AutoCylPressurePSI == 0 ? (maxPressurePSI > BrakeLine1PressurePSI ? maxPressurePSI : BrakeLine1PressurePSI)
319-
: Math.Max(maxPressurePSI - AutoCylPressurePSI / AuxCylVolumeRatio, BrakeLine1PressurePSI);
318+
AuxResPressurePSI = TwoPipes ? maxPressurePSI : Math.Max(maxPressurePSI - AutoCylPressurePSI / AuxCylVolumeRatio, BrakeLine1PressurePSI);
320319
TripleValveState = ValveState.Lap;
321320
HoldingValve = ValveState.Release;
322321
HandbrakePercent = handbrakeOn & (Car as MSTSWagon).HandBrakePresent ? 100 : 0;

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,5 +84,11 @@ public override string GetFullStatus(BrakeSystem lastCarBrakeSystem, Dictionary<
8484
s += $" {Simulator.Catalog.GetString("Handbrake")} {HandbrakePercent:F0}%";
8585
return s;
8686
}
87+
88+
public override void Initialize(bool handbrakeOn, float maxPressurePSI, float fullServPressurePSI, bool immediateRelease)
89+
{
90+
base.Initialize(handbrakeOn, maxPressurePSI, fullServPressurePSI, immediateRelease);
91+
AutoCylPressurePSI = Math.Max(AutoCylPressurePSI, Math.Min(Math.Max(Car.Train.BrakeLine4, 0), 1) * MaxCylPressurePSI);
92+
}
8793
}
8894
}

0 commit comments

Comments
 (0)