Skip to content

Commit d2b8a52

Browse files
removed the toggle cuntion form the electric choices also
1 parent 82ab6ce commit d2b8a52

File tree

3 files changed

+82
-13
lines changed

3 files changed

+82
-13
lines changed

Source/Documentation/Manual/driving.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -537,13 +537,16 @@ By clicking in this menu it is possible:
537537
for both electric and diesel locomotives;
538538
- to connect or disconnect locomotive operation with that of the player
539539
locomotive;
540-
- to connect or disconnect the car's air hoses from the rest of the consist;
541-
- to toggle the angle cocks on the air hoses at either end of the car
542-
between open and closed;
543-
- to toggle the bleed valve on the car to vent the air pressure from the
540+
- to connect of disconnect the battery;
541+
- to connect or disconnect the Electric Train Supply;
542+
- to connect or disconnect the car's brake hoses from the rest of the consist;
543+
- to open or close the angle cocks on the air hoses at either end of the car;
544+
- to open or close the bleed valve on the car to vent the air pressure from the
544545
car's reservoir and release the air brakes to move the car without brakes
545546
(e.g. humping, etc.).
546547

548+
Grayed out choices are not applicable for the chosen car.
549+
547550
By toggling the angle cocks on individual cars it is possible to close
548551
selected angle cocks of the air hoses so that when the cars are uncoupled,
549552
the air pressure in the remaining consist (and optionally in the uncoupled
-42.3 KB
Loading

Source/RunActivity/Viewer3D/Popups/CarOperationsWindow.cs

Lines changed: 75 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ protected override ControlLayout Layout(ControlLayout layout)
5050

5151
TrainCar trainCar = Viewer.PlayerTrain.Cars[CarPosition];
5252
BrakeSystem brakeSystem = (trainCar as MSTSWagon).BrakeSystem;
53+
MSTSLocomotive locomotive = trainCar as MSTSLocomotive;
54+
MSTSWagon wagon = trainCar as MSTSWagon;
5355

5456
BrakeSystem rearBrakeSystem = null;
5557
if (CarPosition + 1 < Viewer.PlayerTrain.Cars.Count)
@@ -58,11 +60,14 @@ protected override ControlLayout Layout(ControlLayout layout)
5860
rearBrakeSystem = (rearTrainCar as MSTSWagon).BrakeSystem;
5961
}
6062

63+
bool isElectricDieselLocomotive = (Viewer.PlayerTrain.Cars[CarPosition] is MSTSElectricLocomotive) || (Viewer.PlayerTrain.Cars[CarPosition] is MSTSDieselLocomotive);
64+
6165
var vbox = base.Layout(layout).AddLayoutVertical();
62-
vbox.Add(ID = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, Viewer.Catalog.GetString("Car ID") + " " + (CarPosition >= Viewer.PlayerTrain.Cars.Count? " " :Viewer.PlayerTrain.Cars[CarPosition].CarID), LabelAlignment.Center));
66+
vbox.Add(ID = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, Viewer.Catalog.GetString("Car ID") + " " + (CarPosition >= Viewer.PlayerTrain.Cars.Count ? " " : Viewer.PlayerTrain.Cars[CarPosition].CarID), LabelAlignment.Center));
6367
ID.Color = Color.Red;
6468
vbox.AddHorizontalSeparator();
6569

70+
// Handbrake
6671
string buttonHandbrakeText = "";
6772
if ((trainCar as MSTSWagon).GetTrainHandbrakeStatus())
6873
buttonHandbrakeText = Viewer.Catalog.GetString("Unset Handbrake");
@@ -71,15 +76,38 @@ protected override ControlLayout Layout(ControlLayout layout)
7176
vbox.Add(buttonHandbrake = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, buttonHandbrakeText, LabelAlignment.Center));
7277
vbox.AddHorizontalSeparator();
7378

74-
vbox.Add(buttonTogglePower = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, Viewer.Catalog.GetString("Toggle Power"), LabelAlignment.Center));
79+
// Power Supply
80+
if (locomotive != null)
81+
if (locomotive.LocomotivePowerSupply.MainPowerSupplyOn)
82+
vbox.Add(buttonTogglePower = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, Viewer.Catalog.GetString("Power Off"), LabelAlignment.Center));
83+
else
84+
vbox.Add(buttonTogglePower = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, Viewer.Catalog.GetString("Power On"), LabelAlignment.Center));
85+
else
86+
vbox.Add(buttonTogglePower = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, Viewer.Catalog.GetString("Power On"), LabelAlignment.Center));
7587
vbox.AddHorizontalSeparator();
76-
vbox.Add(buttonToggleMU = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, Viewer.Catalog.GetString("Toggle MU Connection"), LabelAlignment.Center));
88+
89+
// MU Connection
90+
if ((locomotive != null) && (locomotive.RemoteControlGroup >= 0))
91+
vbox.Add(buttonToggleMU = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, Viewer.Catalog.GetString("Disconnect MU Connection"), LabelAlignment.Center));
92+
else
93+
vbox.Add(buttonToggleMU = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, Viewer.Catalog.GetString("Connect MU Connection"), LabelAlignment.Center));
7794
vbox.AddHorizontalSeparator();
78-
vbox.Add(buttonToggleBatterySwitch = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, Viewer.Catalog.GetString("Toggle Battery Switch"), LabelAlignment.Center));
95+
96+
// Battery Switch
97+
if ((wagon != null) && (wagon.PowerSupply is IPowerSupply) && (wagon.PowerSupply.BatterySwitch.On))
98+
vbox.Add(buttonToggleBatterySwitch = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, Viewer.Catalog.GetString("Battery Switch Off"), LabelAlignment.Center));
99+
else
100+
vbox.Add(buttonToggleBatterySwitch = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, Viewer.Catalog.GetString("Battery Switch On"), LabelAlignment.Center));
79101
vbox.AddHorizontalSeparator();
80-
vbox.Add(buttonToggleElectricTrainSupplyCable = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, Viewer.Catalog.GetString("Toggle Electric Train Supply Connection"), LabelAlignment.Center));
102+
103+
// Electric Train Supply Connection
104+
if ((wagon.PowerSupply != null) && wagon.PowerSupply.FrontElectricTrainSupplyCableConnected)
105+
vbox.Add(buttonToggleElectricTrainSupplyCable = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, Viewer.Catalog.GetString("Disonnect Electric Train Supply"), LabelAlignment.Center));
106+
else
107+
vbox.Add(buttonToggleElectricTrainSupplyCable = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, Viewer.Catalog.GetString("Connect Electric Train Supply"), LabelAlignment.Center));
81108
vbox.AddHorizontalSeparator();
82109

110+
// Front Brake Hose
83111
string buttonToggleFronBrakeHoseText = "";
84112
if (brakeSystem.FrontBrakeHoseConnected)
85113
buttonToggleFronBrakeHoseText = Viewer.Catalog.GetString("Disconnect Front Brake Hose");
@@ -88,6 +116,7 @@ protected override ControlLayout Layout(ControlLayout layout)
88116
vbox.Add(buttonToggleFrontBrakeHose = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, buttonToggleFronBrakeHoseText, LabelAlignment.Center));
89117
vbox.AddHorizontalSeparator();
90118

119+
// Rear Brake Hose
91120
string buttonToggleRearBrakeHoseText = "";
92121
if (((CarPosition + 1) < Viewer.PlayerTrain.Cars.Count) && (rearBrakeSystem.FrontBrakeHoseConnected))
93122
buttonToggleRearBrakeHoseText = Viewer.Catalog.GetString("Disconnect Rear Brake Hose");
@@ -96,6 +125,7 @@ protected override ControlLayout Layout(ControlLayout layout)
96125
vbox.Add(buttonToggleRearBrakeHose = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, buttonToggleRearBrakeHoseText, LabelAlignment.Center));
97126
vbox.AddHorizontalSeparator();
98127

128+
// Front Angle Cock
99129
string buttonToggleAngleCockAText = "";
100130
if (brakeSystem.AngleCockAOpen)
101131
buttonToggleAngleCockAText = Viewer.Catalog.GetString("Close Front Angle Cock");
@@ -104,6 +134,7 @@ protected override ControlLayout Layout(ControlLayout layout)
104134
vbox.Add(buttonToggleAngleCockA = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, buttonToggleAngleCockAText, LabelAlignment.Center));
105135
vbox.AddHorizontalSeparator();
106136

137+
// Rear Angle Cock
107138
string buttonToggleAngleCockBText = "";
108139
if (brakeSystem.AngleCockBOpen)
109140
buttonToggleAngleCockBText = Viewer.Catalog.GetString("Close Rear Angle Cock");
@@ -112,6 +143,7 @@ protected override ControlLayout Layout(ControlLayout layout)
112143
vbox.Add(buttonToggleAngleCockB = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, buttonToggleAngleCockBText, LabelAlignment.Center));
113144
vbox.AddHorizontalSeparator();
114145

146+
// Bleed Off Valve
115147
string buttonToggleBleedOffValveAText = "";
116148
if (brakeSystem.BleedOffValveOpen)
117149
buttonToggleBleedOffValveAText = Viewer.Catalog.GetString("Close Bleed Off Valve");
@@ -120,29 +152,63 @@ protected override ControlLayout Layout(ControlLayout layout)
120152
vbox.Add(buttonToggleBleedOffValve = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, buttonToggleBleedOffValveAText, LabelAlignment.Center));
121153
vbox.AddHorizontalSeparator();
122154

155+
// Close button
123156
vbox.Add(buttonClose = new Label(vbox.RemainingWidth, Owner.TextFontDefault.Height, Viewer.Catalog.GetString("Close window"), LabelAlignment.Center));
124157

158+
// add click controls
159+
160+
// Handbrake
125161
if ((trainCar as MSTSWagon).HandBrakePresent)
126162
buttonHandbrake.Click += new Action<Control, Point>(buttonHandbrake_Click);
127163
else
128164
buttonHandbrake.Color = Color.Gray;
129-
buttonTogglePower.Click += new Action<Control, Point>(buttonTogglePower_Click);
130-
buttonToggleMU.Click += new Action<Control, Point>(buttonToggleMU_Click);
131-
buttonToggleBatterySwitch.Click += new Action<Control, Point>(buttonToggleBatterySwitch_Click);
132-
buttonToggleElectricTrainSupplyCable.Click += new Action<Control, Point>(buttonToggleElectricTrainSupplyCable_Click);
133165

166+
// Power Supply
167+
if (isElectricDieselLocomotive)
168+
buttonTogglePower.Click += new Action<Control, Point>(buttonTogglePower_Click);
169+
else
170+
buttonTogglePower.Color = Color.Gray;
171+
172+
// MU Connection
173+
if (isElectricDieselLocomotive)
174+
buttonToggleMU.Click += new Action<Control, Point>(buttonToggleMU_Click);
175+
else
176+
buttonToggleMU.Color = Color.Gray;
177+
178+
// Battery Switch
179+
if ((wagon != null) && (wagon.PowerSupply is IPowerSupply))
180+
buttonToggleBatterySwitch.Click += new Action<Control, Point>(buttonToggleBatterySwitch_Click);
181+
else
182+
buttonToggleBatterySwitch.Color = Color.Gray;
183+
184+
// Electric Train Supply Connection
185+
if ((wagon != null) && (wagon.PowerSupply != null))
186+
buttonToggleElectricTrainSupplyCable.Click += new Action<Control, Point>(buttonToggleElectricTrainSupplyCable_Click);
187+
else
188+
buttonToggleElectricTrainSupplyCable.Color = Color.Gray;
189+
190+
// Front Brake Hose
134191
if (CarPosition > 0)
135192
buttonToggleFrontBrakeHose.Click += new Action<Control, Point>(buttonToggleFrontBrakeHose_Click);
136193
else
137194
buttonToggleFrontBrakeHose.Color = Color.Gray;
195+
196+
// Rear Brake Hose
138197
if (CarPosition < (Viewer.PlayerTrain.Cars.Count - 1))
139198
buttonToggleRearBrakeHose.Click += new Action<Control, Point>(buttonToggleRearBrakeHose_Click);
140199
else
141200
buttonToggleRearBrakeHose.Color = Color.Gray;
142201

202+
// Front Angle Cock
143203
buttonToggleAngleCockA.Click += new Action<Control, Point>(buttonToggleAngleCockA_Click);
204+
205+
// Rear Angle Cock
144206
buttonToggleAngleCockB.Click += new Action<Control, Point>(buttonToggleAngleCockB_Click);
207+
208+
// Bleed Off Valve
145209
buttonToggleBleedOffValve.Click += new Action<Control, Point>(buttonToggleBleedOffValve_Click);
210+
211+
// Close button
146212
buttonClose.Click += new Action<Control, Point>(buttonClose_Click);
147213

148214
return vbox;

0 commit comments

Comments
 (0)