Skip to content

Commit ddbe08f

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents f9bd122 + f92b5fa commit ddbe08f

File tree

2 files changed

+33
-4
lines changed

2 files changed

+33
-4
lines changed

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

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1420,8 +1420,38 @@ public override void Initialize()
14201420
}
14211421
}
14221422

1423-
if (MaximumMainReservoirPipePressurePSI == 0)
1423+
// MaximumMainReservoirPipePressurePSI is only used in twin pipe system, and should have a value
1424+
if ((BrakeSystem is AirTwinPipe))
14241425
{
1426+
1427+
// for airtwinpipe system, make sure that a value is set for it
1428+
if (MaximumMainReservoirPipePressurePSI == 0)
1429+
{
1430+
MaximumMainReservoirPipePressurePSI = MaxMainResPressurePSI;
1431+
if (Simulator.Settings.VerboseConfigurationMessages)
1432+
{
1433+
Trace.TraceInformation("AirBrakeMaxMainResPipePressure not set in ENG file, set to default pressure of {0}.", FormatStrings.FormatPressure(MaximumMainReservoirPipePressurePSI, PressureUnit.PSI, MainPressureUnit, true));
1434+
}
1435+
1436+
}
1437+
}
1438+
else if ((BrakeSystem is AirSinglePipe) && MaximumMainReservoirPipePressurePSI != 0)
1439+
{
1440+
1441+
// if value not equal to MaxMainResPressurePSI then reset (could already be at this value due to "copying" of locomotive)
1442+
if (MaximumMainReservoirPipePressurePSI != MaxMainResPressurePSI)
1443+
{
1444+
// for a airsinglepipe system, AirBrakeMaxMainResPipePressure should be left out of ENG file, and it should be set the same as MaxMainResPressurePSI
1445+
MaximumMainReservoirPipePressurePSI = MaxMainResPressurePSI;
1446+
if (Simulator.Settings.VerboseConfigurationMessages)
1447+
{
1448+
Trace.TraceInformation("AirBrakeMaxMainResPipePressure is set in ENG file, but should not be normally used for AirSinglePipe system, reset to default pressure of {0}. Consider removing AirBrakeMaxMainResPipePressure parameter from ENG file", FormatStrings.FormatPressure(MaximumMainReservoirPipePressurePSI, PressureUnit.PSI, MainPressureUnit, true));
1449+
}
1450+
}
1451+
}
1452+
else
1453+
{
1454+
// normal default setting. This should be the normal case for airsinglepipe systems
14251455
MaximumMainReservoirPipePressurePSI = MaxMainResPressurePSI;
14261456
}
14271457

@@ -1440,7 +1470,7 @@ public override void Initialize()
14401470
{
14411471
Trace.TraceInformation("TrainBrakeController.MaxPressurePSI is assumed to be {0} Inhg, - confirmed as a value of {1} InHg", TempMaxPressure, Bar.ToInHg(Bar.FromPSI(TrainBrakeController.MaxPressurePSI)));
14421472
}
1443-
1473+
14441474
}
14451475
else if (TrainBrakeController.MaxPressurePSI < 7 || TrainBrakeController.MaxPressurePSI > 13) // Outside an acceptable range (Eqiv = 15InHg to 25InHg), then convert to a fixed default
14461476
{

Source/Orts.Simulation/Simulation/Signalling/Signals.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@
3232
using Orts.Parsers.Msts;
3333
using Orts.Simulation.AIs;
3434
using Orts.Simulation.Physics;
35-
using Orts.Simulation.Timetables;
3635
using ORTS.Common;
3736
using System;
3837
using System.Collections.Generic;
@@ -1245,7 +1244,7 @@ private void AddWorldInfo()
12451244
{
12461245
if (signal != null)
12471246
{
1248-
if (signal.isSignal)
1247+
if (signal.isSignal || signal.isSpeedSignal)
12491248
{
12501249
foreach (SignalHead head in signal.SignalHeads)
12511250
{

0 commit comments

Comments
 (0)