Skip to content

Commit 6afcf32

Browse files
committed
Automatic merge of T1.5.1-1004-g6fd841761e and 21 pull requests
- Pull request #799 at dfc715e: Consolidated wind simulation - Pull request #839 at d00beb9: First phase of https://blueprints.launchpad.net/or/+spec/additional-cruise-control-parameters - Pull request #876 at f92de76: docs: add source for documents previously on website to source Documentation folder - Pull request #882 at 8f695a4: Blueprint/train car operations UI window - Pull request #885 at 2728d6d: feat: Add notifications to Menu - Pull request #891 at 9a1d6b2: Auto save - Pull request #892 at 1f5ba4c: Signal Function OPP_SIG_ID_TRAINPATH - Pull request #896 at 5866028: First implementation of https://blueprints.launchpad.net/or/+spec/specific-sounds-for-ai-trains - Pull request #900 at c27f32d: DMI updates - Pull request #903 at 3e390b8: Downloading route content (Github, zip) - Pull request #912 at 359cfee: New Triple Valve Features Vol. 2 - Pull request #922 at 0d3e70b: Autopilot for timetable mode - Pull request #946 at 91a03af: Advanced track sounds - Pull request #949 at d73de81: Oil Burning Locomotive - Pull request #952 at 8347095: Investigation - Pulsing graphics - Pull request #953 at a519452: Fix Lights Crash on Corrupt Shapes - Pull request #954 at 84c2f4b: Add Support for Multiple Track Profiles - Pull request #956 at 406cba6: Map settings saved - Pull request #959 at 2452cb0: Fix TrackViewer crash on big zoom value - Pull request #960 at c8e2a28: Fix draw state name in scripts - Pull request #962 at 46d0472: Fix pantographs on unpowered cars
23 parents c0fb55d + 6fd8417 + dfc715e + d00beb9 + f92de76 + 8f695a4 + 2728d6d + 9a1d6b2 + 1f5ba4c + 5866028 + c27f32d + 3e390b8 + 359cfee + 0d3e70b + 91a03af + d73de81 + 8347095 + a519452 + 84c2f4b + 406cba6 + 2452cb0 + c8e2a28 + 46d0472 commit 6afcf32

File tree

2 files changed

+30
-12
lines changed

2 files changed

+30
-12
lines changed

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

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ public class MSTSSteamLocomotive : MSTSLocomotive
313313

314314
float FuelFeedRateSmoothedKGpS = 0.0f; // Smoothed Fuel feedd Rate
315315
public float FuelBurnRateSmoothedKGpS; // Smoothed fuel burning rate
316-
float OilSpecificGravity = 0.9659f; // Assume a mid range of API for this value, say API = 15 @ 20 Cdeg.
316+
public float OilSpecificGravity = 0.9659f; // Assume a mid range of API for this value, say API = 15 @ 20 Cdeg.
317317
float WaterSpecificGravity = 1.0f; // Water @ 20 degC.
318318

319319
bool FuelOilSteamHeatingReqd = false;
@@ -410,7 +410,7 @@ public float TenderFuelMassKG // Decreased by firing and increased
410410
set { FuelController.CurrentValue = value / MaxTenderFuelMassKG; }
411411
}
412412

413-
float MaxTenderOilMassL;
413+
public float MaxTenderOilMassL;
414414
float DamperBurnEffect; // Effect of the Damper control Used in manual firing)
415415
float Injector1Fraction = 0.0f; // Fraction (0-1) of injector 1 flow from Fireman controller or AI
416416
float Injector2Fraction = 0.0f; // Fraction (0-1) of injector of injector 2 flow from Fireman controller or AI
@@ -7831,18 +7831,21 @@ public override string GetDebugStatus()
78317831
status.AppendFormat("{0}\t\t{1}\n", Simulator.Catalog.GetString("Locomotive Type:"),
78327832
SteamLocoType);
78337833

7834-
status.AppendFormat("{0}\t{1}\t{6}\t{2}\t{7}\t{3}\t{8}\t{4}\t{9}\t{5}\t{10}\n",
7834+
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",
78357835
Simulator.Catalog.GetString("Input:"),
78367836
Simulator.Catalog.GetString("Evap"),
7837-
Simulator.Catalog.GetString("Grate"),
7838-
Simulator.Catalog.GetString("Boiler"),
7839-
Simulator.Catalog.GetString("SuperHr"),
7840-
Simulator.Catalog.GetString("FuelCal"),
78417837
FormatStrings.FormatArea(EvaporationAreaM2, IsMetric),
7842-
FormatStrings.FormatArea(GrateAreaM2, IsMetric),
7843-
FormatStrings.FormatVolume(Me3.FromFt3(BoilerVolumeFT3), IsMetric),
7838+
Simulator.Catalog.GetString("SuperHr"),
78447839
FormatStrings.FormatArea(SuperheatAreaM2, IsMetric),
7845-
FormatStrings.FormatEnergyDensityByMass(FuelCalorificKJpKG, IsMetric));
7840+
Simulator.Catalog.GetString("Boiler"),
7841+
FormatStrings.FormatVolume(Me3.FromFt3(BoilerVolumeFT3), IsMetric),
7842+
Simulator.Catalog.GetString("Grate"),
7843+
FormatStrings.FormatArea(GrateAreaM2, IsMetric),
7844+
Simulator.Catalog.GetString("FType"),
7845+
SteamLocomotiveFuelType.ToString(),
7846+
Simulator.Catalog.GetString("FuelCal"),
7847+
FormatStrings.FormatEnergyDensityByMass(FuelCalorificKJpKG, IsMetric)
7848+
);
78467849

78477850
status.AppendFormat("{0}\t{1}\t{2:N2}\t{3}\t{4:N3}\n",
78487851
Simulator.Catalog.GetString("Adj:"),

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

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

5758
namespace Orts.Simulation.RollingStocks
@@ -149,6 +150,7 @@ public enum WindowState
149150

150151
bool TenderWeightInitialize = true;
151152
float TenderWagonMaxFuelMassKG;
153+
float TenderWagonMaxOilMassL;
152154
float TenderWagonMaxWaterMassKG;
153155

154156
protected float FrictionC1; // MSTS Friction parameters
@@ -1276,6 +1278,7 @@ public virtual void Parse(string lowercasetoken, STFReader stf)
12761278
case "wagon(ortsauxtenderwatermass": AuxTenderWaterMassKG = stf.ReadFloatBlock(STFReader.UNITS.Mass, null); break;
12771279
case "wagon(ortstenderwagonwoodmass":
12781280
case "wagon(ortstenderwagoncoalmass": TenderWagonMaxFuelMassKG = stf.ReadFloatBlock(STFReader.UNITS.Mass, null); break;
1281+
case "wagon(ortsmaxtenderfueloilvolume": TenderWagonMaxOilVolumeL = stf.ReadFloatBlock(STFReader.UNITS.Volume, null); break;
12791282
case "wagon(ortstenderwagonwatermass": TenderWagonMaxWaterMassKG = stf.ReadFloatBlock(STFReader.UNITS.Mass, null); break;
12801283
case "wagon(ortsheatingwindowderatingfactor": WindowDeratingFactor = stf.ReadFloatBlock(STFReader.UNITS.None, null); break;
12811284
case "wagon(ortsheatingcompartmenttemperatureset": DesiredCompartmentTempSetpointC = stf.ReadFloatBlock(STFReader.UNITS.Temperature, null); break;
@@ -1676,6 +1679,7 @@ public virtual void Copy(MSTSWagon copy)
16761679
WheelFlangeLengthM = copy.WheelFlangeLengthM;
16771680
AuxTenderWaterMassKG = copy.AuxTenderWaterMassKG;
16781681
TenderWagonMaxFuelMassKG = copy.TenderWagonMaxFuelMassKG;
1682+
TenderWagonMaxOilVolumeL = copy.TenderWagonMaxOilMassL;
16791683
TenderWagonMaxWaterMassKG = copy.TenderWagonMaxWaterMassKG;
16801684
InitWagonNumAxles = copy.InitWagonNumAxles;
16811685
WagonNumAxles = copy.WagonNumAxles;
@@ -2047,7 +2051,7 @@ public override void Update(float elapsedClockSeconds)
20472051
ConfirmSteamLocomotiveTender(); // Confirms that a tender is connected to the steam locomotive
20482052

20492053
// Adjusts water and coal mass based upon values assigned to the tender found in the WAG file rather then those defined in ENG file.
2050-
if (WagonType == WagonTypes.Tender && TenderWeightInitialize && TenderWagonMaxFuelMassKG != 0 && TenderWagonMaxWaterMassKG != 0)
2054+
if (WagonType == WagonTypes.Tender && TenderWeightInitialize && (TenderWagonMaxFuelMassKG != 0 || TenderWagonMaxOilMassL != 0) && TenderWagonMaxWaterMassKG != 0)
20512055
{
20522056

20532057
// Find the associated steam locomotive for this tender
@@ -2069,9 +2073,17 @@ public override void Update(float elapsedClockSeconds)
20692073
float TempMaxCombinedWater = TendersSteamLocomotive.MaxTotalCombinedWaterVolumeUKG;
20702074
TendersSteamLocomotive.MaxTotalCombinedWaterVolumeUKG = (TempMaxCombinedWater - (Kg.ToLb(TendersSteamLocomotive.MaxLocoTenderWaterMassKG) / WaterLBpUKG)) + (Kg.ToLb(TenderWagonMaxWaterMassKG) / WaterLBpUKG);
20712075

2072-
TendersSteamLocomotive.MaxTenderFuelMassKG = TenderWagonMaxFuelMassKG;
20732076
TendersSteamLocomotive.MaxLocoTenderWaterMassKG = TenderWagonMaxWaterMassKG;
20742077

2078+
if (TendersSteamLocomotive.SteamLocomotiveFuelType == SteamLocomotiveFuelTypes.Oil)
2079+
{
2080+
TendersSteamLocomotive.MaxTenderFuelMassKG = TendersSteamLocomotive.MaxTenderOilMassL * TendersSteamLocomotive.OilSpecificGravity;
2081+
}
2082+
else
2083+
{
2084+
TendersSteamLocomotive.MaxTenderFuelMassKG = TenderWagonMaxFuelMassKG;
2085+
}
2086+
20752087
if (Simulator.Settings.VerboseConfigurationMessages)
20762088
{
20772089
Trace.TraceInformation("Fuel and Water Masses adjusted to Tender Values Specified in WAG File - Coal mass {0} kg, Water Mass {1}", FormatStrings.FormatMass(TendersSteamLocomotive.MaxTenderFuelMassKG, IsMetric), FormatStrings.FormatFuelVolume(L.FromGUK(TendersSteamLocomotive.MaxTotalCombinedWaterVolumeUKG), IsMetric, IsUK));
@@ -3895,6 +3907,9 @@ public MSTSCoupling Coupler
38953907
return Couplers[0]; // defaults to the rear coupler (typically the first read)
38963908
}
38973909
}
3910+
3911+
public float TenderWagonMaxOilVolumeL { get; private set; }
3912+
38983913
public override float GetCouplerZeroLengthM()
38993914
{
39003915
if (IsPlayerTrain && Simulator.UseAdvancedAdhesion && !Simulator.Settings.SimpleControlPhysics && IsAdvancedCoupler)

0 commit comments

Comments
 (0)