@@ -349,6 +349,7 @@ public float OdometerM
349
349
public float TrainBrakePipeLeakPSIorInHgpS = 0.0f ; // Air leakage from train brake pipe - should normally be no more then 5psi/min - default off
350
350
public float CompressorRestartPressurePSI = 110 ;
351
351
public float CompressorChargingRateM3pS = 0.075f ;
352
+ public bool CompressorIsMUControlled = false ;
352
353
public float MainResChargingRatePSIpS = 0.4f ;
353
354
public float EngineBrakeReleaseRatePSIpS = 12.5f ;
354
355
public float EngineBrakeApplyRatePSIpS = 12.5f ;
@@ -984,6 +985,7 @@ public override void Parse(string lowercasetoken, STFReader stf)
984
985
CompressorIsMechanical = true ;
985
986
}
986
987
break ;
988
+ case "engine(ortscompressorismucontrolled" : CompressorIsMUControlled = stf . ReadBoolBlock ( false ) ; break ;
987
989
case "engine(trainpipeleakrate" : TrainBrakePipeLeakPSIorInHgpS = stf . ReadFloatBlock ( STFReader . UNITS . PressureRateDefaultPSIpS , null ) ; break ;
988
990
case "engine(vacuumbrakesvacuumpumpresistance" : VacuumPumpResistanceN = stf . ReadFloatBlock ( STFReader . UNITS . Force , null ) ; break ;
989
991
@@ -1172,6 +1174,7 @@ public override void Copy(MSTSWagon copy)
1172
1174
1173
1175
CompressorIsMechanical = locoCopy . CompressorIsMechanical ;
1174
1176
CompressorRestartPressurePSI = locoCopy . CompressorRestartPressurePSI ;
1177
+ CompressorIsMUControlled = locoCopy . CompressorIsMUControlled ;
1175
1178
TrainBrakePipeLeakPSIorInHgpS = locoCopy . TrainBrakePipeLeakPSIorInHgpS ;
1176
1179
MaxMainResPressurePSI = locoCopy . MaxMainResPressurePSI ;
1177
1180
MainResPressurePSI = locoCopy . MaxMainResPressurePSI ;
@@ -2645,9 +2648,20 @@ protected virtual void UpdateCompressor(float elapsedClockSeconds)
2645
2648
2646
2649
// Turn compressor on and off
2647
2650
if ( MainResPressurePSI < CompressorRestartPressurePSI && LocomotivePowerSupply . AuxiliaryPowerSupplyState == PowerSupplyState . PowerOn && ! CompressorIsOn )
2651
+ {
2648
2652
SignalEvent ( Event . CompressorOn ) ;
2653
+ foreach ( var loco in Train . Cars . OfType < MSTSLocomotive > ( ) )
2654
+ {
2655
+ if ( loco . RemoteControlGroup == 0 && loco . LocomotivePowerSupply . AuxiliaryPowerSupplyOn && ! loco . CompressorIsOn && loco . CompressorIsMUControlled )
2656
+ {
2657
+ loco . SignalEvent ( Event . CompressorOn ) ;
2658
+ }
2659
+ }
2660
+ }
2649
2661
else if ( ( MainResPressurePSI >= MaxMainResPressurePSI || LocomotivePowerSupply . AuxiliaryPowerSupplyState != PowerSupplyState . PowerOn ) && CompressorIsOn )
2662
+ {
2650
2663
SignalEvent ( Event . CompressorOff ) ;
2664
+ }
2651
2665
2652
2666
if ( CompressorIsOn )
2653
2667
MainResPressurePSI += elapsedClockSeconds * reservoirChargingRate ;
0 commit comments