Skip to content

Commit 85557db

Browse files
committed
Automatic merge of T1.5.1-794-g4cad06780 and 14 pull requests
- Pull request #570 at 3539862: Experimental glTF 2.0 support with PBR lighting - 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 a055bca: Blueprint/train car operations UI window - Pull request #885 at 8f94333: feat: Add notifications to Menu - Pull request #886 at 6c0785b: Scene viewer extension to TrackViewer - 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 #897 at 0a9d939: feat: Improved system information collection - Pull request #899 at 6162387: Duplex steam engines - Booster Engine addition - Pull request #903 at 7353625: Downloading route content (Github, zip) - Pull request #906 at 5850660: Bug fix for https://bugs.launchpad.net/or/+bug/2047299 Crash loading a 3Dcab-only loco - Pull request #907 at 9b0b04f: Bug fix for https://bugs.launchpad.net/or/+bug/2047300 Dynamic tracks disappear after long tunnel - Pull request #908 at 4b4afe3: feat: supports switching adhesion precisions
16 parents 228fd76 + 4cad067 + 3539862 + d00beb9 + f92de76 + a055bca + 8f94333 + 6c0785b + 1f5ba4c + 5866028 + 0a9d939 + 6162387 + 7353625 + 5850660 + 9b0b04f + 4b4afe3 commit 85557db

File tree

2 files changed

+30
-10
lines changed

2 files changed

+30
-10
lines changed

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

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public class MSTSSteamLocomotive : MSTSLocomotive
135135
public bool BoosterGearsEngaged = false;
136136
public bool SteamBoosterLatchedLocked = false;
137137
public float SteamBoosterPressurePSI;
138-
float BoosterGearEngageTimeS;
138+
float BoosterGearEngageTimerS;
139139
float BoosterIdleHeatingTimerS;
140140
float BoosterIdleHeatingTimePeriodS = 120; // This is the time period that the Booster needs to be idled to heat it up
141141
bool BoosterIdleHeatingTimerReset = false;
@@ -2301,7 +2301,7 @@ public override void Update(float elapsedClockSeconds)
23012301
BoosterCylinderSteamExhaustOn = false;
23022302
BoosterCylinderCocksOn = true;
23032303
enginethrottle = 0.0f;
2304-
BoosterGearEngageTimeS = 0;
2304+
BoosterGearEngageTimerS = 0;
23052305

23062306
// Allow time for cylinders to heat up
23072307
if (!BoosterIdleHeatingTimerReset)
@@ -2326,7 +2326,7 @@ public override void Update(float elapsedClockSeconds)
23262326

23272327
// Trace.TraceInformation("Run Mode - Timer {0} GearPeriod {1}", BoosterGearEngageTimeS, BoosterGearEngageTimePeriodS);
23282328

2329-
if (BoosterGearEngageTimeS > BoosterGearEngageTimePeriodS) // Booster gears engaged
2329+
if (BoosterGearEngageTimerS > BoosterGearEngageTimePeriodS) // Booster gears engaged
23302330
{
23312331
enginethrottle = throttle;
23322332
BoosterCylinderSteamExhaustOn = true;
@@ -2336,12 +2336,17 @@ public override void Update(float elapsedClockSeconds)
23362336
BoosterIdleHeatingTimerS = 0;
23372337
// Trace.TraceInformation("Run Mode - " );
23382338
}
2339-
else
2339+
else // Booster gears have not engaged yet
23402340
{
23412341
BoosterCylinderSteamExhaustOn = false;
23422342
BoosterCylinderCocksOn = true;
2343-
}
2344-
BoosterGearEngageTimeS += elapsedClockSeconds;
2343+
BoosterGearEngageTimerS += elapsedClockSeconds;
2344+
}
2345+
}
2346+
else if (SteamBoosterAirOpen && SteamBoosterIdle) // Move booster to run mode, but not latched
2347+
{
2348+
BoosterCylinderSteamExhaustOn = false;
2349+
BoosterCylinderCocksOn = true;
23452350
}
23462351
else if (!SteamBoosterAirOpen || !SteamBoosterLatchedLocked) // Turn Booster off completely
23472352
{
@@ -2350,7 +2355,7 @@ public override void Update(float elapsedClockSeconds)
23502355
BoosterCylinderSteamExhaustOn = false;
23512356
BoosterCylinderCocksOn = false;
23522357
enginethrottle = 0;
2353-
BoosterGearEngageTimeS = 0;
2358+
BoosterGearEngageTimerS = 0;
23542359
BoosterIdleHeatingTimerReset = false;
23552360
BoosterCylinderSteamExhaustOn = false;
23562361
BoosterGearsEngaged = false;
@@ -7146,6 +7151,19 @@ public override string GetDebugStatus()
71467151
BoosterGearsEngaged ? Simulator.Catalog.GetString("On") : Simulator.Catalog.GetString("Off")
71477152
);
71487153

7154+
// Temporary debug script.
7155+
status.AppendFormat("{0}\t{1}\t{2:N2}\t{3}\t{4:N2}\t{5}\t{6:N2}\t{7}\t{8}\n",
7156+
Simulator.Catalog.GetString("Boost:"),
7157+
Simulator.Catalog.GetString("GearT"),
7158+
BoosterGearEngageTimerS,
7159+
Simulator.Catalog.GetString("GearP"),
7160+
BoosterGearEngageTimePeriodS,
7161+
Simulator.Catalog.GetString("IdleT"),
7162+
BoosterIdleHeatingTimerS,
7163+
Simulator.Catalog.GetString("IdleP"),
7164+
BoosterIdleHeatingTimePeriodS
7165+
);
7166+
71497167
#if DEBUG_LOCO_STEAM_USAGE
71507168
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}\t{11}\t{12:N2}\t{13}\t{14:N2}\t{15}\t{16:N2}\t{17}\t{18:N2}\t{19}\t{20:N2}\t{21}\t{22}\n",
71517169
"DbgUse:",

Source/RunActivity/Viewer3D/RollingStock/MSTSSteamLocomotiveViewer.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919

2020
using System;
2121
using System.Collections.Generic;
22+
using System.Diagnostics;
2223
using Microsoft.Xna.Framework;
2324
using Orts.Common;
2425
using Orts.Simulation;
@@ -326,11 +327,12 @@ public override void PrepareFrame(RenderFrame frame, ElapsedTime elapsedTime)
326327
drawer.SetOutput(car.CylinderSteamExhaustSteamVelocityMpS, car.CylinderSteamExhaust3SteamVolumeM3pS, car.CylinderSteamExhaustParticleDurationS);
327328

328329
foreach (var drawer in BoosterCylinderSteamExhaust01)
329-
drawer.SetOutput(car.BoosterCylinderSteamExhaust01SteamVelocityMpS, car.BoosterCylinderSteamExhaust01SteamVolumeM3pS, car.CylinderSteamExhaustParticleDurationS);
330+
drawer.SetOutput(car.BoosterCylinderSteamExhaust01SteamVelocityMpS, car.BoosterCylinderSteamExhaust01SteamVolumeM3pS, car.BoosterCylinderCockParticleDurationS);
330331

331-
foreach (var drawer in BoosterCylinderSteamExhaust02)
332-
drawer.SetOutput(car.BoosterCylinderSteamExhaust02SteamVelocityMpS, car.BoosterCylinderSteamExhaust02SteamVolumeM3pS, car.CylinderSteamExhaustParticleDurationS);
333332

333+
foreach (var drawer in BoosterCylinderSteamExhaust02)
334+
drawer.SetOutput(car.BoosterCylinderSteamExhaust02SteamVelocityMpS, car.BoosterCylinderSteamExhaust02SteamVolumeM3pS, car.BoosterCylinderCockParticleDurationS);
335+
334336
foreach (var drawer in BoosterCylinders11)
335337
drawer.SetOutput(car.BoosterCylinderCock11SteamVelocityMpS, car.BoosterCylinderCockSteam11VolumeMpS, car.BoosterCylinderCockParticleDurationS);
336338

0 commit comments

Comments
 (0)