File tree Expand file tree Collapse file tree 3 files changed +17
-38
lines changed
Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/PowerSupplies Expand file tree Collapse file tree 3 files changed +17
-38
lines changed Original file line number Diff line number Diff line change @@ -38,10 +38,10 @@ public enum ModeType
38
38
// Variables
39
39
readonly MSTSWagon Wagon ;
40
40
protected Timer Timer ;
41
- public bool CommandSwitch { get ; protected set ; } = true ;
41
+ public bool CommandSwitch { get ; protected set ; } = false ;
42
42
public bool CommandButtonOn { get ; protected set ; } = false ;
43
43
public bool CommandButtonOff { get ; protected set ; } = false ;
44
- public bool On { get ; protected set ; } = true ;
44
+ public bool On { get ; protected set ; } = false ;
45
45
46
46
public BatterySwitch ( MSTSWagon wagon )
47
47
{
@@ -91,17 +91,6 @@ public void Copy(BatterySwitch other)
91
91
92
92
public virtual void Initialize ( )
93
93
{
94
- switch ( Mode )
95
- {
96
- case ModeType . Switch :
97
- CommandSwitch = false ;
98
- On = false ;
99
- break ;
100
-
101
- case ModeType . PushButtons :
102
- On = false ;
103
- break ;
104
- }
105
94
}
106
95
107
96
/// <summary>
Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ public enum ModeType
35
35
36
36
// Variables
37
37
readonly MSTSLocomotive Locomotive ;
38
- public bool CommandSwitch { get ; protected set ; } = true ;
39
- public bool On { get ; protected set ; } = true ;
38
+ public bool CommandSwitch { get ; protected set ; } = false ;
39
+ public bool On { get ; protected set ; } = false ;
40
40
41
41
public ElectricTrainSupplySwitch ( MSTSLocomotive locomotive )
42
42
{
@@ -77,18 +77,6 @@ public void Copy(ElectricTrainSupplySwitch other)
77
77
78
78
public virtual void Initialize ( )
79
79
{
80
- switch ( Mode )
81
- {
82
- case ModeType . Unfitted :
83
- CommandSwitch = false ;
84
- On = false ;
85
- break ;
86
-
87
- case ModeType . Switch :
88
- CommandSwitch = false ;
89
- On = false ;
90
- break ;
91
- }
92
80
}
93
81
94
82
/// <summary>
@@ -126,6 +114,10 @@ public virtual void Update(float elapsedClockSeconds)
126
114
{
127
115
switch ( Mode )
128
116
{
117
+ case ModeType . Unfitted :
118
+ On = false ;
119
+ break ;
120
+
129
121
case ModeType . Automatic :
130
122
if ( On )
131
123
{
@@ -150,8 +142,8 @@ public virtual void Update(float elapsedClockSeconds)
150
142
{
151
143
if ( ! CommandSwitch || ! Locomotive . LocomotivePowerSupply . AuxiliaryPowerSupplyOn )
152
144
{
153
- On = false ;
154
- Locomotive . SignalEvent ( Event . ElectricTrainSupplyOff ) ;
145
+ On = false ;
146
+ Locomotive . SignalEvent ( Event . ElectricTrainSupplyOff ) ;
155
147
}
156
148
}
157
149
else
Original file line number Diff line number Diff line change @@ -41,8 +41,8 @@ public enum ModeType
41
41
// Variables
42
42
readonly MSTSLocomotive Locomotive ;
43
43
protected Timer Timer ;
44
- public bool CommandSwitch { get ; protected set ; } = true ;
45
- public bool On { get ; protected set ; } = true ;
44
+ public bool CommandSwitch { get ; protected set ; } = false ;
45
+ public bool On { get ; protected set ; } = false ;
46
46
public bool OtherCabInUse {
47
47
get
48
48
{
@@ -105,20 +105,18 @@ public void Copy(MasterKey other)
105
105
106
106
public virtual void Initialize ( )
107
107
{
108
- if ( Mode == ModeType . Manual )
109
- {
110
- CommandSwitch = false ;
111
- On = false ;
112
- }
113
108
}
114
109
115
110
/// <summary>
116
111
/// Initialization when simulation starts with moving train
117
112
/// </summary>
118
113
public virtual void InitializeMoving ( )
119
114
{
120
- CommandSwitch = true ;
121
- On = true ;
115
+ if ( Locomotive . IsLeadLocomotive ( ) )
116
+ {
117
+ CommandSwitch = true ;
118
+ On = true ;
119
+ }
122
120
}
123
121
124
122
public virtual void Save ( BinaryWriter outf )
You can’t perform that action at this time.
0 commit comments