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

refactor(editor): the SRK tool judges the SHP resonator of a signal in one place, missing, beyond the tracks, off its place or placed, and picks the place of a resonator, a joint or a cut, apart from placing it; the nearest point of a track to a signal found coarsely and narrowed down rather than by up to 4000 points. A resonator whose event would land away from its place, the track not cut there, is left out with a note, and the status after a failed placing tells Ctrl+Z takes the cuts back; the lines out of a station emptied while the signal templates are looked for, the layout of the station read only once it's known open

This commit is contained in:
maj00r
2026-10-22 19:06:49 +02:00
parent fc6d1158bd
commit 9ea3628661
3 changed files with 128 additions and 73 deletions

View File

@@ -125,6 +125,15 @@ class srk_tool final : public editor_tool
int m_length_hover{-1}; // of the lengths, the row under the mouse
int m_length_canvas{-1}; // of the lengths, of the track under the mouse in the schematic
int m_length_shown{-1}; // of the lengths, the one drawn: of the row or the track under the mouse, else of the track selected
// how the SHP track resonator of a signal stands
enum class shp_state
{
needless, // the signal needs none
missing,
beyond, // missing, the tracks before the signal end short of its place
off, // farther from its place than allowed
placed
};
// a signal of the station or of its lines, its lights as the routes of its trains need them: Ie-1, Ie-4 § 8
struct head_check
{
@@ -153,6 +162,7 @@ class srk_tool final : public editor_tool
double shp{-1.0};
double shp_found{-1.0}; // m before it the trains run into the event of the SHP resonator standing, -1 for none
bool shp_short{false}; // the tracks before it end short of the place of its resonator
shp_state shp_of() const;
};
std::vector<head_check> m_heads;
bool m_heads_known{false}; // the templates found