You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Source/Orts.Simulation/Simulation/RollingStocks/MSTSSteamLocomotive.cs
+33-52Lines changed: 33 additions & 52 deletions
Original file line number
Diff line number
Diff line change
@@ -155,8 +155,6 @@ public class MSTSSteamLocomotive : MSTSLocomotive
155
155
floatPrevCombinedTenderWaterVolumeUKG;
156
156
floatPreviousTenderWaterVolumeUKG;
157
157
publicfloatMaxLocoTenderWaterMassKG=1;// Maximum read from Eng file - this value must be non-zero, if not defined in ENG file, can cause NaN errors
158
-
floatRestoredMaxTotalCombinedWaterVolumeUKG;// Values to restore after game save
159
-
floatRestoredCombinedTenderWaterVolumeUKG;// Values to restore after game save
160
158
161
159
// Tender
162
160
@@ -184,7 +182,6 @@ public class MSTSSteamLocomotive : MSTSLocomotive
184
182
floatbaseStartTempK;// Starting water temp
185
183
floatStartBoilerHeatBTU;
186
184
publicfloatBoilerMassLB;// current total mass of water and steam in boiler (changes as boiler usage changes)
187
-
boolRestoredGame=false;// Flag to indicate that game is being restored. This will stop some values from being "initialised", as this will overwrite restored values.
188
185
189
186
floatBoilerKW;// power of boiler
190
187
floatMaxBoilerKW;// power of boiler at full performance
@@ -971,15 +968,14 @@ public override void Copy(MSTSWagon copy)
@@ -1450,12 +1445,6 @@ public override void Initialize()
1450
1445
1451
1446
MaxTotalCombinedWaterVolumeUKG=(Kg.ToLb(MaxLocoTenderWaterMassKG)/WaterLBpUKG);// Initialise loco with tender water only - will be updated as appropriate
1452
1447
1453
-
if(RestoredCombinedTenderWaterVolumeUKG>1.0)// Check to see if this is a restored game -(assumed so if Restored >0), then set water controller values based upon saved values
@@ -1509,11 +1498,9 @@ public override void Initialize()
1509
1498
Trace.TraceWarning("Evaporation Area not found in ENG file and has been set to {0} m^2",EvaporationAreaM2);// Advise player that Evaporation Area is missing from ENG file
1510
1499
}
1511
1500
1512
-
if(!RestoredGame)// If this is not a restored game, then initialise these values
1513
-
{
1514
-
CylinderSteamUsageLBpS=1.0f;// Set to 1 to ensure that there are no divide by zero errors
1515
-
WaterFraction=0.9f;// Initialise boiler water level at 90%
1516
-
}
1501
+
CylinderSteamUsageLBpS=1.0f;// Set to 1 to ensure that there are no divide by zero errors
1502
+
WaterFraction=0.9f;// Initialise boiler water level at 90%
1503
+
1517
1504
floatMaxWaterFraction=0.9f;// Initialise the max water fraction when the boiler starts
1518
1505
if(BoilerEvapRateLbspFt2==0)// If boiler evaporation rate is not in ENG file then set a default value
1519
1506
{
@@ -1895,39 +1882,36 @@ public override void Initialize()
1895
1882
1896
1883
// Initialise Locomotive in a Hot or Cold Start Condition
1897
1884
1898
-
if(!RestoredGame)// Only initialise the following values if game is not being restored.
1885
+
if(HotStart)
1899
1886
{
1900
-
if(HotStart)
1901
-
{
1902
-
// Hot Start - set so that FlueTemp is at maximum, boilerpressure slightly below max
BoilerStartkW=Kg.FromLb((BoilerPressurePSI/MaxBoilerPressurePSI)*TheoreticalMaxSteamOutputLBpS)*W.ToKW(W.FromBTUpS(SteamHeatPSItoBTUpLB[BoilerPressurePSI]));// Given pressure is slightly less then max, this figure should be slightly less, ie reduce TheoreticalMaxSteamOutputLBpS, for the time being assume a ratio of bp to MaxBP
BoilerPressurePSI=MaxBoilerPressurePSI*0.66f;// Allow for cold start - start at 66% of max boiler pressure - check pressure value given heat in boiler????
BoilerStartkW=Kg.FromLb((BoilerPressurePSI/MaxBoilerPressurePSI)*TheoreticalMaxSteamOutputLBpS)*W.ToKW(W.FromBTUpS(SteamHeatPSItoBTUpLB[BoilerPressurePSI]));// Given pressure is slightly less then max, this figure should be slightly less, ie reduce TheoreticalMaxSteamOutputLBpS, for the time being assume a ratio of bp to MaxBP
BoilerPressurePSI=MaxBoilerPressurePSI*0.66f;// Allow for cold start - start at 66% of max boiler pressure - check pressure value given heat in boiler????
0 commit comments