17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-04 22:25:45 +01:00

feat(editor): the SRK tool checks the lights of the signals against the routes of their trains: the speed of each route through the switches by the radius of their curves and the speed set on them, 40, 60 or 100 km/h, a lower orange light for these with an orange strip for 60 and a green one for 100 as Ie-1 gives them, an upper orange one where the next signal can show stop, the white one of the substitute signal; a signal telling of the next one nearer than the braking distance slows the trains with it at stop, Ie-4 § 8 ust. 5, a W21 for 140. The templates read for the speeds their events show; the signals set get the template of the kind with these lights and the least beyond them, the standing ones fitted so in one step of undo, the template swapped with the name, the plate and the read event kept, a variant leaning the other way only with the same speeds. The braking distance shown with the speed of the main tracks it follows, set by hand in the record of the station and used for the block sections too; the warning discs and the block sections nearer than it marked, the signals that don't fit marked in the schematic and the scenery

This commit is contained in:
maj00r
2026-10-22 16:07:04 +02:00
parent ad0a7e7d62
commit 92552b49cd
10 changed files with 1300 additions and 13 deletions

View File

@@ -226,4 +226,27 @@ struct lengths
// the lengths of the station tracks, the signals standing by them among the signals given
std::vector<lengths> track_lengths(layout const &Layout, std::vector<numbered> const &Tracks, std::vector<signal> const &Signals);
// a signal by the track the trains read it on
struct post
{
TTrack *track{nullptr};
int facing{1}; // the trains it faces run 1: towards the end of the path, -1: towards its start
glm::dvec3 point{0.0};
signal::role kind{signal::role::entry}; // entry for any main signal
};
// the way of the trains from a signal on to the next main or block signal facing them
struct route
{
int next{-1}; // of the posts, -1 for none within the limit
int warning{-1}; // the warning disc passed on the way, of the posts
double length{0.0}; // m, in the plan
double speed{0.0}; // km/h, the least the switches on it allow on their curved paths, by the radius and by the speed set; 0 for no limit
std::vector<TTrack *> turnouts; // the switches it turns off the straight at
bool ended{false}; // at the end of the tracks, before the limit
};
// km/h, a train runs the path at by its least radius, 0.65 m/s² of the acceleration left unbalanced without cant; 0 for a straight one
double path_speed(TTrack const &Track, int const Path);
// the routes of the trains from each of the posts given on through the switches, none longer than the limit
std::vector<std::vector<route>> routes(std::vector<post> const &Posts, std::vector<std::size_t> const &From, double const Limit);
} // namespace station