@@ -47,9 +47,9 @@ public class RailDriverState : ExternalDeviceState
4747 public ExternalDeviceCabControl DynamicBrake = new ExternalDeviceCabControl ( ) ; // 0 to 100 if active otherwise less than 0
4848 public ExternalDeviceCabControl TrainBrake = new ExternalDeviceCabControl ( ) ; // 0 (release) to 100 (CS), does not include emergency
4949 public ExternalDeviceCabControl EngineBrake = new ExternalDeviceCabControl ( ) ; // 0 to 100
50+ public ExternalDeviceCabControl Wipers = new ExternalDeviceCabControl ( ) ; // wiper rotary, 1 off, 2 slow, 3 full
5051 public ExternalDeviceCabControl Lights = new ExternalDeviceCabControl ( ) ; // lights rotary, 1 off, 2 dim, 3 full
5152 ExternalDeviceButton BailOff ;
52- ExternalDeviceButton Wiper ;
5353 public RailDriverState ( Game game )
5454 {
5555 try
@@ -140,15 +140,14 @@ public RailDriverState(Game game)
140140 }
141141
142142 BailOff = new ExternalDeviceButton ( ) ;
143- Wiper = new ExternalDeviceButton ( ) ;
144143 RegisterCommand ( UserCommand . ControlBailOff , BailOff ) ;
145- RegisterCommand ( UserCommand . ControlWiper , Wiper ) ;
146144
147145 CabControls [ ( new CabViewControlType ( CABViewControlTypes . DIRECTION ) , - 1 ) ] = Direction ;
148146 CabControls [ ( new CabViewControlType ( CABViewControlTypes . THROTTLE ) , - 1 ) ] = Throttle ;
149147 CabControls [ ( new CabViewControlType ( CABViewControlTypes . TRAIN_BRAKE ) , - 1 ) ] = TrainBrake ;
150148 CabControls [ ( new CabViewControlType ( CABViewControlTypes . ENGINE_BRAKE ) , - 1 ) ] = EngineBrake ;
151149 CabControls [ ( new CabViewControlType ( CABViewControlTypes . DYNAMIC_BRAKE ) , - 1 ) ] = DynamicBrake ;
150+ CabControls [ ( new CabViewControlType ( CABViewControlTypes . WIPERS ) , - 1 ) ] = Wipers ;
152151 CabControls [ ( new CabViewControlType ( CABViewControlTypes . FRONT_HLIGHT ) , - 1 ) ] = Lights ;
153152 }
154153 public void Update ( )
@@ -171,7 +170,7 @@ public void Update()
171170 float calOff = ( 1 - a ) * bailoffDisengaged . Item1 + a * bailoffDisengaged . Item2 ;
172171 float calOn = ( 1 - a ) * bailoffEngaged . Item1 + a * bailoffEngaged . Item2 ;
173172 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 ;
175174 Lights . Value = ( int ) ( .01 * Percentage ( readBuffer [ 7 ] , headlight ) + 2.5 ) ;
176175
177176 foreach ( var buttonList in Commands . Values )
0 commit comments