Skip to content

Commit d0246f4

Browse files
committed
Automatic merge of T1.6-108-g8fb3285d6 and 13 pull requests
- Pull request #1082 at 2d20539: Allow variable water level in glass gauge - 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 47e9955: 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 #1128 at 086d502: Particle Emitter Overhaul - Pull request #1160 at 9dc6b3b: Route Based TTrack Sounds
15 parents fd59430 + 8fb3285 + 2d20539 + f46d5f2 + 492795a + 47e9955 + 91d2d26 + e241a0d + 39cd994 + 48c9a63 + 2516cce + 2f9e292 + 1ad9889 + 086d502 + 9dc6b3b commit d0246f4

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,7 @@ public float TenderFuelMassKG // Decreased by firing and increased
464464
float MSTSSteamGaugeGlassHeightM;
465465
float WaterGlassLengthM;
466466
float waterGlassFractionLevel; // Water glass level as a fraction
467+
float CurrentWaterGaugeFraction;
467468

468469
float MEPFactor = 0.7f; // Factor to determine the MEP
469470
float GrateAreaDesignFactor = 500.0f; // Design factor for determining Grate Area
@@ -7096,6 +7097,13 @@ private void UpdateWaterGauge()
70967097

70977098
GradientBoilerLevelFraction = MathHelper.Clamp(GradientBoilerLevelFraction, 0.0f, 1.0f);
70987099

7100+
CurrentWaterGaugeFraction = ((BoilerWaterFractionAbs - waterVariationLevelM / BoilerDiameterM) - WaterGlassMinLevel) / (WaterGlassMaxLevel - WaterGlassMinLevel); // Calculate water glass grade fraction
7101+
7102+
CurrentWaterGaugeFraction = MathHelper.Clamp(CurrentWaterGaugeFraction, 0.0f, 1.0f);
7103+
7104+
// Trace.TraceInformation("CurrentWaterGaugeFraction {0} BoilerWaterFract {1} waterVariation {2} GradientBoilerFraction {3}", CurrentWaterGaugeFraction, BoilerWaterFractionAbs, waterVariationLevelM, GradientBoilerLevelFraction);
7105+
7106+
70997107
if (BoilerWaterFractionAbs < WaterMinLevel) // Blow fusible plugs if absolute boiler water drops below minimum level
71007108
{
71017109
if (!FusiblePlugIsBlown)
@@ -7372,9 +7380,11 @@ private void UpdateFiring(float absSpeedMpS)
73727380
#region AI Fireman
73737381
{
73747382

7375-
var CurrentWaterGaugeFraction = waterGlassFractionLevel;
7383+
// CurrentWaterGaugeFraction = waterGlassFractionLevel;
7384+
7385+
// var CurrentWaterGaugeFraction = 1.0f - GradientBoilerLevelFraction;
73767386

7377-
// var CurrentWaterGaugeFraction = GradientBoilerLevelFraction;
7387+
// Trace.TraceInformation("CurrentWaterGaugeFraction {0} WaterGaugeFraction {1}", CurrentWaterGaugeFraction, waterGlassFractionLevel);
73787388

73797389
if (SteamLocomotiveFeedWaterType == SteamLocomotiveFeedWaterSystemTypes.MotionPump && !WaterIsExhausted)
73807390
{
@@ -7799,6 +7809,7 @@ public override string GetStatus()
77997809
status.AppendFormat("{0}{2} = {1:F0}% {3}{2}\n", Simulator.Catalog.GetString("Boiler water glass"), 100 * waterGlassFractionLevel, boilerWaterSafety, FiringIsManual ? Simulator.Catalog.GetString("(safe range)") : "");
78007810

78017811
status.AppendFormat("{0} = {1:F0}%\n", Simulator.Catalog.GetString("Boiler water grad"), GradientBoilerLevelFraction * 100);
7812+
status.AppendFormat("{0} = {1:F0}%\n", Simulator.Catalog.GetString("Boiler water trig"), CurrentWaterGaugeFraction * 100);
78027813

78037814
if (FiringIsManual)
78047815
{

0 commit comments

Comments
 (0)