@@ -47,9 +47,9 @@ public class RailDriverState : ExternalDeviceState
47
47
public ExternalDeviceCabControl DynamicBrake = new ExternalDeviceCabControl ( ) ; // 0 to 100 if active otherwise less than 0
48
48
public ExternalDeviceCabControl TrainBrake = new ExternalDeviceCabControl ( ) ; // 0 (release) to 100 (CS), does not include emergency
49
49
public ExternalDeviceCabControl EngineBrake = new ExternalDeviceCabControl ( ) ; // 0 to 100
50
+ public ExternalDeviceCabControl Wipers = new ExternalDeviceCabControl ( ) ; // wiper rotary, 1 off, 2 slow, 3 full
50
51
public ExternalDeviceCabControl Lights = new ExternalDeviceCabControl ( ) ; // lights rotary, 1 off, 2 dim, 3 full
51
52
ExternalDeviceButton BailOff ;
52
- ExternalDeviceButton Wiper ;
53
53
public RailDriverState ( Game game )
54
54
{
55
55
try
@@ -140,15 +140,14 @@ public RailDriverState(Game game)
140
140
}
141
141
142
142
BailOff = new ExternalDeviceButton ( ) ;
143
- Wiper = new ExternalDeviceButton ( ) ;
144
143
RegisterCommand ( UserCommand . ControlBailOff , BailOff ) ;
145
- RegisterCommand ( UserCommand . ControlWiper , Wiper ) ;
146
144
147
145
CabControls [ ( new CabViewControlType ( CABViewControlTypes . DIRECTION ) , - 1 ) ] = Direction ;
148
146
CabControls [ ( new CabViewControlType ( CABViewControlTypes . THROTTLE ) , - 1 ) ] = Throttle ;
149
147
CabControls [ ( new CabViewControlType ( CABViewControlTypes . TRAIN_BRAKE ) , - 1 ) ] = TrainBrake ;
150
148
CabControls [ ( new CabViewControlType ( CABViewControlTypes . ENGINE_BRAKE ) , - 1 ) ] = EngineBrake ;
151
149
CabControls [ ( new CabViewControlType ( CABViewControlTypes . DYNAMIC_BRAKE ) , - 1 ) ] = DynamicBrake ;
150
+ CabControls [ ( new CabViewControlType ( CABViewControlTypes . WIPERS ) , - 1 ) ] = Wipers ;
152
151
CabControls [ ( new CabViewControlType ( CABViewControlTypes . FRONT_HLIGHT ) , - 1 ) ] = Lights ;
153
152
}
154
153
public void Update ( )
@@ -171,7 +170,7 @@ public void Update()
171
170
float calOff = ( 1 - a ) * bailoffDisengaged . Item1 + a * bailoffDisengaged . Item2 ;
172
171
float calOn = ( 1 - a ) * bailoffEngaged . Item1 + a * bailoffEngaged . Item2 ;
173
172
BailOff . IsDown = Percentage ( readBuffer [ 5 ] , calOff , calOn ) > 50 ;
174
- Wiper . IsDown = ( int ) ( .01 * Percentage ( readBuffer [ 6 ] , wipers ) + 2.5 ) != 1 ;
173
+ Wipers . Value = ( int ) ( .01 * Percentage ( readBuffer [ 6 ] , wipers ) + 2.5 ) == 1 ? 0 : 1 ;
175
174
Lights . Value = ( int ) ( .01 * Percentage ( readBuffer [ 7 ] , headlight ) + 2.5 ) ;
176
175
177
176
foreach ( var buttonList in Commands . Values )
0 commit comments