Skip to content

Commit 8fdc42b

Browse files
committed
Suggested reviewer changes
1 parent da7663b commit 8fdc42b

File tree

5 files changed

+32
-31
lines changed

5 files changed

+32
-31
lines changed

Source/Orts.Simulation/Simulation/AIs/AI.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,11 +926,11 @@ public AITrain CreateAITrainDetail(Service_Definition sd, Traffic_Service_Defini
926926
mstsSteamLocomotive.CombinedTenderWaterVolumeUKG = ORTS.Common.Kg.ToLb(mstsSteamLocomotive.MaxLocoTenderWaterMassKG) / 10.0f * Simulator.Activity.Tr_Activity.Tr_Activity_Header.FuelWater / 100.0f;
927927

928928
// Adjust fuel stocks depending upon fuel used - in Activity mode
929-
if (mstsSteamLocomotive.SteamLocomotiveFuelType == MSTSLocomotive.SteamLocomotiveFuelTypes.Wood)
929+
if (mstsSteamLocomotive.SteamLocomotiveFuelType == MSTSSteamLocomotive.SteamLocomotiveFuelTypes.Wood)
930930
{
931931
mstsSteamLocomotive.TenderFuelMassKG = mstsSteamLocomotive.MaxTenderFuelMassKG * Simulator.Activity.Tr_Activity.Tr_Activity_Header.FuelWood / 100.0f;
932932
}
933-
else if (mstsSteamLocomotive.SteamLocomotiveFuelType == MSTSLocomotive.SteamLocomotiveFuelTypes.Oil)
933+
else if (mstsSteamLocomotive.SteamLocomotiveFuelType == MSTSSteamLocomotive.SteamLocomotiveFuelTypes.Oil)
934934
{
935935
mstsSteamLocomotive.TenderFuelMassKG = mstsSteamLocomotive.MaxTenderFuelMassKG * Simulator.Activity.Tr_Activity.Tr_Activity_Header.FuelDiesel / 100.0f;
936936
}

Source/Orts.Simulation/Simulation/RollingStocks/MSTSLocomotive.cs

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -239,25 +239,6 @@ public float CurrentLocomotiveSteamHeatBoilerWaterCapacityL
239239
//float DebugSpeed = 5.0f; // Initialise at 5 mph
240240
//float DebugTimer = 0.0f;
241241

242-
public enum SteamLocomotiveFuelTypes
243-
{
244-
Unknown,
245-
Oil,
246-
Wood, // not used at the moment
247-
Coal, // defaults to coal
248-
}
249-
250-
public SteamLocomotiveFuelTypes SteamLocomotiveFuelType;
251-
252-
public enum SteamLocomotiveFeedWaterSystemTypes
253-
{
254-
Unknown,
255-
MotionPump,
256-
SteamInjector, // not used at the moment
257-
}
258-
259-
public SteamLocomotiveFeedWaterSystemTypes SteamLocomotiveFeedWaterType;
260-
261242
// Adhesion parameters
262243
public enum SlipControlType
263244
{

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

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@
8484
using Orts.Simulation.Simulation.RollingStocks.SubSystems.PowerSupplies;
8585
using Orts.Simulation.RollingStocks.SubSystems.PowerTransmissions;
8686
using SharpDX.Direct3D9;
87+
using Orts.Simulation.RollingStocks;
88+
using static Orts.Simulation.RollingStocks.MSTSSteamLocomotive;
8789

8890
namespace Orts.Simulation.RollingStocks
8991
{
@@ -684,11 +686,30 @@ public float TenderFuelMassKG // Decreased by firing and increased
684686
float ConnectRodLengthFt = 10.8f;
685687
float RodCoGFt = 4.32f; // 0.4 from crank end of rod
686688

687-
#endregion
689+
public enum SteamLocomotiveFuelTypes
690+
{
691+
Unknown,
692+
Oil,
693+
Wood,
694+
Coal, // defaults to coal
695+
}
696+
697+
public SteamLocomotiveFuelTypes SteamLocomotiveFuelType;
698+
699+
public enum SteamLocomotiveFeedWaterSystemTypes
700+
{
701+
Unknown,
702+
MotionPump,
703+
SteamInjector, // not used at the moment
704+
}
705+
706+
public SteamLocomotiveFeedWaterSystemTypes SteamLocomotiveFeedWaterType;
707+
708+
#endregion
688709

689-
#region Variables for visual effects (steam, smoke)
710+
#region Variables for visual effects (steam, smoke)
690711

691-
public readonly SmoothedData StackSteamVelocityMpS = new SmoothedData(2);
712+
public readonly SmoothedData StackSteamVelocityMpS = new SmoothedData(2);
692713
public float StackSteamVolumeM3pS;
693714
public float StackParticleDurationS;
694715
public float StackCount;

Source/Orts.Simulation/Simulation/RollingStocks/MSTSWagon.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
using System.Diagnostics;
5353
using System.IO;
5454
using System.Linq;
55-
using static Orts.Simulation.RollingStocks.MSTSLocomotive;
5655
using Event = Orts.Common.Event;
5756

5857
namespace Orts.Simulation.RollingStocks
@@ -148,7 +147,7 @@ public enum WindowState
148147
public float WagonFrontalAreaM2; // Frontal area of wagon
149148
public float TrailLocoResistanceFactor; // Factor to reduce base and wind resistance if locomotive is not leading - based upon original Davis drag coefficients
150149

151-
bool TenderWeightInitialize = true;
150+
bool TenderWeightInitialized = false;
152151
float TenderWagonMaxFuelMassKG;
153152
float TenderWagonMaxOilMassL;
154153
float TenderWagonMaxWaterMassKG;
@@ -1969,7 +1968,7 @@ public override void Update(float elapsedClockSeconds)
19691968
ConfirmSteamLocomotiveTender(); // Confirms that a tender is connected to the steam locomotive
19701969

19711970
// Adjusts water and coal mass based upon values assigned to the tender found in the WAG file rather then those defined in ENG file.
1972-
if (WagonType == WagonTypes.Tender && TenderWeightInitialize && (TenderWagonMaxFuelMassKG != 0 || TenderWagonMaxOilMassL != 0) && TenderWagonMaxWaterMassKG != 0)
1971+
if (WagonType == WagonTypes.Tender && !TenderWeightInitialized && (TenderWagonMaxFuelMassKG != 0 || TenderWagonMaxOilMassL != 0) && TenderWagonMaxWaterMassKG != 0)
19731972
{
19741973

19751974
// Find the associated steam locomotive for this tender
@@ -1993,7 +1992,7 @@ public override void Update(float elapsedClockSeconds)
19931992

19941993
TendersSteamLocomotive.MaxLocoTenderWaterMassKG = TenderWagonMaxWaterMassKG;
19951994

1996-
if (TendersSteamLocomotive.SteamLocomotiveFuelType == SteamLocomotiveFuelTypes.Oil)
1995+
if (TendersSteamLocomotive.SteamLocomotiveFuelType == MSTSSteamLocomotive.SteamLocomotiveFuelTypes.Oil)
19971996
{
19981997
TendersSteamLocomotive.MaxTenderFuelMassKG = TendersSteamLocomotive.MaxTenderOilMassL * TendersSteamLocomotive.OilSpecificGravity;
19991998
}
@@ -2010,7 +2009,7 @@ public override void Update(float elapsedClockSeconds)
20102009
}
20112010

20122011
// Rest flag so that this loop is not executed again
2013-
TenderWeightInitialize = false;
2012+
TenderWeightInitialized = true;
20142013
}
20152014

20162015
UpdateTenderLoad(); // Updates the load physics characteristics of tender and aux tender

Source/Orts.Simulation/Simulation/Simulator.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1317,11 +1317,11 @@ private Train InitializePlayerTrain()
13171317
mstsSteamLocomotive.CombinedTenderWaterVolumeUKG = (Kg.ToLb(mstsSteamLocomotive.MaxLocoTenderWaterMassKG) / 10.0f) * Activity.Tr_Activity.Tr_Activity_Header.FuelWater / 100.0f;
13181318

13191319
// Adjust fuel stocks depending upon fuel used - in Explore mode
1320-
if (mstsSteamLocomotive.SteamLocomotiveFuelType == MSTSLocomotive.SteamLocomotiveFuelTypes.Wood)
1320+
if (mstsSteamLocomotive.SteamLocomotiveFuelType == MSTSSteamLocomotive.SteamLocomotiveFuelTypes.Wood)
13211321
{
13221322
mstsSteamLocomotive.TenderFuelMassKG = mstsSteamLocomotive.MaxTenderFuelMassKG * Activity.Tr_Activity.Tr_Activity_Header.FuelWood / 100.0f;
13231323
}
1324-
else if (mstsSteamLocomotive.SteamLocomotiveFuelType == MSTSLocomotive.SteamLocomotiveFuelTypes.Oil)
1324+
else if (mstsSteamLocomotive.SteamLocomotiveFuelType == MSTSSteamLocomotive.SteamLocomotiveFuelTypes.Oil)
13251325
{
13261326
mstsSteamLocomotive.TenderFuelMassKG = mstsSteamLocomotive.MaxTenderFuelMassKG * Activity.Tr_Activity.Tr_Activity_Header.FuelDiesel / 100.0f;
13271327
}

0 commit comments

Comments
 (0)