@@ -168,7 +168,7 @@ public override void UpdatePressure(ref float pressureBar, float elapsedClockSec
168168 pressureBar -= x * ApplyRateBarpS ( ) * elapsedClockSeconds ;
169169 break ;
170170 case ControllerState . FullServ :
171- epState = x ;
171+ epState = 1 ;
172172 EnforceMinimalReduction = true ;
173173 DecreasePressure ( ref pressureBar , MaxPressureBar ( ) - FullServReductionBar ( ) , ApplyRateBarpS ( ) , elapsedClockSeconds ) ;
174174 break ;
@@ -193,21 +193,21 @@ public override void UpdatePressure(ref float pressureBar, float elapsedClockSec
193193 pressureBar = ( 1 - x ) * MaxPressureBar ( ) ;
194194 epState = - 1 ;
195195 break ;
196- case ControllerState . EPApply :
197196 case ControllerState . EPOnly :
198197 case ControllerState . SMEOnly :
199- case ControllerState . ContServ :
200198 case ControllerState . EPFullServ :
201199 case ControllerState . SMEFullServ :
202200 epState = x ;
203- if ( notch . Type == ControllerState . EPApply || notch . Type == ControllerState . ContServ )
204- {
205- EnforceMinimalReduction = true ;
206- x = MaxPressureBar ( ) - MinReductionBar ( ) * ( 1 - x ) - FullServReductionBar ( ) * x ;
207- DecreasePressure ( ref pressureBar , x , ApplyRateBarpS ( ) , elapsedClockSeconds ) ;
208- if ( ForceControllerReleaseGraduated || notch . Type == ControllerState . EPApply )
209- IncreasePressure ( ref pressureBar , Math . Min ( x , MainReservoirPressureBar ( ) ) , ReleaseRateBarpS ( ) , elapsedClockSeconds ) ;
210- }
201+ break ;
202+ case ControllerState . EPApply :
203+ case ControllerState . ContServ :
204+ EnforceMinimalReduction = true ;
205+ if ( FullServReductionBar ( ) > 0 ) x = MinReductionBar ( ) / FullServReductionBar ( ) * ( 1 - x ) + x ;
206+ epState = x ;
207+ x = MaxPressureBar ( ) - x * FullServReductionBar ( ) ;
208+ DecreasePressure ( ref pressureBar , x , ApplyRateBarpS ( ) , elapsedClockSeconds ) ;
209+ if ( ForceControllerReleaseGraduated || notch . Type == ControllerState . EPApply )
210+ IncreasePressure ( ref pressureBar , Math . Min ( x , MainReservoirPressureBar ( ) ) , ReleaseRateBarpS ( ) , elapsedClockSeconds ) ;
211211 break ;
212212 case ControllerState . GSelfLapH :
213213 case ControllerState . Suppression :
@@ -237,8 +237,9 @@ public override void UpdatePressure(ref float pressureBar, float elapsedClockSec
237237 float ccdemand = CruiseControlBrakeDemand ( ) ;
238238 if ( ccdemand > 0 )
239239 {
240- pressureBar = Math . Min ( MaxPressureBar ( ) - MinReductionBar ( ) * ( 1 - ccdemand ) - FullServReductionBar ( ) * ccdemand , pressureBar ) ;
241- epState = ccdemand ;
240+ if ( FullServReductionBar ( ) > 0 ) ccdemand = Math . Max ( ccdemand , MinReductionBar ( ) / FullServReductionBar ( ) ) ;
241+ pressureBar = Math . Min ( MaxPressureBar ( ) - FullServReductionBar ( ) * ccdemand , pressureBar ) ;
242+ epState = Math . Max ( ccdemand , epState ) ;
242243 }
243244
244245 if ( pressureBar < 0 )
0 commit comments