Skip to content

Commit 78fd957

Browse files
committed
Do not check DPU status for MU wire
1 parent c5f1627 commit 78fd957

File tree

3 files changed

+9
-45
lines changed

3 files changed

+9
-45
lines changed

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

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -5073,33 +5073,6 @@ public override string GetDPDynamicBrakeStatus()
50735073
return string.Format("{0:F0}% {1}", DynamicBrakePercent, dpStatus);
50745074
return string.Format("{0} {1}", DynamicBrakeController.GetStatus(), dpStatus);
50755075
}
5076-
5077-
public override string GetMultipleUnitsConfiguration()
5078-
{
5079-
if (Train == null)
5080-
return base.GetMultipleUnitsConfiguration();
5081-
var numberOfLocomotives = 0;
5082-
var group = 0;
5083-
var configuration = "";
5084-
5085-
var remoteControlGroup = 0;
5086-
for (var i = 0; i < Train.Cars.Count; i++)
5087-
{
5088-
if (Train.Cars[i] is MSTSLocomotive)
5089-
{
5090-
if (remoteControlGroup != (remoteControlGroup = Train.Cars[i].RemoteControlGroup) && i != 0)
5091-
{
5092-
configuration += string.Format("{0} | ", group);
5093-
group = 0;
5094-
}
5095-
group++;
5096-
numberOfLocomotives++;
5097-
}
5098-
}
5099-
if (group > 0)
5100-
configuration += string.Format("{0}", group);
5101-
return numberOfLocomotives > 0 ? configuration : null;
5102-
}
51035076
#endregion
51045077

51055078
public override void SignalEvent(TCSEvent evt)

Source/RunActivity/Viewer3D/Popups/TrainCarOperationsViewerWindow.cs

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -437,11 +437,8 @@ void AddSpace(bool full)
437437
}
438438
if (isElectricDieselLocomotive)
439439
{
440-
if (locomotive.GetMultipleUnitsConfiguration() != null)
441-
{
442-
line.Add(new buttonToggleMU(0, 0, textHeight, Owner.Viewer, CarPosition));
443-
AddSpace(false);
444-
}
440+
line.Add(new buttonToggleMU(0, 0, textHeight, Owner.Viewer, CarPosition));
441+
AddSpace(false);
445442

446443
line.Add(new buttonTogglePower(0, 0, textHeight, Owner.Viewer, CarPosition));
447444
AddSpace(false);
@@ -1081,18 +1078,16 @@ class buttonToggleMU : Image
10811078
readonly Viewer Viewer;
10821079
readonly TrainCarOperationsViewerWindow TrainCarViewer;
10831080
readonly TrainCar CurrentCar;
1084-
readonly string MultipleUnitsConfiguration;
10851081
public buttonToggleMU(int x, int y, int size, Viewer viewer, int carPosition)
10861082
: base(x, y, size, size)
10871083
{
10881084
Viewer = viewer;
10891085
TrainCarViewer = Viewer.TrainCarOperationsViewerWindow;
10901086
CurrentCar = Viewer.PlayerTrain.Cars[carPosition];
10911087

1092-
MultipleUnitsConfiguration = Viewer.PlayerLocomotive.GetMultipleUnitsConfiguration();
1093-
if (CurrentCar is MSTSLocomotive && MultipleUnitsConfiguration != null)
1088+
if (CurrentCar is MSTSLocomotive)
10941089
{
1095-
Texture = Viewer.TrainCarOperationsWindow.ModifiedSetting || ((CurrentCar as MSTSLocomotive).RemoteControlGroup == 0 && MultipleUnitsConfiguration != "1") ? MUconnected : MUdisconnected;
1090+
Texture = Viewer.TrainCarOperationsWindow.ModifiedSetting || ((CurrentCar as MSTSLocomotive).RemoteControlGroup == 0) ? MUconnected : MUdisconnected;
10961091
}
10971092
else
10981093
{
@@ -1108,7 +1103,7 @@ void buttonToggleMU_Click(Control arg1, Point arg2)
11081103
MSTSLocomotive locomotive = CurrentCar as MSTSLocomotive;
11091104

11101105
new ToggleMUCommand(Viewer.Log, locomotive, locomotive.RemoteControlGroup < 0);
1111-
if (locomotive.RemoteControlGroup == 0 && MultipleUnitsConfiguration != "1")
1106+
if (locomotive.RemoteControlGroup == 0)
11121107
{
11131108
Viewer.Simulator.Confirmer.Information(Viewer.Catalog.GetString("MU signal connected"));
11141109
Texture = MUconnected;

Source/RunActivity/Viewer3D/Popups/TrainCarOperationsWindow.cs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -485,11 +485,8 @@ void AddSpace()
485485
}
486486
if (isElectricDieselLocomotive)
487487
{
488-
if (locomotive.GetMultipleUnitsConfiguration() != null)
489-
{
490-
line.Add(new buttonToggleMU(0, 0, SymbolSize, Owner.Viewer, carPosition));
491-
AddSpace();
492-
}
488+
line.Add(new buttonToggleMU(0, 0, SymbolSize, Owner.Viewer, carPosition));
489+
AddSpace();
493490

494491
line.Add(new buttonTogglePower(0, 0, SymbolSize, Owner.Viewer, carPosition));
495492
AddSpace();
@@ -1262,10 +1259,9 @@ public buttonToggleMU(int x, int y, int size, Viewer viewer, int carPosition)
12621259
Viewer = viewer;
12631260
CarPosition = carPosition;
12641261

1265-
var multipleUnitsConfiguration = Viewer.PlayerLocomotive.GetMultipleUnitsConfiguration();
1266-
if ((Viewer.PlayerTrain.Cars[CarPosition] is MSTSLocomotive) && multipleUnitsConfiguration != null)
1262+
if (Viewer.PlayerTrain.Cars[CarPosition] is MSTSLocomotive)
12671263
{
1268-
Texture = (Viewer.PlayerTrain.Cars[CarPosition] as MSTSLocomotive).RemoteControlGroup == 0 && multipleUnitsConfiguration != "1" ? MUconnected : MUdisconnected;
1264+
Texture = (Viewer.PlayerTrain.Cars[CarPosition] as MSTSLocomotive).RemoteControlGroup == 0 ? MUconnected : MUdisconnected;
12691265
}
12701266
else
12711267
{

0 commit comments

Comments
 (0)