@@ -51,6 +51,7 @@ public class AirSinglePipe : MSTSBrakeSystem
5151 protected float MaxAuxilaryChargingRatePSIpS = 1.684f ;
5252 protected float BrakeInsensitivityPSIpS = 0 ;
5353 protected float EmergencyValveActuationRatePSIpS = 0 ;
54+ protected float EmergencyDumpValveRatePSIpS = 0 ;
5455 protected float EmergResChargingRatePSIpS = 1.684f ;
5556 protected float EmergAuxVolumeRatio = 1.4f ;
5657 protected string DebugType = string . Empty ;
@@ -116,6 +117,7 @@ public override void InitializeFromCopy(BrakeSystem copy)
116117 MaxAuxilaryChargingRatePSIpS = thiscopy . MaxAuxilaryChargingRatePSIpS ;
117118 BrakeInsensitivityPSIpS = thiscopy . BrakeInsensitivityPSIpS ;
118119 EmergencyValveActuationRatePSIpS = thiscopy . EmergencyValveActuationRatePSIpS ;
120+ EmergencyDumpValveRatePSIpS = thiscopy . EmergencyDumpValveRatePSIpS ;
119121 EmergResChargingRatePSIpS = thiscopy . EmergResChargingRatePSIpS ;
120122 EmergAuxVolumeRatio = thiscopy . EmergAuxVolumeRatio ;
121123 TwoPipes = thiscopy . TwoPipes ;
@@ -232,6 +234,7 @@ public override void Parse(string lowercasetoken, STFReader stf)
232234 case "wagon(brakepipevolume" : BrakePipeVolumeM3 = Me3 . FromFt3 ( stf . ReadFloatBlock ( STFReader . UNITS . VolumeDefaultFT3 , null ) ) ; break ;
233235 case "wagon(ortsbrakeinsensitivity" : BrakeInsensitivityPSIpS = stf . ReadFloatBlock ( STFReader . UNITS . PressureRateDefaultPSIpS , null ) ; break ;
234236 case "wagon(ortsemergencyvalveactuationrate" : EmergencyValveActuationRatePSIpS = stf . ReadFloatBlock ( STFReader . UNITS . PressureRateDefaultPSIpS , 15f ) ; break ;
237+ case "wagon(ortsemergencydumpvalverate" : EmergencyDumpValveRatePSIpS = stf . ReadFloatBlock ( STFReader . UNITS . PressureRateDefaultPSIpS , 15f ) ; break ;
235238 case "wagon(ortsmainrespipeauxrescharging" : MRPAuxResCharging = this is AirTwinPipe && stf . ReadBoolBlock ( true ) ; break ;
236239 }
237240 }
@@ -307,7 +310,10 @@ public override void Initialize(bool handbrakeOn, float maxPressurePSI, float fu
307310 AutoCylPressurePSI = immediateRelease ? 0 : Math . Min ( ( maxPressurePSI - BrakeLine1PressurePSI ) * AuxCylVolumeRatio , MaxCylPressurePSI ) ;
308311 AuxResPressurePSI = Math . Max ( TwoPipes ? maxPressurePSI : maxPressurePSI - AutoCylPressurePSI / AuxCylVolumeRatio , BrakeLine1PressurePSI ) ;
309312 if ( ( Car as MSTSWagon ) . EmergencyReservoirPresent )
313+ {
310314 EmergResPressurePSI = Math . Max ( AuxResPressurePSI , maxPressurePSI ) ;
315+ if ( EmergencyValveActuationRatePSIpS == 0 ) EmergencyValveActuationRatePSIpS = 15 ;
316+ }
311317 TripleValveState = AutoCylPressurePSI < 1 ? ValveState . Release : ValveState . Lap ;
312318 HoldingValve = ValveState . Release ;
313319 HandbrakePercent = handbrakeOn & ( Car as MSTSWagon ) . HandBrakePresent ? 100 : 0 ;
@@ -440,6 +446,12 @@ public override void Update(float elapsedClockSeconds)
440446 EmergResPressurePSI -= dp ;
441447 AuxResPressurePSI += dp * EmergAuxVolumeRatio ;
442448 }
449+ if ( EmergencyDumpValveRatePSIpS > 0 )
450+ {
451+ BrakeLine1PressurePSI -= elapsedClockSeconds * EmergencyDumpValveRatePSIpS ;
452+ if ( BrakeLine1PressurePSI < 0 )
453+ BrakeLine1PressurePSI = 0 ;
454+ }
443455 }
444456 }
445457
0 commit comments