Elvas Tower: Planning area of the ETCS DMI - Elvas Tower

Jump to content

Posting Rules

All new threads will be started by members of the Open Rails team, Staff, and/or Admins. Existing threads started in other forums may get moved here when it makes sense to do so.

Once a thread is started any member may post replies to it.
  • 15 Pages +
  • 1
  • 2
  • 3
  • 4
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

Planning area of the ETCS DMI Rate Topic: ***** 2 Votes

#11 User is offline   cesarbl 

  • Conductor
  • Group: Status: Active Member
  • Posts: 395
  • Joined: 30-March 20
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 20 November 2020 - 01:16 AM

I have created a branch on GitHub with a first working version of the planning window. It's aligned with OR NewYear MG. https://github.com/c...s/tree/etcs_dmi
It is rendered using the same cabview control that was used for the CircularSpeedGauge, just for testing.
A quick way to test it is using the default MSTS script, which I have modified to show the new DMI features.

Regarding the API, I have created a dedicated ETCSStatus class accessible from the TCS, but this can be changed if there's a more convenient way to do it.
public class ETCSStatus
{
    // General status
    public bool DMIActive = true;
    ...
 
    // Speed and distance monitoring 
    ...

    // Planning information
    public bool PlanningAreaShown = true;
    public List<PlanningTarget> SpeedTargets = new List<PlanningTarget>();
    public PlanningTarget? IndicationMarkerTarget;
    public float? IndicationMarkerDistanceM;
    public List<GradientProfileElement> GradientProfile = new List<GradientProfileElement>();

    public ETCSStatus Clone()
    {
        // Clone all elements and lists so they can be accessed safely by RenderProcess
    }
}
public struct PlanningTarget
{
    public float DistanceToTrainM;
    public readonly float TargetSpeedMpS;
    public PlanningTarget(float distanceToTrainM, float targetSpeedMpS)
    {
         DistanceToTrainM = distanceToTrainM;
         TargetSpeedMpS = targetSpeedMpS;
    }
}
public struct GradientProfileElement
{
    public float DistanceToTrainM;
    public int GradientPerMille;
}


I have found some issues due to floating point to integer round errors when downscaling the components, so bad-looking areas will appear with low resolution screens or small DMI area in cab.

#12 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,000
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 20 November 2020 - 08:39 AM

Hi César,
thank you very much! I'll try now to apply to the ETR400 what you have kindly created, by inserting your code first as a branch into OR NewYear MG, and then merging it (if you agree of course).
I'll report about the results.

#13 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,000
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 21 November 2020 - 02:09 AM

Hi César,
you've done a fast and great job! I've appreciated also very much the possibility of disabling the display of the planning area, which I need when the train is running on a part of route equipped with the national TCS.
Here a picture
Attached Image: Planning.jpg

I only notice that the external maxspeed ring of the tacho touches the distance numbers of the planning area; there is also a strange small black area on the right of the tacho between the tacho itself and the maxspeed ring, but they are really minor things. Maybe I have to respect some rule in defining the ratio between width and height of the control?

I wonder what your intentions are now: will you add other info to such area, or will you leave it so?

What do you suggest to find out next elevation profile segments? I'm thinking at another list to be conditionally (only with Planning area shown) generated within the UpdatePlayerTrainData() method.

Thank you again!

#14 User is offline   cesarbl 

  • Conductor
  • Group: Status: Active Member
  • Posts: 395
  • Joined: 30-March 20
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 21 November 2020 - 03:15 AM

I have to add the track conditions (non stopping area, close air intake, neutral section, etc.) to the left side of the planning window, as well as the zooming functions. I've seen you have implemented the distance to target bar, but I can add it to the code so it's easier to add ETCS to more cabviews, if you like so. I will try to add the text message area too.

There seems to be a problem with the shader, because the gauge is doing something weird after 200km/h. I'll look at it. Did this happen in previous versions?

I used a wrong font size for distance scale numbers, they are bigger than they should. Thanks for pointing it.

#15 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,000
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 21 November 2020 - 03:21 AM

Here with a bit more data shown
Attached Image: Planning1.jpg

#16 User is offline   cesarbl 

  • Conductor
  • Group: Status: Active Member
  • Posts: 395
  • Joined: 30-March 20
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 21 November 2020 - 03:34 AM

For the gradient, I was using the difference of altitude between two signals. That might result in too long gradient sections in some cases, but is a reasonable approach. I'm not sure if I was collecting the signal shape altitude or the track link's, but we have to be sure that we are using the link position. I would add a AltitudeM parameter to the TrainObjectItem and collect it when searching signals ahead.

#17 User is offline   cesarbl 

  • Conductor
  • Group: Status: Active Member
  • Posts: 395
  • Joined: 30-March 20
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 21 November 2020 - 10:37 AM

I have just uploaded a new version with the addition of the Track Condition information in the planning area. I changed some of the colors in the speedometer to be fully compliant with the specifications. Also, if the ETCS operating mode is not FS, the circular gauge won't be shown. I have to add the small speed limit hooks used in the rest of the modes.

Hopefully I have fixed (or at least reduced) the glitches found by Carlo, which are caused by float to int rounding errors.

#18 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,000
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 22 November 2020 - 10:48 AM

I've added the last version of César's branch, and this is the result:
Attached Image: ETCS_2.jpg
Now tachograph and planning are separated, at the price of less visibility of the distances, but it's probably difficult to find an ideal tradeoff. The tachograph and its external ring seem to have a more regular aspect.

In the meantime I have committed into the remote repository of OR NewYear MG the addition of a fifth field within the SignalFeatures struct. Such field is called AltitudeM and contains the altitude of the signal (it works only for NORMAL signals). The same feature is available in the latest Unstable release.
This way the rough data to build a more complete route profile should be available.

I have also a request to César: as of now if the train is above the allowed speed, the tachograph pointer becomes orange and then red. This is of course OK for ETCSL2, Full Supervision. However, as I already wrote, the same tachograph is used here in HST also when running the national TCS system, and in this case the pointer should remain grey. I solved this now by calling SetCurrentSpeedLimitMpS() with the max train speed, and this solves the issue for the pointer, but does no more allow to display, if needed, the max allowed speed with a standard cabview Control. So I'm asking whether there is a way to solve this. I have seen in the code that by setting lower modes the pointer remains greyed, however it is not possible at the moment to change mode from the TCS script.

#19 User is offline   cesarbl 

  • Conductor
  • Group: Status: Active Member
  • Posts: 395
  • Joined: 30-March 20
  • Gender:Male
  • Simulator:Open Rails
  • Country:

Posted 22 November 2020 - 11:33 AM

 Csantucci, on 22 November 2020 - 10:48 AM, said:

Now tachograph and planning are separated, at the price of less visibility of the distances, but it's probably difficult to find an ideal tradeoff. The tachograph and its external ring seem to have a more regular aspect.

The font size now is the one defined in the specification, which looks well in higher resolutions. It's a pity that the numbers are not very visible, but I don't know if this can be solved. With this resolution, each digit is only 4x3 pixels wide.

 Csantucci, on 22 November 2020 - 10:48 AM, said:

In the meantime I have committed into the remote repository of OR NewYear MG the addition of a fifth field within the SignalFeatures struct. Such field is called AltitudeOrLengthM and contains the altitude of the signal (it works only for NORMAL signals). The same feature is available in the latest Unstable release.
This way the rough data to build a more complete route profile should be available.

Nice!

 Csantucci, on 22 November 2020 - 10:48 AM, said:

I have also a request to César: as of now if the train is above the allowed speed, the tachograph pointer becomes orange and then red. This is of course OK for ETCSL2, Full Supervision. However, as I already wrote, the same tachograph is used here in HST also when running the national TCS system, and in this case the pointer should remain grey. I solved this now by calling SetCurrentSpeedLimitMpS() with the max train speed, and this solves the issue for the pointer, but does no more allow to display, if needed, the max allowed speed with a standard cabview Control. So I'm asking whether there is a way to solve this. I have seen in the code that by setting lower modes the pointer remains greyed, however it is not possible at the moment to change mode from the TCS script.

You can set the ETCS mode with ETCSStatus.CurrentMode in the TCS script. The national system STM is probably the most difficult thing to integrate in the DMI, but as a temporary hack you can set the mode to SB, which sets the needle to grey and disables the circular speed gauge. You can override the speed limits shown in the DMI using ETCSStatus.AllowedSpeedMpS, ETCSStatus.TargetSpeedMpS, etc. if you wish.

#20 User is offline   Csantucci 

  • Member, Board of Directors
  • Group: Status: Elite Member
  • Posts: 7,000
  • Joined: 31-December 11
  • Gender:Male
  • Country:

Posted 22 November 2020 - 12:50 PM

Thanks César,
re the dimension of the fonts for the numbers, I personally tolerate small increases of the fonts with respect to the official spec, if this positively influences visibility. In other parts of the interface I have proceeded this way.


 cesarbl, on 22 November 2020 - 11:33 AM, said:

You can set the ETCS mode with ETCSStatus.CurrentMode in the TCS script. The national system STM is probably the most difficult thing to integrate in the DMI, but as a temporary hack you can set the mode to SB, which sets the needle to grey and disables the circular speed gauge. You can override the speed limits shown in the DMI using ETCSStatus.AllowedSpeedMpS, ETCSStatus.TargetSpeedMpS, etc. if you wish.

That works well, thank you again!

  • 15 Pages +
  • 1
  • 2
  • 3
  • 4
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users