@@ -351,6 +351,7 @@ public float OdometerM
351
351
public float TrainBrakePipeLeakPSIorInHgpS = 0.0f ; // Air leakage from train brake pipe - should normally be no more then 5psi/min - default off
352
352
public float CompressorRestartPressurePSI = 110 ;
353
353
public float CompressorChargingRateM3pS = 0.075f ;
354
+ public bool CompressorIsMUControlled = false ;
354
355
public float MainResChargingRatePSIpS = 0.4f ;
355
356
public float EngineBrakeReleaseRatePSIpS = 12.5f ;
356
357
public float EngineBrakeApplyRatePSIpS = 12.5f ;
@@ -983,6 +984,7 @@ public override void Parse(string lowercasetoken, STFReader stf)
983
984
CompressorIsMechanical = true ;
984
985
}
985
986
break ;
987
+ case "engine(ortscompressorismucontrolled" : CompressorIsMUControlled = stf . ReadBoolBlock ( false ) ; break ;
986
988
case "engine(trainpipeleakrate" : TrainBrakePipeLeakPSIorInHgpS = stf . ReadFloatBlock ( STFReader . UNITS . PressureRateDefaultPSIpS , null ) ; break ;
987
989
case "engine(vacuumbrakesvacuumpumpresistance" : VacuumPumpResistanceN = stf . ReadFloatBlock ( STFReader . UNITS . Force , null ) ; break ;
988
990
@@ -1171,6 +1173,7 @@ public override void Copy(MSTSWagon copy)
1171
1173
1172
1174
CompressorIsMechanical = locoCopy . CompressorIsMechanical ;
1173
1175
CompressorRestartPressurePSI = locoCopy . CompressorRestartPressurePSI ;
1176
+ CompressorIsMUControlled = locoCopy . CompressorIsMUControlled ;
1174
1177
TrainBrakePipeLeakPSIorInHgpS = locoCopy . TrainBrakePipeLeakPSIorInHgpS ;
1175
1178
MaxMainResPressurePSI = locoCopy . MaxMainResPressurePSI ;
1176
1179
MainResPressurePSI = locoCopy . MaxMainResPressurePSI ;
@@ -2661,9 +2664,20 @@ protected virtual void UpdateCompressor(float elapsedClockSeconds)
2661
2664
2662
2665
// Turn compressor on and off
2663
2666
if ( MainResPressurePSI < CompressorRestartPressurePSI && LocomotivePowerSupply . AuxiliaryPowerSupplyState == PowerSupplyState . PowerOn && ! CompressorIsOn )
2667
+ {
2664
2668
SignalEvent ( Event . CompressorOn ) ;
2669
+ foreach ( var loco in Train . Cars . OfType < MSTSLocomotive > ( ) )
2670
+ {
2671
+ if ( loco . RemoteControlGroup == 0 && loco . LocomotivePowerSupply . AuxiliaryPowerSupplyOn && ! loco . CompressorIsOn && loco . CompressorIsMUControlled )
2672
+ {
2673
+ loco . SignalEvent ( Event . CompressorOn ) ;
2674
+ }
2675
+ }
2676
+ }
2665
2677
else if ( ( MainResPressurePSI >= MaxMainResPressurePSI || LocomotivePowerSupply . AuxiliaryPowerSupplyState != PowerSupplyState . PowerOn ) && CompressorIsOn )
2678
+ {
2666
2679
SignalEvent ( Event . CompressorOff ) ;
2680
+ }
2667
2681
2668
2682
if ( CompressorIsOn )
2669
2683
MainResPressurePSI += elapsedClockSeconds * reservoirChargingRate ;
0 commit comments