@@ -131,6 +131,7 @@ public enum SoundState
131131 public float MaxSpeedMpS = 1e3f ;
132132 public float UnloadingSpeedMpS ;
133133 public float MainResPressurePSI = 130 ;
134+ public float BrakePipeFlowM3pS ;
134135 public float MaximumMainReservoirPipePressurePSI ;
135136 public bool CompressorIsOn ;
136137 public bool CompressorIsMechanical = false ;
@@ -146,6 +147,9 @@ public enum SoundState
146147 public bool OnLineCabRadio ;
147148 public string OnLineCabRadioURL ;
148149
150+ public float FilteredBrakePipeFlowM3pS ;
151+ public IIRFilter AFMFilter ;
152+
149153 // Water trough filling
150154 public bool HasWaterScoop = false ; // indicates whether loco + tender have a water scoop or not
151155 public float ScoopMaxPickupSpeedMpS = 200.0f ; // Maximum scoop pickup speed - used in steam locomotive viewer
@@ -417,7 +421,7 @@ public float OdometerM
417421 protected const float DefaultMainResVolume = 0.78f ; // Value to be inserted if .eng parameters are corrected
418422 protected const float DefaultMaxMainResPressure = 140 ; // Max value to be inserted if .eng parameters are corrected
419423
420- public List < CabView > CabViewList = new List < CabView > ( ) ;
424+ public List < CabView > CabViewList = new List < CabView > ( ) ;
421425 public CabView3D CabView3D ;
422426
423427 public MSTSNotchController SteamHeatController = new MSTSNotchController ( 0 , 1 , 0.1f ) ;
@@ -482,6 +486,7 @@ public MSTSLocomotive(Simulator simulator, string wagPath)
482486 LocomotiveAxles . Add ( new Axle ( ) ) ;
483487 CurrentFilter = new IIRFilter ( IIRFilter . FilterTypes . Butterworth , 1 , IIRFilter . HzToRad ( 0.5f ) , 0.001f ) ;
484488 AdhesionFilter = new IIRFilter ( IIRFilter . FilterTypes . Butterworth , 1 , IIRFilter . HzToRad ( 1f ) , 0.001f ) ;
489+ AFMFilter = new IIRFilter ( IIRFilter . FilterTypes . Butterworth , 1 , IIRFilter . HzToRad ( 0.1f ) , 1.0f ) ;
485490
486491 TrainBrakeController = new ScriptedBrakeController ( this ) ;
487492 EngineBrakeController = new ScriptedBrakeController ( this ) ;
@@ -5418,6 +5423,32 @@ public virtual float GetDataOf(CabViewControl cvc)
54185423 data = ( TrainBrakeController == null || ! TrainBrakeController . OverchargeButtonPressed ) ? 0 : 1 ;
54195424 break ;
54205425 }
5426+ case CABViewControlTypes . ORTS_AIR_FLOW_METER :
5427+ {
5428+ switch ( cvc . Units )
5429+ {
5430+ case CABViewControlUnits . CUBIC_FT_MIN :
5431+ data = this . FilteredBrakePipeFlowM3pS * 35.3147f * 60.0f ;
5432+ break ;
5433+
5434+ case CABViewControlUnits . LITRES_S :
5435+ case CABViewControlUnits . LITERS_S :
5436+ data = this . FilteredBrakePipeFlowM3pS * 1000.0f ;
5437+ break ;
5438+
5439+ case CABViewControlUnits . LITRES_MIN :
5440+ case CABViewControlUnits . LITERS_MIN :
5441+ data = this . FilteredBrakePipeFlowM3pS * 1000.0f * 60.0f ;
5442+ break ;
5443+
5444+ case CABViewControlUnits . CUBIC_M_S :
5445+ default :
5446+ data = this . FilteredBrakePipeFlowM3pS ;
5447+ break ;
5448+
5449+ }
5450+ break ;
5451+ }
54215452 case CABViewControlTypes . FRICTION_BRAKING :
54225453 {
54235454 data = ( BrakeSystem == null ) ? 0.0f : BrakeSystem . GetCylPressurePSI ( ) ;
@@ -5541,7 +5572,6 @@ public virtual float GetDataOf(CabViewControl cvc)
55415572
55425573 }
55435574 }
5544-
55455575 }
55465576 else
55475577 {
0 commit comments