@@ -51,6 +51,7 @@ public class AirSinglePipe : MSTSBrakeSystem
51
51
protected float MaxAuxilaryChargingRatePSIpS = 1.684f ;
52
52
protected float BrakeInsensitivityPSIpS = 0 ;
53
53
protected float EmergencyValveActuationRatePSIpS = 0 ;
54
+ protected float EmergencyDumpValveRatePSIpS = 0 ;
54
55
protected float EmergResChargingRatePSIpS = 1.684f ;
55
56
protected float EmergAuxVolumeRatio = 1.4f ;
56
57
protected string DebugType = string . Empty ;
@@ -116,6 +117,7 @@ public override void InitializeFromCopy(BrakeSystem copy)
116
117
MaxAuxilaryChargingRatePSIpS = thiscopy . MaxAuxilaryChargingRatePSIpS ;
117
118
BrakeInsensitivityPSIpS = thiscopy . BrakeInsensitivityPSIpS ;
118
119
EmergencyValveActuationRatePSIpS = thiscopy . EmergencyValveActuationRatePSIpS ;
120
+ EmergencyDumpValveRatePSIpS = thiscopy . EmergencyDumpValveRatePSIpS ;
119
121
EmergResChargingRatePSIpS = thiscopy . EmergResChargingRatePSIpS ;
120
122
EmergAuxVolumeRatio = thiscopy . EmergAuxVolumeRatio ;
121
123
TwoPipes = thiscopy . TwoPipes ;
@@ -232,6 +234,7 @@ public override void Parse(string lowercasetoken, STFReader stf)
232
234
case "wagon(brakepipevolume" : BrakePipeVolumeM3 = Me3 . FromFt3 ( stf . ReadFloatBlock ( STFReader . UNITS . VolumeDefaultFT3 , null ) ) ; break ;
233
235
case "wagon(ortsbrakeinsensitivity" : BrakeInsensitivityPSIpS = stf . ReadFloatBlock ( STFReader . UNITS . PressureRateDefaultPSIpS , null ) ; break ;
234
236
case "wagon(ortsemergencyvalveactuationrate" : EmergencyValveActuationRatePSIpS = stf . ReadFloatBlock ( STFReader . UNITS . PressureRateDefaultPSIpS , 15f ) ; break ;
237
+ case "wagon(ortsemergencydumpvalverate" : EmergencyDumpValveRatePSIpS = stf . ReadFloatBlock ( STFReader . UNITS . PressureRateDefaultPSIpS , 15f ) ; break ;
235
238
case "wagon(ortsmainrespipeauxrescharging" : MRPAuxResCharging = this is AirTwinPipe && stf . ReadBoolBlock ( true ) ; break ;
236
239
}
237
240
}
@@ -307,7 +310,10 @@ public override void Initialize(bool handbrakeOn, float maxPressurePSI, float fu
307
310
AutoCylPressurePSI = immediateRelease ? 0 : Math . Min ( ( maxPressurePSI - BrakeLine1PressurePSI ) * AuxCylVolumeRatio , MaxCylPressurePSI ) ;
308
311
AuxResPressurePSI = Math . Max ( TwoPipes ? maxPressurePSI : maxPressurePSI - AutoCylPressurePSI / AuxCylVolumeRatio , BrakeLine1PressurePSI ) ;
309
312
if ( ( Car as MSTSWagon ) . EmergencyReservoirPresent )
313
+ {
310
314
EmergResPressurePSI = Math . Max ( AuxResPressurePSI , maxPressurePSI ) ;
315
+ if ( EmergencyValveActuationRatePSIpS == 0 ) EmergencyValveActuationRatePSIpS = 15 ;
316
+ }
311
317
TripleValveState = AutoCylPressurePSI < 1 ? ValveState . Release : ValveState . Lap ;
312
318
HoldingValve = ValveState . Release ;
313
319
HandbrakePercent = handbrakeOn & ( Car as MSTSWagon ) . HandBrakePresent ? 100 : 0 ;
@@ -440,6 +446,12 @@ public override void Update(float elapsedClockSeconds)
440
446
EmergResPressurePSI -= dp ;
441
447
AuxResPressurePSI += dp * EmergAuxVolumeRatio ;
442
448
}
449
+ if ( EmergencyDumpValveRatePSIpS > 0 )
450
+ {
451
+ BrakeLine1PressurePSI -= elapsedClockSeconds * EmergencyDumpValveRatePSIpS ;
452
+ if ( BrakeLine1PressurePSI < 0 )
453
+ BrakeLine1PressurePSI = 0 ;
454
+ }
443
455
}
444
456
}
445
457
0 commit comments