Skip to content

Commit 1dea28c

Browse files
committed
Adjustments to Train Operations window
1 parent 69a4ccc commit 1dea28c

File tree

4 files changed

+346
-41
lines changed

4 files changed

+346
-41
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2950,7 +2950,7 @@ public virtual void UpdateWaterTroughRefill(float elapsedClockSeconds, float abs
29502950
else if (ScoopIsBroken)
29512951
{
29522952
Simulator.Confirmer.Message(ConfirmLevel.Error, Simulator.Catalog.GetString("Scoop is broken, can't refill"));
2953-
RefillingFromTrough = false;
2953+
RefillingFromTrough = false;
29542954
}
29552955
else if (IsOverJunction())
29562956
{
@@ -2960,7 +2960,7 @@ public virtual void UpdateWaterTroughRefill(float elapsedClockSeconds, float abs
29602960
}
29612961
ScoopIsBroken = true;
29622962
RefillingFromTrough = false;
2963-
SignalEvent(Event.WaterScoopBroken);
2963+
SignalEvent(Event.WaterScoopBroken);
29642964
}
29652965
else if (!IsOverTrough())
29662966
{

Source/RunActivity/Viewer3D/Popups/HUDWindow.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ static string GetCarWhyteLikeNotation(TrainCar car)
629629
currentCount = 0;
630630
axlesCount = 0;
631631
i = i + 1;
632-
}
632+
}
633633
}
634634
}
635635
else if (axle.Part.bogie) // this is a bogie

Source/RunActivity/Viewer3D/Popups/TrainDrivingWindow.cs

Lines changed: 58 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ private static class Symbols
160160
[Viewer.Catalog.GetString("Time")] = Viewer.Catalog.GetString("TIME"),
161161
[Viewer.Catalog.GetString("Traction cut-off relay")] = Viewer.Catalog.GetString("TRAC"),
162162
[Viewer.Catalog.GetString("Train brake")] = Viewer.Catalog.GetString("BTRN"),
163+
[Viewer.Catalog.GetString("Water scoop")] = Viewer.Catalog.GetString("WSCO"),
163164
[Viewer.Catalog.GetString("Wheel")] = Viewer.Catalog.GetString("WHEL")
164165
};
165166

@@ -1153,6 +1154,40 @@ void AddSeparator() => AddLabel(new ListLabel
11531154
});
11541155
}
11551156
}
1157+
AddSeparator();
1158+
}
1159+
1160+
// Water scoop
1161+
if (locomotive.HasWaterScoop)
1162+
{
1163+
string waterScoopIndicator, waterScoopKey;
1164+
if (locomotive.ScoopIsBroken)
1165+
{
1166+
if (locomotive.IsWaterScoopDown)
1167+
{
1168+
locomotive.ToggleWaterScoop();// Set water scoop up
1169+
}
1170+
waterScoopIndicator = Viewer.Catalog.GetString("Broken") + ColorCode[Color.Orange];
1171+
waterScoopKey = "";
1172+
}
1173+
else if (locomotive.IsWaterScoopDown && !locomotive.ScoopIsBroken)
1174+
{
1175+
waterScoopIndicator = Viewer.Catalog.GetString("Down") + (locomotive.IsOverTrough() ? ColorCode[Color.Cyan] : ColorCode[Color.Orange]);
1176+
waterScoopKey = Symbols.ArrowToRight + ColorCode[Color.Yellow];
1177+
}
1178+
else
1179+
{
1180+
waterScoopIndicator = Viewer.Catalog.GetString("Up") + ColorCode[Color.White];
1181+
waterScoopKey = "";
1182+
}
1183+
1184+
AddLabel(new ListLabel
1185+
{
1186+
FirstCol = Viewer.Catalog.GetString("Water scoop"),
1187+
LastCol = waterScoopIndicator,
1188+
KeyPressed = waterScoopKey,
1189+
SymbolCol = ""
1190+
});
11561191
}
11571192

11581193
// Blowdown valve
@@ -1179,7 +1214,7 @@ void AddSeparator() => AddLabel(new ListLabel
11791214
AddSeparator();
11801215
}
11811216

1182-
// Booster air valve
1217+
// Booster engine
11831218
if (locomotive is MSTSSteamLocomotive)
11841219
{
11851220
MSTSSteamLocomotive steamLocomotive6 = (MSTSSteamLocomotive)locomotive;
@@ -1198,22 +1233,18 @@ void AddSeparator() => AddLabel(new ListLabel
11981233
string boosterIdleValveIndicator = "-", boosterIdleValveKey = "";
11991234
string boosterLatchOnIndicator = "-", boosterLatchOnKey = "";
12001235
var cutOffLess65 = train.MUReverserPercent < 65.0f;
1201-
bool moving = Math.Abs(trainCar.SpeedMpS) > 1;
1236+
bool movingTrain = Math.Abs(trainCar.SpeedMpS) > 0.0555556f;// 0.2 km/h
12021237
var currentTrainInfo = train.GetTrainInfo();
1203-
var trainStopping = currentTrainInfo.projectedSpeedMpS < 1;
1238+
var trainStopping = currentTrainInfo.projectedSpeedMpS < 0.0277778f;// 0.1 km/h
12041239

1205-
// Disengages booster if speed is more than 34 km/h or cutOff less than 65%
1206-
if (steamLocomotive6.SteamBoosterLatchOn && (steamLocomotive6.SpeedMpS > 9.4444 || (cutOffLess65 && moving) || locomotive.Direction == Direction.Reverse))
1207-
{
1208-
steamLocomotive6.ToggleSteamBoosterLatch();// Disengages booster
1209-
}
12101240
// Engages booster if train is moving forward less than 19 km/h and cutoff value more than 65%
1211-
else if (!steamLocomotive6.SteamBoosterLatchOn && !trainStopping && steamLocomotive6.SpeedMpS < 5.27778 && !cutOffLess65 && moving && locomotive.Direction == Direction.Forward)
1241+
if (!steamLocomotive6.SteamBoosterLatchOn && !trainStopping && steamLocomotive6.SpeedMpS < 5.27778 && !cutOffLess65 && movingTrain && locomotive.Direction == Direction.Forward)
12121242
{
12131243
steamLocomotive6.ToggleSteamBoosterLatch();// Engages booster
12141244
}
1215-
// Disengages booster if projectedSpeedMpS < 1
1216-
else if (steamLocomotive6.SteamBoosterLatchOn && trainStopping)
1245+
// Disengages booster if speed is more than 34 km/h or cutOff less than 65%
1246+
else if (steamLocomotive6.SteamBoosterLatchOn && (steamLocomotive6.SpeedMpS > 9.4444 || (cutOffLess65 && movingTrain) || locomotive.Direction == Direction.Reverse)
1247+
|| (steamLocomotive6.SteamBoosterLatchOn && trainStopping))// Disengages booster if projectedSpeedMpS < 0.1 km/h
12171248
{
12181249
steamLocomotive6.ToggleSteamBoosterLatch();// Disengages booster
12191250
}
@@ -1223,6 +1254,10 @@ void AddSeparator() => AddLabel(new ListLabel
12231254
{
12241255
EnabledIdleValve = true;
12251256
}
1257+
if (EnabledIdleValve && !steamLocomotive6.SteamBoosterAirOpen && !steamLocomotive6.SteamBoosterIdle && !steamLocomotive6.SteamBoosterLatchOn)
1258+
{
1259+
EnabledIdleValve = false;
1260+
}
12261261

12271262
// SteamBoosterAirValve Ctrl+D...close/open
12281263
if (!steamLocomotive6.SteamBoosterAirOpen)
@@ -1248,14 +1283,21 @@ void AddSeparator() => AddLabel(new ListLabel
12481283
// SteamBoosterIdleValve..Ctrl+B...idle/run
12491284
if (!steamLocomotive6.SteamBoosterIdle)
12501285
{
1251-
boosterIdleValveIndicator = Viewer.Catalog.GetString("Idle") + ColorCode[Color.White];
1286+
boosterIdleValveIndicator = Viewer.Catalog.GetString("Idle") + ColorCode[EnabledIdleValve ? Color.White : Color.Orange];
12521287
boosterIdleValveKey = "";
12531288
}
12541289
if (steamLocomotive6.SteamBoosterIdle && EnabledIdleValve)
12551290
{
12561291
boosterIdleValveIndicator = Viewer.Catalog.GetString("Run") + ColorCode[EnabledIdleValve ? Color.Cyan : Color.Orange];
12571292
boosterIdleValveKey = Symbols.ArrowToRight + ColorCode[Color.Yellow];
12581293
}
1294+
// When shut off the booster system and the air open valve is closed, we set the idle valve from the run position to idle.
1295+
if (steamLocomotive6.SteamBoosterIdle && !steamLocomotive6.SteamBoosterAirOpen )
1296+
{
1297+
steamLocomotive6.ToggleSteamBoosterIdle();// set to idle
1298+
boosterIdleValveIndicator = Viewer.Catalog.GetString("Idle") + ColorCode[Color.White];
1299+
boosterIdleValveKey = "";
1300+
}
12591301
AddLabel(new ListLabel
12601302
{
12611303
FirstCol = Viewer.Catalog.GetString("Booster idle valve") + ColorCode[EnabledIdleValve ? Color.White : Color.Orange],
@@ -1273,7 +1315,7 @@ void AddSeparator() => AddLabel(new ListLabel
12731315
}
12741316
if (!steamLocomotive6.SteamBoosterLatchOn)
12751317
{
1276-
boosterLatchOnIndicator = Viewer.Catalog.GetString("Opened") + ColorCode[Color.White];
1318+
boosterLatchOnIndicator = Viewer.Catalog.GetString("Opened") + ColorCode[EnabledIdleValve ? Color.White : Color.Orange];
12771319
boosterLatchOnKey = "";
12781320
BoosterLocked = false;
12791321
}
@@ -1429,21 +1471,21 @@ void AddSeparator() => AddLabel(new ListLabel
14291471
}
14301472

14311473
// Wheel
1432-
if (train.IsWheelSlip || train.IsWheelSlipWarninq || train.IsBrakeSkid)
1474+
if (train.HuDIsWheelSlip || train.HuDIsWheelSlipWarninq || train.IsBrakeSkid)
14331475
{
14341476
wheelLabelVisible = true;
14351477
clockWheelTime = Owner.Viewer.Simulator.ClockTime;
14361478
}
14371479

1438-
if (train.IsWheelSlip)
1480+
if (train.HuDIsWheelSlip)
14391481
{
14401482
AddLabel(new ListLabel
14411483
{
14421484
FirstCol = Viewer.Catalog.GetString("Wheel"),
14431485
LastCol = Viewer.Catalog.GetString("slip") + ColorCode[Color.OrangeRed],
14441486
});
14451487
}
1446-
else if (train.IsWheelSlipWarninq)
1488+
else if (train.HuDIsWheelSlipWarninq)
14471489
{
14481490
AddLabel(new ListLabel
14491491
{

0 commit comments

Comments
 (0)