Skip to content

Commit cf96b3b

Browse files
committed
Automatic merge of T1.5.1-866-gbae4730e2 and 17 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 9c456aa: 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 42f1dd9: feat: Improved system information collection - Pull request #903 at 0d6d045: Downloading route content (Github, zip) - 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 ad3362c: feat: supports switching adhesion precisions - Pull request #911 at 6834af0: docs: Add refactoring as a special type of PR - Pull request #912 at 659396e: New Triple Valve Features Vol. 2 - Pull request #914 at ac762a5: Adjustments to Duplex steam - Pull request #915 at 6d911d7: Correct calculation error with curve friction - Pull request #916 at e466e27: Distributed Power Air Brake Synchronization
19 parents cc032d0 + bae4730 + 3539862 + d00beb9 + f92de76 + 9c456aa + 8f94333 + 6c0785b + 1f5ba4c + 5866028 + 42f1dd9 + 0d6d045 + 9b0b04f + ad3362c + 6834af0 + 659396e + ac762a5 + 6d911d7 + e466e27 commit cf96b3b

File tree

4 files changed

+73
-2
lines changed

4 files changed

+73
-2
lines changed

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

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -931,6 +931,19 @@ public override void Parse(string lowercasetoken, STFReader stf)
931931
STFException.TraceWarning(stf, "Skipped unknown engine type " + engineType);
932932
}
933933
break;
934+
case "engine(sandingsystemtype":
935+
stf.MustMatch("(");
936+
var sandingType = stf.ReadString();
937+
try
938+
{
939+
SandingSystemType = (SandingSystemTypes)Enum.Parse(typeof(SandingSystemTypes), sandingType.First().ToString().ToUpper() + sandingType.Substring(1));
940+
}
941+
catch
942+
{
943+
STFException.TraceWarning(stf, "Skipped unknown engine type " + sandingType);
944+
}
945+
break;
946+
934947
case "engine(ortstractionmotortype":
935948
stf.MustMatch("(");
936949
string tractionMotorType = stf.ReadString().ToUpper();
@@ -1180,6 +1193,7 @@ public override void Copy(MSTSWagon copy)
11801193
UnloadingSpeedMpS = locoCopy.UnloadingSpeedMpS;
11811194
SlipControlSystem = locoCopy.SlipControlSystem;
11821195
EngineType = locoCopy.EngineType;
1196+
SandingSystemType = locoCopy.SandingSystemType;
11831197
TractionMotorType = locoCopy.TractionMotorType;
11841198
TractiveForceCurves = locoCopy.TractiveForceCurves;
11851199
MaxContinuousForceN = locoCopy.MaxContinuousForceN;
@@ -3243,12 +3257,20 @@ public void UpdateTrackSander(float elapsedClockSeconds)
32433257
}
32443258
}
32453259

3260+
if (SandingSystemType == SandingSystemTypes.Steam)
3261+
{
3262+
3263+
3264+
}
3265+
else
3266+
{
32463267
// Calculate air consumption and change in main air reservoir pressure
32473268
float ActualAirConsumptionM3pS = pS.FrompM(TrackSanderAirComsumptionM3pS) * elapsedClockSeconds;
3248-
float SanderPressureDiffPSI = ActualAirConsumptionM3pS / Me3.ToFt3(MainResVolumeM3) ;
3269+
float SanderPressureDiffPSI = ActualAirConsumptionM3pS / Me3.ToFt3(MainResVolumeM3);
32493270
MainResPressurePSI -= SanderPressureDiffPSI;
32503271
MainResPressurePSI = MathHelper.Clamp(MainResPressurePSI, 0.001f, MaxMainResPressurePSI);
32513272
}
3273+
}
32523274

32533275
}
32543276

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

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ public float TenderCoalMassKG // Decreased by firing and increased
411411
float BoilerHeatTransferCoeffWpM2K = 45.0f; // Heat Transfer of locomotive boiler 45 Wm2K
412412
float TotalSteamUsageLBpS; // Running total for complete current steam usage
413413
float GeneratorSteamUsageLBpS = 1.0f; // Generator Steam Usage
414+
float SandingSteamUsageLBpS; // Sanding Steam Usage
414415
float RadiationSteamLossLBpS = 2.5f; // Steam loss due to radiation losses
415416
float BlowerBurnEffect; // Effect of Blower on burning rate
416417
float FlueTempDiffK; // Current difference in flue temp at current firing and steam usage rates.
@@ -685,6 +686,13 @@ public float TenderCoalMassKG // Decreased by firing and increased
685686
public float Cylinders41SteamVolumeM3pS;
686687
public float Cylinders42SteamVolumeM3pS;
687688

689+
public float SanderSteamExhaustForwardVolumeM3pS;
690+
public float SanderSteamExhaustReverseVolumeM3pS;
691+
public float SanderSteamExhaustVelocityMpS;
692+
public float SanderSteamExhaustParticleDurationS;
693+
694+
float SanderSteamConsumptionLbpS = 17; // Assume 1000lbs/hr steam consumption for the sander
695+
688696
public float Cylinders2_11SteamVolumeM3pS;
689697
public float Cylinders2_12SteamVolumeM3pS;
690698
public float Cylinders2_21SteamVolumeM3pS;
@@ -3073,6 +3081,11 @@ private void UpdateFX(float elapsedClockSeconds)
30733081

30743082
float SteamEffectsFactor = MathHelper.Clamp(BoilerPressurePSI / MaxBoilerPressurePSI, 0.1f, 1.0f); // Factor to allow for drops in boiler pressure reducing steam effects
30753083

3084+
SanderSteamExhaustForwardVolumeM3pS = Sander && SandingSystemType == SandingSystemTypes.Steam && (Direction == Direction.Forward || Direction == Direction.N) ? (10.0f * SteamEffectsFactor) : 0.0f;
3085+
SanderSteamExhaustReverseVolumeM3pS = Sander && SandingSystemType == SandingSystemTypes.Steam && Direction == Direction.Reverse ? (10.0f * SteamEffectsFactor) : 0.0f;
3086+
SanderSteamExhaustParticleDurationS = 1.0f;
3087+
SanderSteamExhaustVelocityMpS = 100.0f;
3088+
30763089
// Bernoulli formula for future reference - steam velocity = SQRT ( 2 * dynamic pressure (pascals) / fluid density)
30773090
Cylinders1SteamVelocityMpS = 100.0f;
30783091
Cylinders2SteamVelocityMpS = 100.0f;
@@ -6618,6 +6631,21 @@ private void UpdateAuxiliaries(float elapsedClockSeconds, float absSpeedMpS)
66186631
CylCockSteamUsageDisplayLBpS = 0.0f;
66196632
}
66206633

6634+
// Calculate sanding steam Usage if turned on
6635+
// Assume steam sanding usage is 1000lbs/hr
6636+
if (Sander && SandingSystemType == SandingSystemTypes.Steam)
6637+
{
6638+
SandingSteamUsageLBpS = SanderSteamConsumptionLbpS;
6639+
BoilerMassLB -= elapsedClockSeconds * SandingSteamUsageLBpS; // Reduce boiler mass to reflect steam usage by generator
6640+
BoilerHeatBTU -= elapsedClockSeconds * SandingSteamUsageLBpS * (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); // Reduce boiler Heat to reflect steam usage by generator
6641+
BoilerHeatOutBTUpS += SandingSteamUsageLBpS * (BoilerSteamHeatBTUpLB - BoilerWaterHeatBTUpLB); // Reduce boiler Heat to reflect steam usage by generator
6642+
TotalSteamUsageLBpS += SandingSteamUsageLBpS;
6643+
}
6644+
else
6645+
{
6646+
SandingSteamUsageLBpS = 0.0f; // No generator fitted to locomotive
6647+
}
6648+
66216649
// Calculate Generator steam Usage if turned on
66226650
// Assume generator kW = 350W for D50 Class locomotive
66236651
if (GeneratorSteamEffects) // If Generator steam effects not present then assume no generator is fitted to locomotive
@@ -6633,6 +6661,7 @@ private void UpdateAuxiliaries(float elapsedClockSeconds, float absSpeedMpS)
66336661
{
66346662
GeneratorSteamUsageLBpS = 0.0f; // No generator fitted to locomotive
66356663
}
6664+
66366665
if (StokerIsMechanical)
66376666
{
66386667
StokerSteamUsageLBpS = pS.FrompH(MaxBoilerOutputLBpH) * (StokerMinUsage + (StokerMaxUsage - StokerMinUsage) * FuelFeedRateKGpS / MaxFiringRateKGpS); // Caluculate current steam usage based on fuel feed rates

Source/Orts.Simulation/Simulation/RollingStocks/TrainCar.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -659,6 +659,15 @@ public enum SteamEngineTypes
659659

660660
public SteamEngineTypes SteamEngineType;
661661

662+
public enum SandingSystemTypes
663+
{
664+
Unknown,
665+
Air,
666+
Steam,
667+
}
668+
669+
public SandingSystemTypes SandingSystemType;
670+
662671
public enum WagonTypes
663672
{
664673
Unknown,

Source/RunActivity/Viewer3D/RollingStock/MSTSSteamLocomotiveViewer.cs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ public class MSTSSteamLocomotiveViewer : MSTSLocomotiveViewer
5555
List<ParticleEmitterViewer> CylinderSteamExhaust4 = new List<ParticleEmitterViewer>();
5656
List<ParticleEmitterViewer> CylinderSteamExhaust2_1 = new List<ParticleEmitterViewer>();
5757
List<ParticleEmitterViewer> CylinderSteamExhaust2_2 = new List<ParticleEmitterViewer>();
58+
List<ParticleEmitterViewer> SanderSteamExhaustForward = new List<ParticleEmitterViewer>();
59+
List<ParticleEmitterViewer> SanderSteamExhaustReverse = new List<ParticleEmitterViewer>();
5860
List<ParticleEmitterViewer> BoosterCylinderSteamExhaust01 = new List<ParticleEmitterViewer>();
5961
List<ParticleEmitterViewer> BoosterCylinderSteamExhaust02 = new List<ParticleEmitterViewer>();
6062
List<ParticleEmitterViewer> BoosterCylinders11 = new List<ParticleEmitterViewer>();
@@ -127,6 +129,10 @@ public MSTSSteamLocomotiveViewer(Viewer viewer, MSTSSteamLocomotive car)
127129
CylinderSteamExhaust2_1.AddRange(emitter.Value);
128130
else if (emitter.Key.ToLowerInvariant() == "cylindersteamexhaust2_2fx")
129131
CylinderSteamExhaust2_2.AddRange(emitter.Value);
132+
else if (emitter.Key.ToLowerInvariant() == "sandersteamexhaustforwardfx")
133+
SanderSteamExhaustForward.AddRange(emitter.Value);
134+
else if (emitter.Key.ToLowerInvariant() == "sandersteamexhaustreversefx")
135+
SanderSteamExhaustReverse.AddRange(emitter.Value);
130136
else if (emitter.Key.ToLowerInvariant() == "boostercylinders11fx")
131137
BoosterCylinders11.AddRange(emitter.Value);
132138
else if (emitter.Key.ToLowerInvariant() == "boostercylinders12fx")
@@ -345,10 +351,15 @@ public override void PrepareFrame(RenderFrame frame, ElapsedTime elapsedTime)
345351
foreach (var drawer in CylinderSteamExhaust3)
346352
drawer.SetOutput(car.CylinderSteamExhaustSteamVelocityMpS, car.CylinderSteamExhaust3SteamVolumeM3pS, car.CylinderSteamExhaustParticleDurationS);
347353

354+
foreach (var drawer in SanderSteamExhaustForward)
355+
drawer.SetOutput(car.SanderSteamExhaustVelocityMpS, car.SanderSteamExhaustForwardVolumeM3pS, car.SanderSteamExhaustParticleDurationS);
356+
357+
foreach (var drawer in SanderSteamExhaustReverse)
358+
drawer.SetOutput(car.SanderSteamExhaustVelocityMpS, car.SanderSteamExhaustReverseVolumeM3pS, car.SanderSteamExhaustParticleDurationS);
359+
348360
foreach (var drawer in BoosterCylinderSteamExhaust01)
349361
drawer.SetOutput(car.BoosterCylinderSteamExhaust01SteamVelocityMpS, car.BoosterCylinderSteamExhaust01SteamVolumeM3pS, car.BoosterCylinderCockParticleDurationS);
350362

351-
352363
foreach (var drawer in BoosterCylinderSteamExhaust02)
353364
drawer.SetOutput(car.BoosterCylinderSteamExhaust02SteamVelocityMpS, car.BoosterCylinderSteamExhaust02SteamVolumeM3pS, car.BoosterCylinderCockParticleDurationS);
354365

0 commit comments

Comments
 (0)