@@ -3067,7 +3067,7 @@ private void UpdateFX(float elapsedClockSeconds)
30673067 BoosterCylinderSteamExhaust02SteamVolumeM3pS = BoosterCylinderSteamExhaustOn && BoosterCylinderSteamExhaust02On ? (10.0f * BoosterSteamFraction) : 0.0f;
30683068 BoosterCylinderSteamExhaust02SteamVelocityMpS = 100.0f;
30693069
3070- // Trace.TraceInformation("Booster Exhaust - ExhaustOn {0} Exhaust01On {1} Exhaust02On {2} ExhaustVolume01 {3} ExhaustVolume02 {4} SteamFraction {5} Speed {6}", BoosterCylinderSteamExhaustOn, BoosterCylinderSteamExhaust01On, BoosterCylinderSteamExhaust02On, BoosterCylinderSteamExhaust01SteamVolumeM3pS, BoosterCylinderSteamExhaust02SteamVolumeM3pS, BoosterSteamFraction, BoosterEngineSpeedRpM);
3070+ // Trace.TraceInformation("Booster Exhaust - ExhaustOn {0} Exhaust01On {1} Exhaust02On {2} ExhaustVolume01 {3} ExhaustVolume02 {4} SteamFraction {5} Speed {6}", BoosterCylinderSteamExhaustOn, BoosterCylinderSteamExhaust01On, BoosterCylinderSteamExhaust02On, BoosterCylinderSteamExhaust01SteamVolumeM3pS, BoosterCylinderSteamExhaust02SteamVolumeM3pS, BoosterSteamFraction, BoosterEngineSpeedRpM);
30713071
30723072 // Booster Cylinder Steam Cylinder Cocks (automatic)
30733073 BoosterCylinderCockSteam11VolumeMpS = BoosterCylinderCocksOn && BoosterCylinderCock11On ? (10.0f * BoosterSteamFraction) : 0.0f;
@@ -3216,6 +3216,8 @@ private void UpdateFX(float elapsedClockSeconds)
32163216 for (int i = 0; i < SteamEngines.Count; i++)
32173217 {
32183218
3219+ variable[i] = 0;
3220+
32193221 // Variable is proportional to angular speed, value of 10 means 1 rotation/second.
32203222 // If wheel is not slipping then use normal wheel speed, this reduces oscillations in variable1 which causes issues with sounds.
32213223
@@ -3231,17 +3233,28 @@ private void UpdateFX(float elapsedClockSeconds)
32313233 variable[i] = ThrottlePercent == 0 ? 0 : variable[i];
32323234
32333235 // overwrite Booster variable if in Idle or Run mode - gears not engaged
3234- if (SteamEngines[i].AuxiliarySteamEngineType != SteamEngine.AuxiliarySteamEngineTypes.Booster && (SteamBoosterRunMode && !BoosterGearsEngaged) || SteamBoosterIdleMode )
3236+ if (SteamEngines[i].AuxiliarySteamEngineType == SteamEngine.AuxiliarySteamEngineTypes.Booster)
32353237 {
3236- variable[i] = BoosterEngineSpeedRpM / MathHelper.Pi * 5;
3238+ if (!SteamBoosterAirOpen || BoosterAirisLow) // Booster is off
3239+ {
3240+ variable[i] = 0;
3241+ }
3242+ else if ((SteamBoosterRunMode && !BoosterGearsEngaged) || SteamBoosterIdleMode) // Run mode - gears not engaged, and Idle mode
3243+ {
3244+ variable[i] = pS.FrompM(BoosterEngineSpeedRpM) * 5;
3245+ }
3246+ else if (SteamBoosterRunMode && BoosterGearsEngaged) // Run mode - gears engaged, runs in similar fashion to main engine.
3247+ {
3248+ variable[i] = variable[i];
3249+ }
32373250 }
32383251 }
32393252
32403253 // Set variables for each engine
32413254 Variable1 = variable[0];
3242- Variable2_1 = variable[1];
3243- Variable3_1 = variable[2];
3244- Variable4_1 = variable[3];
3255+ Variable1_2 = variable[1];
3256+ Variable1_3 = variable[2];
3257+ Variable1_4 = variable[3];
32453258
32463259 Variable2 = MathHelper.Clamp((CylinderCocksPressureAtmPSI - OneAtmospherePSI) / BoilerPressurePSI * 100f, 0, 100);
32473260
@@ -3251,11 +3264,12 @@ private void UpdateFX(float elapsedClockSeconds)
32513264 }
32523265 else if ((SteamBoosterRunMode && !BoosterGearsEngaged) || SteamBoosterIdleMode) // Run mode - gears not engaged, and Idle mode
32533266 {
3254- Variable2_Booster = CabSteamBoosterPressurePSI / MaxBoilerPressurePSI;
3267+ Variable2_Booster = ( CabSteamBoosterPressurePSI / MaxBoilerPressurePSI) * 100f ;
32553268 }
3256- else if (SteamBoosterRunMode && BoosterGearsEngaged) // Run mode - gears engaged
3269+ else if (SteamBoosterRunMode && BoosterGearsEngaged) // Run mode - gears engaged, runs in similar fashion to main engine.
32573270 {
3258- Variable2_Booster = CabSteamChestPressurePSI / MaxBoilerPressurePSI;
3271+ // Variable2_Booster = CabSteamChestPressurePSI / MaxBoilerPressurePSI;
3272+ Variable2_Booster = Variable2;
32593273 }
32603274
32613275 Variable3 = FuelRateSmoothed * 100;
@@ -6045,7 +6059,6 @@ private void UpdateSteamTractiveForce(float elapsedClockSeconds, float locomotiv
60456059 SteamEngines[numberofengine].TractiveForceN = N.FromLbf((SteamEngines[numberofengine].MaxIndicatedHorsePowerHP * 375.0f) / pS.TopH(Me.ToMi(SpeedMpS)));
60466060 SteamEngines[numberofengine].IndicatedHorsePowerHP = SteamEngines[numberofengine].MaxIndicatedHorsePowerHP; // Set IHP to maximum value
60476061 IsCritTELimit = true; // Flag if limiting TE
6048-
60496062 }
60506063 else
60516064 {
@@ -6102,8 +6115,6 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float loc
61026115
61036116 SteamEngines[i].CompareIndicatedHorsePower = (N.ToLbf(SteamEngines[i].TractiveForceN) * pS.TopH(Me.ToMi(absSpeedMpS))) / 375.0f;
61046117
6105-
6106-
61076118 // Set Max Power equal to max IHP
61086119 MaxPowerW += W.FromHp(SteamEngines[i].MaxIndicatedHorsePowerHP);
61096120
@@ -6148,7 +6159,6 @@ protected override void UpdateTractiveForce(float elapsedClockSeconds, float loc
61486159 {
61496160 TractiveForceN = 0;
61506161 }
6151-
61526162 }
61536163
61546164
@@ -7508,7 +7518,7 @@ public override string GetDebugStatus()
75087518 );
75097519
75107520 // Temporary debug script.
7511- status.AppendFormat("{0}\t{1}\t{2:N2}\t{3}\t{4:N2}\t{5}\t{6:N2}\t{7}\t{8}\t{9}\t{10}\n",
7521+ status.AppendFormat("{0}\t{1}\t{2:N2}\t{3}\t{4:N2}\t{5}\t{6:N2}\t{7}\t{8}\t{9}\t{10:N2 }\n",
75127522 Simulator.Catalog.GetString("Boost:"),
75137523 Simulator.Catalog.GetString("GearT"),
75147524 BoosterGearEngageTimerS,
@@ -7573,6 +7583,33 @@ public override string GetDebugStatus()
75737583 Train.LastCar.CarNetHeatFlowRateW);
75747584 }
75757585
7586+ #if DEBUG_STEAM_SOUND_VARIABLES
7587+
7588+ status.AppendFormat("\n\t\t === {0} === \n", Simulator.Catalog.GetString("Sound Variables"));
7589+ status.AppendFormat("{0}\t{1:N2}\t{2}\t{3:N2}\t{4}\t{5:N2}\t{6}\t{7:N2}\t{8}\t{9:N2}\t{10}\t{11:N2}\t{12}\t{13:N2}\n",
7590+ Simulator.Catalog.GetString("V1:"),
7591+ Variable1,
7592+ Simulator.Catalog.GetString("V2:"),
7593+ Variable2,
7594+ Simulator.Catalog.GetString("V3:"),
7595+ Variable3,
7596+
7597+
7598+ Simulator.Catalog.GetString("V1_2:"),
7599+ Variable1_2,
7600+ Simulator.Catalog.GetString("V1_3:"),
7601+ Variable1_3,
7602+ Simulator.Catalog.GetString("V1_4:"),
7603+ Variable1_4,
7604+
7605+ Simulator.Catalog.GetString("V2_B:"),
7606+ Variable2_Booster
7607+
7608+
7609+ );
7610+
7611+ #endif
7612+
75767613 status.AppendFormat("\n\t\t === {0} === \n", Simulator.Catalog.GetString("Fireman"));
75777614 status.AppendFormat("{0}\t{1}\t{2}\t\t{3}\t{4}\t\t{5}\t{6:N0}/{13}\t\t{7}\t{8:N0}/{13}\t\t{9}\t{10:N0}/{13}\t\t{11}\t{12}/{14}{13}\t{15}\t{16}/{18}{17}\t\t{19}\t{20:N0}\n",
75787615 Simulator.Catalog.GetString("Fire:"),
@@ -7988,21 +8025,6 @@ public override string GetDebugStatus()
79888025 );
79898026
79908027
7991- #endif
7992-
7993-
7994- #if DEBUG_STEAM_SOUND_VARIABLES
7995-
7996- status.AppendFormat("\n\t\t === {0} === \n", Simulator.Catalog.GetString("Sound Variables"));
7997- status.AppendFormat("{0}\t{1:N2}\t{2}\t{3:N2}\t{4}\t{5:N2}\n",
7998- Simulator.Catalog.GetString("V1:"),
7999- Variable1,
8000- Simulator.Catalog.GetString("V2:"),
8001- Variable2,
8002- Simulator.Catalog.GetString("V3:"),
8003- Variable3
8004- );
8005-
80068028#endif
80078029
80088030 // If vacuum braked display information on ejectors
0 commit comments