Skip to content

Commit 5310029

Browse files
committed
adjust counter pressure according to cutoff
1 parent bed8323 commit 5310029

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6006,9 +6006,10 @@ private void UpdateCylinders(float elapsedClockSeconds, float throttle, float cu
60066006

60076007
float currentDynamicBrakeFraction = DynamicBrakePercent / 100;
60086008

6009-
if (currentDynamicBrakeFraction > 0 && absSpeedMpS > 0)
6009+
if (currentDynamicBrakeFraction > 0 && absSpeedMpS > 0 && cutoff != 0)
60106010
{
6011-
float CylinderVolumePoint_compression = (currentDynamicBrakeFraction * Me.ToIn(SteamEngines[numberofengine].CylindersStrokeM)) + CylinderClearancePC;
6011+
float absCutoff = Math.Abs(cutoff);
6012+
float CylinderVolumePoint_compression = (currentDynamicBrakeFraction * absCutoff * Me.ToIn(SteamEngines[numberofengine].CylindersStrokeM)) + CylinderClearancePC;
60126013
float CylinderVolumePoint_release = (Me.ToIn(SteamEngines[numberofengine].CylindersStrokeM) + 2 * CylinderClearancePC) - CylinderVolumePoint_compression;
60136014

60146015
// Trace.TraceInformation("Vol-release {0} Vol-compression {1} Stroke {2}", CylinderVolumePoint_release, CylinderVolumePoint_compression, Me.ToIn(SteamEngines[numberofengine].CylindersStrokeM));
@@ -6042,14 +6043,6 @@ private void UpdateCylinders(float elapsedClockSeconds, float throttle, float cu
60426043
{
60436044
SteamEngines[numberofengine].CylinderCounterPressureBrakeForceN = 0;
60446045
}
6045-
6046-
6047-
6048-
6049-
6050-
6051-
6052-
60536046
}
60546047

60556048

0 commit comments

Comments
 (0)