@@ -130,6 +130,9 @@ public class MSTSSteamLocomotive : MSTSLocomotive
130130 public bool SteamBoosterLatchOn = false;
131131 public bool SteamBoosterIdle = false;
132132 public bool SteamBoosterAirOpen = false;
133+ public bool SteamBoosterRunMode = false;
134+ public bool SteamBoosterIdleMode = false;
135+ public bool SteamBoosterLatchedLocked = false;
133136
134137 /// <summary>
135138 /// Grate limit of locomotive exceedeed?
@@ -1092,11 +1095,11 @@ public override void Initialize()
10921095
10931096 if (MSTSNumCylinders < 0 && ZeroError(MSTSNumCylinders, "NumCylinders"))
10941097 MSTSNumCylinders = 0;
1095- if (ZeroError(MSTSCylinderDiameterM, "CylinderDiammeter "))
1098+ if (ZeroError(MSTSCylinderDiameterM, "MSTSCylinderDiameter "))
10961099 MSTSCylinderDiameterM = 1;
1097- if (ZeroError(MSTSCylinderStrokeM, "CylinderStroke "))
1100+ if (ZeroError(MSTSCylinderStrokeM, "MSTSCylinderStroke "))
10981101 MSTSCylinderStrokeM = 1;
1099- if (ZeroError(DriverWheelRadiusM, "WheelRadius "))
1102+ if (ZeroError(DriverWheelRadiusM, "MSTSWheelRadius "))
11001103 DriverWheelRadiusM = Me.FromIn(30.0f); // Wheel radius of loco drive wheels can be anywhere from about 10" to 40"
11011104 if (ZeroError(MaxBoilerPressurePSI, "MaxBoilerPressure"))
11021105 MaxBoilerPressurePSI = 1;
@@ -2175,19 +2178,54 @@ public override void Update(float elapsedClockSeconds)
21752178
21762179 for (int i = 0; i < SteamEngines.Count; i++)
21772180 {
2178- // Trace.TraceInformation("Booster - Air {0} Idle {1} Latch {2}", SteamBoosterAirOpen, SteamBoosterIdle, SteamBoosterLatchOn);
21792181
21802182 SteamEngines[i].IndicatedHorsePowerHP = (N.ToLbf(SteamEngines[i].TractiveForceN) * pS.TopH(Me.ToMi(absSpeedMpS))) / 375.0f;
21812183
21822184 if (SteamEngines[i].AuxiliarySteamEngineType != SteamEngine.AuxiliarySteamEngineTypes.Booster)
21832185 {
21842186 UpdateCylinders(elapsedClockSeconds, throttle, cutoff, absSpeedMpS, i);
21852187 }
2186- else if (SteamBoosterAirOpen && SteamBoosterLatchOn ) // Booster Engine
2188+ else if (SteamEngines[i].AuxiliarySteamEngineType == SteamEngine.AuxiliarySteamEngineTypes.Booster ) // Booster Engine
21872189 {
21882190 var boosterthrottle = 0.0f;
21892191 var boostercutoff = SteamEngines[i].BoosterCutoff;
2190- UpdateCylinders(elapsedClockSeconds, boosterthrottle, boostercutoff, absSpeedMpS, i);
2192+
2193+ // Confirm that Latch is on
2194+ if (SteamBoosterLatchOn && cutoff > SteamEngines[i].BoosterThrottleCutoff)
2195+ {
2196+ SteamBoosterLatchedLocked = true;
2197+ }
2198+ else
2199+ {
2200+ SteamBoosterLatchedLocked = false;
2201+ }
2202+
2203+ // Identify operating mode for the Booster
2204+ // Idle mode
2205+ if (SteamBoosterAirOpen && !SteamBoosterIdle && SteamBoosterLatchedLocked)
2206+ {
2207+ SteamBoosterRunMode = false;
2208+ SteamBoosterIdleMode = true;
2209+ boosterthrottle = 0.2f;
2210+ }
2211+ // Run mode
2212+ else if (SteamBoosterAirOpen && SteamBoosterIdle && SteamBoosterLatchedLocked)
2213+ {
2214+ SteamBoosterIdleMode = false;
2215+ SteamBoosterRunMode = true;
2216+ boosterthrottle = 1.0f;
2217+ }
2218+ else if (!SteamBoosterAirOpen || !SteamBoosterLatchedLocked)
2219+ {
2220+ SteamBoosterRunMode = false;
2221+ SteamBoosterIdleMode = false;
2222+ boosterthrottle = 0;
2223+ }
2224+
2225+ if (SteamBoosterRunMode || SteamBoosterIdleMode)
2226+ {
2227+ UpdateCylinders(elapsedClockSeconds, boosterthrottle, boostercutoff, absSpeedMpS, i);
2228+ }
21912229 }
21922230 BoilerMassLB -= elapsedClockSeconds * SteamEngines[i].CylinderSteamUsageLBpS; // Boiler mass will be reduced by cylinder steam usage
21932231 BoilerHeatBTU -= elapsedClockSeconds * SteamEngines[i].CylinderSteamUsageLBpS * (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); // Boiler Heat will be reduced by heat required to replace the cylinder steam usage, ie create steam from hot water.
@@ -2199,12 +2237,15 @@ public override void Update(float elapsedClockSeconds)
21992237
22002238 SteamEngines[i].TractiveForceN = 0;
22012239
2202- if (SteamEngines[i].AuxiliarySteamEngineType != SteamEngine.AuxiliarySteamEngineTypes.Booster || (SteamBoosterAirOpen && SteamBoosterLatchOn))
2203- UpdateTractiveForce(elapsedClockSeconds, 0, 0, 0, i);
2240+ if (SteamEngines[i].AuxiliarySteamEngineType == SteamEngine.AuxiliarySteamEngineTypes.Booster && (SteamBoosterIdleMode || SteamBoosterRunMode))
2241+ UpdateTractiveForce(elapsedClockSeconds, 0, 0, 0, i);
2242+ else
2243+ {
2244+ UpdateTractiveForce(elapsedClockSeconds, 0, 0, 0, i);
2245+ }
22042246
22052247 TractiveForceN += SteamEngines[i].TractiveForceN;
22062248
2207-
22082249 MotiveForceN += SteamEngines[i].AttachedAxle.CompensatedAxleForceN;
22092250 }
22102251
@@ -3857,7 +3898,6 @@ private void UpdateCylinders(float elapsedClockSeconds, float throttle, float cu
38573898
38583899 // Initialise values used in this module
38593900
3860-
38613901#if DEBUG_STEAM_CYLINDER_EVENTS
38623902
38633903 // THIS CODE IS NOT FULLY OPERATIONAL AT THIS TIME
@@ -6641,7 +6681,7 @@ public override string GetDebugStatus()
66416681 }
66426682 }
66436683
6644- status.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\n",
6684+ status.AppendFormat("{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}\t{8}\t{9}\t{10}\t{11}\t{12}\ n",
66456685 Simulator.Catalog.GetString("Status:"),
66466686 Simulator.Catalog.GetString("Safety"),
66476687 SafetyIsOn ? Simulator.Catalog.GetString("Open") : Simulator.Catalog.GetString("Closed"),
@@ -6650,7 +6690,11 @@ public override string GetDebugStatus()
66506690 Simulator.Catalog.GetString("Prime"),
66516691 BoilerIsPriming ? Simulator.Catalog.GetString("Yes") : Simulator.Catalog.GetString("No"),
66526692 Simulator.Catalog.GetString("Comp"),
6653- CylinderCompoundOn ? Simulator.Catalog.GetString("Off") : Simulator.Catalog.GetString("On")
6693+ CylinderCompoundOn ? Simulator.Catalog.GetString("Off") : Simulator.Catalog.GetString("On"),
6694+ Simulator.Catalog.GetString("BoostIdle"),
6695+ SteamBoosterIdleMode ? Simulator.Catalog.GetString("On") : Simulator.Catalog.GetString("Off"),
6696+ Simulator.Catalog.GetString("BoostRun"),
6697+ SteamBoosterRunMode ? Simulator.Catalog.GetString("On") : Simulator.Catalog.GetString("Off")
66546698 );
66556699
66566700#if DEBUG_LOCO_STEAM_USAGE
0 commit comments