Skip to content

Commit 5e79e85

Browse files
committed
Automatic merge of T1.5.1-870-ge0bf062eb and 16 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 #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 1dea28c: Adjustments to Duplex steam - Pull request #915 at 6d911d7: Correct calculation error with curve friction - Pull request #916 at 11ac52c: Distributed Power Air Brake Synchronization
18 parents 4e56edb + e0bf062 + 3539862 + d00beb9 + f92de76 + 9c456aa + 8f94333 + 6c0785b + 1f5ba4c + 5866028 + 42f1dd9 + 0d6d045 + 9b0b04f + 6834af0 + 659396e + 1dea28c + 6d911d7 + 11ac52c commit 5e79e85

File tree

2 files changed

+343
-38
lines changed

2 files changed

+343
-38
lines changed

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)