Skip to content

Commit 27a89c8

Browse files
committed
Automatic merge of T1.6-108-g8fb3285d6 and 13 pull requests
- Pull request #1156 at f46d5f2: Fix incorrectly disabled options in train operations window - Pull request #1091 at 492795a: Automatic speed control - Pull request #1120 at ba3c47f: Automatically Calculate Friction Values if Missing - Pull request #1121 at 91d2d26: Manually Override Articulation - Pull request #1124 at e241a0d: Built-in PBL2 brake controller - Pull request #1157 at 39cd994: Dynamic brake authorization by TCS - Pull request #1159 at 48c9a63: Skip OR warnings about TSRE-specific token Ruler - Pull request #1162 at 2516cce: specifies precedence of DDS over ACE - Pull request #1163 at 2f9e292: Fix: Crash when using Camera 8 and F9. - Pull request #1164 at 1ad9889: Fix: F9 crashes with a front coupled single steam locomotive by Csantucci. - Pull request #1082 at 56bb992: Allow variable water level in glass gauge - Pull request #1128 at 086d502: Particle Emitter Overhaul - Pull request #1160 at 9dc6b3b: Route Based TTrack Sounds
15 parents ab93d15 + 8fb3285 + f46d5f2 + 492795a + ba3c47f + 91d2d26 + e241a0d + 39cd994 + 48c9a63 + 2516cce + 2f9e292 + 1ad9889 + 56bb992 + 086d502 + 9dc6b3b commit 27a89c8

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

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

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7071,22 +7071,16 @@ private void UpdateWaterGauge()
70717071
// water variation is calculated as the opposite side of a triangle with half the boiler length as the reference length (Adjacent side)
70727072
var waterVariationLevelM = (float)Math.Tan(boilerangleRad) * (BoilerLengthM / 2.0f);
70737073

7074-
float glassLevelGradientM = 0;
7075-
70767074
// Downslope - CurrentElevationPercent = +ve, level variation will be -ve
70777075
// Uphill - CurrentElevationPercent = -ve, level variation will be +ve
70787076
// So, for example, if the loco is on a 1 in 100 down slope, the water level at the front of the boiler will be lower than at the
70797077
// back by 0.5% of the boiler length
70807078

70817079
// gradient variation due to slope needs to be reversed
7082-
glassLevelGradientM = waterVariationLevelM * -1.0f;
7083-
7084-
// Assume that reference glass height is 50% of glass
7085-
var maxWaterVariationIN = Me.ToIn(WaterGlassLengthM) / 2.0f;
7080+
waterVariationLevelM *= -1.0f;
70867081

70877082
float currentglasslevelfraction = 0;
7088-
float glasslevelM = 0;
7089-
7083+
70907084
// Convert reference point to a reading on glass
70917085
if (BoilerWaterFractionAbs > referenceBoilerLevelFraction)
70927086
{
@@ -7098,9 +7092,9 @@ private void UpdateWaterGauge()
70987092
currentglasslevelfraction = -1.0f * waterGlassFractionLevel;
70997093
}
71007094

7101-
glasslevelM = currentglasslevelfraction * BoilerDiameterM;
7095+
GradientBoilerLevelFraction = ((BoilerWaterFractionAbs + waterVariationLevelM / BoilerDiameterM) - WaterGlassMinLevel) / (WaterGlassMaxLevel - WaterGlassMinLevel); // Calculate water glass grade fraction
71027096

7103-
GradientBoilerLevelFraction = currentglasslevelfraction + (glassLevelGradientM / BoilerDiameterM);
7097+
GradientBoilerLevelFraction = MathHelper.Clamp(GradientBoilerLevelFraction, 0.0f, 1.0f);
71047098

71057099
if (BoilerWaterFractionAbs < WaterMinLevel) // Blow fusible plugs if absolute boiler water drops below minimum level
71067100
{

0 commit comments

Comments
 (0)