Skip to content

Commit 805221e

Browse files
committed
Fix condition to activate blending
1 parent 71283ab commit 805221e

File tree

1 file changed

+9
-10
lines changed
  • Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS

1 file changed

+9
-10
lines changed

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

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1768,9 +1768,8 @@ public override void Update(float elapsedClockSeconds)
17681768
}
17691769
}
17701770
}
1771-
if (loco.LocomotivePowerSupply.DynamicBrakeAvailable)
17721771
{
1773-
if (loco.DynamicBrakePercent > 0 && Car.FrictionBrakeBlendingMaxForceN > 0)
1772+
if (loco.LocomotivePowerSupply.DynamicBrakeAvailable && loco.MaxDynamicBrakePercent > 0 && loco.DynamicBrakePercent > 0 && Car.FrictionBrakeBlendingMaxForceN > 0)
17741773
{
17751774
if (loco.DynamicBrakePartialBailOff)
17761775
{
@@ -1808,14 +1807,14 @@ public override void Update(float elapsedClockSeconds)
18081807
}
18091808
}
18101809
}
1811-
if (loco.DynamicBrakeEngineBrakeReplacement && loco.RemoteControlGroup == 0 && loco.AbsTractionSpeedMpS < loco.DynamicBrakeEngineBrakeReplacementSpeed && loco.Train.LeadLocomotive is MSTSLocomotive lead && lead.TrainBrakeController.TrainDynamicBrakeIntervention > 0)
1812-
{
1813-
var requiredBrakeForceN = loco.MaxDynamicBrakeForceN * lead.TrainBrakeController.TrainDynamicBrakeIntervention;
1814-
var reverseBlendingPressurePSI = Math.Min(Math.Max((requiredBrakeForceN - loco.DynamicBrakeForceN) / Car.FrictionBrakeBlendingMaxForceN * ReferencePressurePSI
1815-
+ BrakeCylinderSpringPressurePSI, 0), MaxCylPressurePSI);
1816-
reverseBlendingPressurePSI /= RelayValveRatio;
1817-
if (demandedPressurePSI < reverseBlendingPressurePSI) demandedPressurePSI = reverseBlendingPressurePSI;
1818-
}
1810+
}
1811+
if (loco.DynamicBrakeEngineBrakeReplacement && loco.RemoteControlGroup == 0 && loco.AbsTractionSpeedMpS < loco.DynamicBrakeEngineBrakeReplacementSpeed && loco.Train.LeadLocomotive is MSTSLocomotive lead && lead.TrainBrakeController.TrainDynamicBrakeIntervention > 0)
1812+
{
1813+
var requiredBrakeForceN = loco.MaxDynamicBrakeForceN * lead.TrainBrakeController.TrainDynamicBrakeIntervention;
1814+
var reverseBlendingPressurePSI = Math.Min(Math.Max((requiredBrakeForceN - loco.DynamicBrakeForceN) / Car.FrictionBrakeBlendingMaxForceN * ReferencePressurePSI
1815+
+ BrakeCylinderSpringPressurePSI, 0), MaxCylPressurePSI);
1816+
reverseBlendingPressurePSI /= RelayValveRatio;
1817+
if (demandedPressurePSI < reverseBlendingPressurePSI) demandedPressurePSI = reverseBlendingPressurePSI;
18191818
}
18201819
}
18211820
}

0 commit comments

Comments
 (0)