File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
Simulation/RollingStocks/SubSystems Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -273,6 +273,10 @@ public abstract class TrainControlSystem : AbstractTrainScriptClass
273273 /// </summary>
274274 public Func < float > LineSpeedMpS ;
275275 /// <summary>
276+ /// Running total of distance travelled - negative or positive depending on train direction
277+ /// </summary>
278+ public Func < float > SignedDistanceM ;
279+ /// <summary>
276280 /// True if starting from terminal station (no track behind the train).
277281 /// </summary>
278282 public Func < bool > DoesStartFromTerminalStation ;
Original file line number Diff line number Diff line change @@ -373,6 +373,7 @@ public void Initialize()
373373 Script . AltitudeM = ( ) => Locomotive . WorldPosition . Location . Y ;
374374 Script . CurrentGradientPercent = ( ) => - Locomotive . CurrentElevationPercent ;
375375 Script . LineSpeedMpS = ( ) => ( float ) Simulator . TRK . Tr_RouteFile . SpeedLimit ;
376+ Script . SignedDistanceM = ( ) => Locomotive . Train . DistanceTravelledM ;
376377 Script . DoesStartFromTerminalStation = ( ) => DoesStartFromTerminalStation ( ) ;
377378 Script . IsColdStart = ( ) => Locomotive . Train . ColdStart ;
378379 Script . GetTrackNodeOffset = ( ) => Locomotive . Train . FrontTDBTraveller . TrackNodeLength - Locomotive . Train . FrontTDBTraveller . TrackNodeOffset ;
You can’t perform that action at this time.
0 commit comments