Comment 3 for bug 1787609

Revision history for this message
Rippstein (ch-signale) wrote :

Rob Roeterdink has set my by PN this informations:
it looks to me that the problem is in method UpdateInputs() in module Orts.Simulation\Simulation\RollingStocks\SubSystems\TrainControlSystem.cs :

        public void UpdateInputs()
        {
            SetNextSignalAspect(NextSignalAspect(0));

            CurrentSpeedLimitMpS = CurrentSignalSpeedLimitMpS();
            if (CurrentSpeedLimitMpS < 0 || CurrentSpeedLimitMpS > TrainSpeedLimitMpS())
                CurrentSpeedLimitMpS = TrainSpeedLimitMpS();

            NextSpeedLimitMpS = NextSignalSpeedLimitMpS(0) >= 0 && NextSignalSpeedLimitMpS(0) < TrainSpeedLimitMpS() ? NextSignalSpeedLimitMpS(0) : TrainSpeedLimitMpS();

            SetCurrentSpeedLimitMpS(CurrentSpeedLimitMpS);
            SetNextSpeedLimitMpS(NextSpeedLimitMpS);
        }

The variable CurrectSpeedLimitMpS is set to the result of function CurrentSignalSpeedLimitMpS().
This is a script function defined in the same module, and is set to the value Locomotive.Train.allowedMaxSpeedSignalMpS.

There is another script function defined in this module : TrainSpeedLimitMpS, which is set to the value TrainInfo.allowedSpeedMpS, this is the speed value as displayed in the track monitor.

In my view, the variable CurrentSpeedLimitMpS should be set to the same value as shown in the track monitor, so that line in the code should be :

            CurrentSpeedLimitMpS = TrainSpeedLimitMpS();

But, I can't tell what all the consequences would be if the code would be changed in this way. I am not familiar with this part of the code. Perhaps it helps if a bug report with the above details is submitted and someone with knowledge of this part of the program could have a look at it.

Regards,
Rob Roeterdink