Skip to content

Commit 2427698

Browse files
committed
further minor adjustment to steam brake
1 parent 03989f5 commit 2427698

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,9 @@ public override void Update(float elapsedClockSeconds)
345345
if (SteamBrakingCurrentFraction < SteamBrakeDesiredFraction) // Brake application, increase steam brake pressure to max value as appropriate
346346
{
347347

348-
SteamBrakingCurrentFraction += elapsedClockSeconds * lead.EngineBrakeController.ApplyRatePSIpS / conversionFactor;
348+
var diff = elapsedClockSeconds * lead.EngineBrakeController.ApplyRatePSIpS / conversionFactor;
349+
350+
SteamBrakingCurrentFraction += diff;
349351
if (SteamBrakingCurrentFraction > 1.0f)
350352
{
351353
SteamBrakingCurrentFraction = 1.0f;
@@ -354,7 +356,10 @@ public override void Update(float elapsedClockSeconds)
354356
}
355357
else if (SteamBrakingCurrentFraction > SteamBrakeDesiredFraction) // Brake release, decrease steam brake pressure to min value as appropriate
356358
{
357-
SteamBrakingCurrentFraction -= elapsedClockSeconds * lead.EngineBrakeController.ReleaseRatePSIpS / conversionFactor;
359+
360+
var diff = elapsedClockSeconds * lead.EngineBrakeController.ReleaseRatePSIpS / conversionFactor;
361+
362+
SteamBrakingCurrentFraction -= diff;
358363

359364
if (SteamBrakingCurrentFraction < 0)
360365
{
@@ -376,6 +381,7 @@ public override void Update(float elapsedClockSeconds)
376381
float equivalentBrakeLine3PressurePSI = equivalentEngineBrakePipeFraction * (MinimumVacuumPressureValue - MaximumVacuumPressureValue) + MaximumVacuumPressureValue;
377382

378383
lead.BrakeSystem.BrakeLine3PressurePSI = equivalentBrakeLine3PressurePSI; // If engine brake on, then don't allow engine brake pressure to drop when reducing train brake pressure
384+
379385
EngineBrakePipeFraction = SteamBrakingCurrentFraction;
380386
Car.PreviousSteamBrakeCylinderPressurePSI = 0; // set to zero so that this loop is not executed again until train brake is activated
381387
}

0 commit comments

Comments
 (0)