Skip to content

Commit 06f8d32

Browse files
committed
Remove air compressor and main reservoir indication for control cars
1 parent 933a97d commit 06f8d32

File tree

3 files changed

+54
-24
lines changed

3 files changed

+54
-24
lines changed

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

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,23 +1749,23 @@ public override void Update(float elapsedClockSeconds)
17491749
}
17501750

17511751
// If the train is vacuumed braked then no need to update the compressor, but udate the ejector instead
1752-
if (BrakeSystem is VacuumSinglePipe)
1753-
{
1754-
1755-
if (VacuumBrakeEQFitted) // Only update exhauster/main reservoir on locomotives fitted ith an EQ reservoir
1756-
{
1752+
if (BrakeSystem is VacuumSinglePipe)
1753+
{
1754+
1755+
if (VacuumBrakeEQFitted) // Only update exhauster/main reservoir on locomotives fitted ith an EQ reservoir
1756+
{
17571757
UpdateVacuumExhauster(elapsedClockSeconds);
1758-
}
1759-
else
1760-
{
1761-
UpdateSteamEjector(elapsedClockSeconds);
1762-
}
1763-
1764-
}
1765-
else if (EngineType != EngineTypes.Control) // TODO - Control trailers would not have compressors, but if they do then need to be linked to power supply requirements
1766-
{
1767-
UpdateCompressor(elapsedClockSeconds);
1768-
}
1758+
}
1759+
else
1760+
{
1761+
UpdateSteamEjector(elapsedClockSeconds);
1762+
}
1763+
1764+
}
1765+
else if (EngineType != EngineTypes.Control) // TODO - Control trailers would not have compressors, but if they do then need to be linked to power supply requirements
1766+
{
1767+
UpdateCompressor(elapsedClockSeconds);
1768+
}
17691769

17701770
UpdateHornAndBell(elapsedClockSeconds);
17711771

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/AirSinglePipe.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -800,7 +800,7 @@ protected static void PropagateBrakeLinePressures(float elapsedClockSeconds, Tra
800800
dp = train.BrakeLine3PressurePSI - p;
801801
p += dp;
802802
lead.EngineBrakeState = ValveState.Apply;
803-
sumpv -= dp * brakeSystem.GetCylVolumeM3() / lead.MainResVolumeM3;
803+
sumpv -= dp * brakeSystem.GetCylVolumeM3() / lead.MainResVolumeM3; // TODO - On control cars there may not be a main reservoir, so this value is may not be correct
804804
}
805805
else if (p > train.BrakeLine3PressurePSI) // Release the engine brake as the pressure increases in the brake cylinder
806806
{

Source/RunActivity/Viewer3D/Popups/HUDWindow.cs

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -811,12 +811,27 @@ void TextPageBrakeInfo(TableData table)
811811
}
812812
else // Default to air or electronically braked, use this display
813813
{
814-
TableAddLines(table, String.Format("{0}\t\t{1}\t\t{2}\t{3}\t\t{4}",
815-
Viewer.Catalog.GetString("PlayerLoco"),
816-
Viewer.Catalog.GetString("Main reservoir"),
817-
FormatStrings.FormatPressure((Viewer.PlayerLocomotive as MSTSLocomotive).MainResPressurePSI, PressureUnit.PSI, (Viewer.PlayerLocomotive as MSTSLocomotive).BrakeSystemPressureUnits[BrakeSystemComponent.MainReservoir], true),
818-
Viewer.Catalog.GetString("Compressor"),
819-
(Viewer.PlayerLocomotive as MSTSLocomotive).CompressorIsOn ? Viewer.Catalog.GetString("on") : Viewer.Catalog.GetString("off")));
814+
if ((Viewer.PlayerLocomotive as MSTSLocomotive).EngineType == TrainCar.EngineTypes.Control)
815+
{
816+
// Control cars typically don't have reservoirs
817+
TableAddLines(table, String.Format("{0}\t\t{1}",
818+
Viewer.Catalog.GetString("PlayerLoco"),
819+
Viewer.Catalog.GetString("No compressor or reservoir fitted")
820+
));
821+
}
822+
else
823+
{
824+
825+
TableAddLines(table, String.Format("{0}\t\t{1}\t\t{2}\t{3}\t\t{4}",
826+
Viewer.Catalog.GetString("PlayerLoco"),
827+
Viewer.Catalog.GetString("Main reservoir"),
828+
FormatStrings.FormatPressure((Viewer.PlayerLocomotive as MSTSLocomotive).MainResPressurePSI, PressureUnit.PSI, (Viewer.PlayerLocomotive as MSTSLocomotive).BrakeSystemPressureUnits[BrakeSystemComponent.MainReservoir], true),
829+
Viewer.Catalog.GetString("Compressor"),
830+
(Viewer.PlayerLocomotive as MSTSLocomotive).CompressorIsOn ? Viewer.Catalog.GetString("on") : Viewer.Catalog.GetString("off")));
831+
}
832+
833+
834+
820835
}
821836

822837
// Display data for other locomotives
@@ -825,13 +840,28 @@ void TextPageBrakeInfo(TableData table)
825840
var car = train.Cars[i];
826841
if (car is MSTSLocomotive && car != Viewer.PlayerLocomotive)
827842
{
828-
TableAddLines(table, String.Format("{0}\t{1}\t{2}\t\t{3}\t{4}\t\t{5}",
843+
844+
if ((car as MSTSLocomotive).EngineType == TrainCar.EngineTypes.Control)
845+
{
846+
// Control cars typically don't have reservoirs
847+
TableAddLines(table, String.Format("{0}\t{1}",
848+
Viewer.Catalog.GetString("Loco"),
849+
car.CarID
850+
));
851+
}
852+
else
853+
{
854+
TableAddLines(table, String.Format("{0}\t{1}\t{2}\t\t{3}\t{4}\t\t{5}",
829855
Viewer.Catalog.GetString("Loco"),
830856
car.CarID,
857+
831858
Viewer.Catalog.GetString("Main reservoir"),
832859
FormatStrings.FormatPressure((car as MSTSLocomotive).MainResPressurePSI, PressureUnit.PSI, (car as MSTSLocomotive).BrakeSystemPressureUnits[BrakeSystemComponent.MainReservoir], true),
833860
Viewer.Catalog.GetString("Compressor"),
834861
(car as MSTSLocomotive).CompressorIsOn ? Viewer.Catalog.GetString("on") : Viewer.Catalog.GetString("off")));
862+
863+
864+
}
835865
}
836866
}
837867
TableAddLine(table);

0 commit comments

Comments
 (0)