Skip to content

Commit b0293f0

Browse files
committed
Add possibility of MRP pipe not affecting brake system
1 parent 0abe9f4 commit b0293f0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public class AirSinglePipe : MSTSBrakeSystem
5555
protected float EmergAuxVolumeRatio = 1.4f;
5656
protected string DebugType = string.Empty;
5757
protected string RetainerDebugState = string.Empty;
58+
protected bool MRPAuxResCharging;
5859
protected float CylVolumeM3;
5960

6061

@@ -119,6 +120,7 @@ public override void InitializeFromCopy(BrakeSystem copy)
119120
EmergResChargingRatePSIpS = thiscopy.EmergResChargingRatePSIpS;
120121
EmergAuxVolumeRatio = thiscopy.EmergAuxVolumeRatio;
121122
TwoPipes = thiscopy.TwoPipes;
123+
MRPAuxResCharging = thiscopy.MRPAuxResCharging;
122124
HoldingValve = thiscopy.HoldingValve;
123125
}
124126

@@ -254,6 +256,7 @@ public override void Parse(string lowercasetoken, STFReader stf)
254256
case "wagon(brakepipevolume": BrakePipeVolumeM3 = Me3.FromFt3(stf.ReadFloatBlock(STFReader.UNITS.VolumeDefaultFT3, null)); break;
255257
case "wagon(ortsbrakeinsensitivity": BrakeInsensitivityPSIpS = stf.ReadFloatBlock(STFReader.UNITS.PressureRateDefaultPSIpS, null); break;
256258
case "wagon(ortsemergencyvalveactuationrate": EmergencyValveActuationRatePSIpS = stf.ReadFloatBlock(STFReader.UNITS.PressureRateDefaultPSIpS, 15f); break;
259+
case "wagon(ortsmainrespipeauxrescharging": MRPAuxResCharging = this is AirTwinPipe && stf.ReadBoolBlock(true); break;
257260
}
258261
}
259262

@@ -468,7 +471,7 @@ public override void Update(float elapsedClockSeconds)
468471
AuxResPressurePSI -= dp * EmergAuxVolumeRatio;
469472
}
470473
}
471-
if (AuxResPressurePSI < BrakeLine1PressurePSI && (!TwoPipes || !(Car as MSTSWagon).DistributorPresent || BrakeLine2PressurePSI < BrakeLine1PressurePSI) && !BleedOffValveOpen)
474+
if (AuxResPressurePSI < BrakeLine1PressurePSI && (!TwoPipes || !MRPAuxResCharging || !(Car as MSTSWagon).DistributorPresent || BrakeLine2PressurePSI < BrakeLine1PressurePSI) && !BleedOffValveOpen)
472475
{
473476
float dp = elapsedClockSeconds * MaxAuxilaryChargingRatePSIpS; // Change in pressure for train brake pipe.
474477
if (AuxResPressurePSI + dp > BrakeLine1PressurePSI - dp * AuxBrakeLineVolumeRatio)
@@ -500,6 +503,7 @@ public override void Update(float elapsedClockSeconds)
500503

501504
// Charge Auxiliary reservoir for MRP
502505
if (TwoPipes
506+
&& MRPAuxResCharging
503507
&& (Car as MSTSWagon).DistributorPresent
504508
&& AuxResPressurePSI < BrakeLine2PressurePSI
505509
&& AuxResPressurePSI < ControlResPressurePSI

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ public AirTwinPipe(TrainCar car)
2424
: base(car)
2525
{
2626
TwoPipes = true;
27+
MRPAuxResCharging = true;
2728
DebugType = "2P";
2829
}
2930
}

0 commit comments

Comments
 (0)