File tree Expand file tree Collapse file tree 3 files changed +105
-85
lines changed
Simulation/RollingStocks/SubSystems Expand file tree Collapse file tree 3 files changed +105
-85
lines changed Original file line number Diff line number Diff line change @@ -356,11 +356,15 @@ internal void AttachToHost(ScriptedTrainControlSystem host)
356356 /// Set dynamic brake controller to position in range [0-1].
357357 /// </summary>
358358 public Action < float > SetDynamicBrakeController ;
359+ /// <summary>
360+ /// Sets the target speed of the automatic traction/braking system
361+ /// Gets the current speed enforced by the automatic traction/braking system
362+ /// </summary>
359363 public float ? SetSpeedMpS
360364 {
361365 get
362366 {
363- if ( Locomotive ? . CruiseControl . SpeedRegMode == CruiseControl . SpeedRegulatorMode . Auto ) return Locomotive . CruiseControl . SetSpeedMpS ;
367+ if ( Locomotive . CruiseControl ? . SpeedRegMode == CruiseControl . SpeedRegulatorMode . Auto ) return Locomotive . CruiseControl . SetSpeedMpS ;
364368 return null ;
365369 }
366370 set
@@ -369,6 +373,20 @@ public float? SetSpeedMpS
369373 }
370374 }
371375 /// <summary>
376+ /// Controls the target acceleration of the automatic traction/braking system when a braking curve is active
377+ /// </summary>
378+ public float SetSpeedAccelerationMpSS
379+ {
380+ get
381+ {
382+ return Locomotive ? . CruiseControl . ATOAccelerationMpSS ?? 0 ;
383+ }
384+ set
385+ {
386+ if ( Locomotive . CruiseControl != null ) Locomotive . CruiseControl . ATOAccelerationMpSS = value ;
387+ }
388+ }
389+ /// <summary>
372390 /// Cut power by pull all pantographs down.
373391 /// </summary>
374392 public Action SetPantographsDown ;
Original file line number Diff line number Diff line change @@ -1773,7 +1773,7 @@ public override void Update(float elapsedClockSeconds)
17731773 }
17741774 else
17751775 {
1776- var dynforce = loco . DynamicBrakeForceCurves . Get ( 1.0f , loco . AbsSpeedMpS ) ;
1776+ var dynforce = loco . GetAvailableDynamicBrakeForceN ( 1.0f ) ;
17771777 if ( ( loco . MaxDynamicBrakeForceN == 0 && dynforce > 0 ) || dynforce > loco . MaxDynamicBrakeForceN * 0.6 )
17781778 {
17791779 demandedPressurePSI = 0 ;
You can’t perform that action at this time.
0 commit comments