mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-26 20:34:54 +01:00
feat(editor): the lines out of a station take the automatic block of 3 or 4 aspects, the block sections no shorter than the braking distance or than half of it, the block signals placed with the templates of the aspects and those standing swapped for them; block boundaries drawn by hand, a click on a track of a line of the automatic block placing block signals across both tracks there, numbered after the hectometre, the tracks cut beyond them and the block sections named and switched anew, a click on one standing taking its signals and the switching of their sections away, a step of undo each, the lengths of the sections either side shown at the mouse. A line whose block signals stand keeps them as they stand, Set the line signals placing them evenly only on a line without any, and one whose block signals no block section of the editor switches keeps the block of the scenery untouched; the signals of the other block left along a line taken away, but where it shares its track with a line of that block, and the switching of the sections gone from the lines set with them. A block signal of 4 aspects is checked for a section no shorter than half the braking distance, and fitted with templates of its aspects only
This commit is contained in:
@@ -1644,7 +1644,7 @@ class editor_mode : public application_mode, private editor_track::observer, pri
|
||||
void draw_track_hover() const;
|
||||
struct track_intent
|
||||
{
|
||||
enum class kind { none, gizmo, select, point, box, straight_set, straight_break, detour, straight_tool, straight_handle, route_vertex, route_grip, switch_at, lay, lay_end, sweep, turntable_place, turntable_exit, turntable_fit, spread, extend_end, signal_place, signal_move, switch_slide, pick_style, fouling, measure, route_trace, kilometrage };
|
||||
enum class kind { none, gizmo, select, point, box, straight_set, straight_break, detour, straight_tool, straight_handle, route_vertex, route_grip, switch_at, lay, lay_end, sweep, turntable_place, turntable_exit, turntable_fit, spread, extend_end, signal_place, signal_move, switch_slide, pick_style, fouling, measure, route_trace, kilometrage, srk_boundary };
|
||||
kind what{kind::none};
|
||||
TTrack *track{nullptr};
|
||||
int path{0};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -37,6 +37,12 @@ class srk_tool final : public editor_tool
|
||||
void forget(scene::basic_node const *Node) override;
|
||||
editor_selftest_result selftest(std::string const &Command, std::istringstream &Words) override;
|
||||
void set_open(bool const Open) { m_open = Open; }
|
||||
// the block boundaries drawn by hand on the lines out of the open station
|
||||
bool drawing() const { return m_open && m_drawing && m_layout.has_value(); }
|
||||
// what a click at the point of a track does while the block boundaries are drawn, for the label at the mouse; Valid: it does
|
||||
// something
|
||||
std::string boundary_hover(glm::dvec3 const &Point, bool &Valid);
|
||||
void boundary_click();
|
||||
// the stations described go to the files of their layers, as "//$s" lines
|
||||
void store();
|
||||
|
||||
@@ -46,6 +52,13 @@ class srk_tool final : public editor_tool
|
||||
editor_history &m_history;
|
||||
editor_templates &m_templates;
|
||||
editor_signals &m_signals;
|
||||
// the block of a line out of the station
|
||||
enum class block_kind
|
||||
{
|
||||
semi, // semi-automatic: a warning disc before the entry signal
|
||||
three, // the automatic one of three aspects: the block sections no shorter than the braking distance
|
||||
four // of four aspects, the warning two signals ahead: the sections no shorter than half of it
|
||||
};
|
||||
// where the block of a line out of the station comes from
|
||||
enum class block_reason
|
||||
{
|
||||
@@ -66,7 +79,7 @@ class srk_tool final : public editor_tool
|
||||
std::string km; // of the axis of the station along the line, empty while unknown
|
||||
bool reversed{false}; // the km rise to the left of the schematic, the switches numbered from there
|
||||
int braking{0}; // m, the braking distance of the line set by hand, 0: after its speed
|
||||
std::map<std::string, bool> blocks; // of the lines by their entry signals: the automatic block on it, as set by hand
|
||||
std::map<std::string, block_kind> blocks; // of the lines by their entry signals, as set by hand
|
||||
};
|
||||
// the schematic: the chainage across, the offsets upwards, exaggerated
|
||||
struct view
|
||||
@@ -180,8 +193,14 @@ class srk_tool final : public editor_tool
|
||||
std::string next; // the entry signal of the next station facing out along it, shown; empty for none
|
||||
bool station{false}; // ends at the next station rather than at the end of the tracks
|
||||
std::size_t blocks{0}; // the block signals standing along it
|
||||
bool automatic{false}; // of the automatic block
|
||||
std::vector<std::pair<double, std::string>> stops; // the same, out along it, shown
|
||||
block_kind block{block_kind::semi};
|
||||
block_reason why{block_reason::single}; // the block it has, so
|
||||
block_kind own{block_kind::semi}; // the block it has by itself, unless set by hand
|
||||
block_reason own_why{block_reason::single};
|
||||
// block signals stand along it, none switched by block sections of the editor: it keeps the block of the scenery as it stands
|
||||
bool legacy{false};
|
||||
double braking{0.0}; // m, the braking distance on it
|
||||
// the signals of the other block standing along it: warning discs on a line of the automatic block, block signals on one of the
|
||||
// semi-automatic one, the first of them
|
||||
std::size_t leftovers{0};
|
||||
@@ -189,7 +208,28 @@ class srk_tool final : public editor_tool
|
||||
glm::dvec2 leftover_travel{0.0, 1.0};
|
||||
};
|
||||
std::vector<line_row> m_lines;
|
||||
std::vector<station::line> m_line_ways; // of the lines listed
|
||||
std::string m_lines_problem; // why the station has no lines listed
|
||||
bool m_drawing{false}; // the block boundaries drawn by hand
|
||||
// a block boundary under the mouse while they are drawn: block signals across the line there, or the ones standing taken away
|
||||
struct boundary
|
||||
{
|
||||
bool valid{false};
|
||||
bool remove{false};
|
||||
std::string entry; // of the line under the mouse, its entry signal shown
|
||||
glm::dvec3 point{0.0}; // on its axis
|
||||
std::vector<glm::dvec3> places; // of the signals, on the axes of the tracks
|
||||
std::vector<glm::dvec3> ways; // the trains run there
|
||||
std::vector<std::string> names;
|
||||
};
|
||||
boundary m_boundary;
|
||||
// a block boundary drawn on a line of the automatic block of the open station
|
||||
struct block_edit
|
||||
{
|
||||
std::string entry; // of the line, its entry signal shown
|
||||
glm::dvec3 point{0.0}; // on its axis
|
||||
bool remove{false}; // the block signals standing there taken away, else placed
|
||||
};
|
||||
std::string m_status;
|
||||
|
||||
void load();
|
||||
@@ -233,13 +273,22 @@ class srk_tool final : public editor_tool
|
||||
int length_of(TTrack const *Track) const;
|
||||
// the signals of the lines out of the station: on a double-track line the block signals to the next station and the block
|
||||
// sections between them, on a single-track one a warning disc before the entry signal; one step of the history
|
||||
void set_lines();
|
||||
void set_lines(block_edit const *Edit = nullptr);
|
||||
// the lines out of the open station from its entry signals standing, Entries: the signals of the plan they begin at, Owners:
|
||||
// the standing ones; false with the reason while it has none
|
||||
bool lines_of_open(std::vector<standing_signal> const &Standing, std::vector<station::line> &Lines, std::vector<station::signal> &Entries, std::vector<std::size_t> &Owners, std::string &Problem) const;
|
||||
// the line has the automatic block: as set by hand for its entry signal, else where block signals stand along it, else on a
|
||||
// double-track line
|
||||
bool automatic_block(station::line const &Line, std::string const &Entry, std::vector<standing_signal> const &Standing, block_reason &Why, std::size_t &Blocks) const;
|
||||
// the block of the line: as set by hand for its entry signal, else the automatic one where block signals stand along it, of four
|
||||
// aspects where one of them has, else on a double-track line, of the aspects of the block signal chosen in the Signals tool, else
|
||||
// the semi-automatic one; Own: the block it has by itself
|
||||
block_kind block_of(station::line const &Line, std::string const &Entry, std::vector<standing_signal> const &Standing, std::vector<signal_head> const &Heads, block_reason &Why, block_kind &Own, block_reason &Own_why, std::size_t &Blocks) const;
|
||||
// the line of the kilometrage a line out of the open station runs along: of the station, at a junction another one
|
||||
std::string km_line(station::line const &Line) const;
|
||||
// the km out along the line, Number: of the line of its kilometrage
|
||||
double km_along(station::line const &Line, std::string const &Number, double const Distance) const;
|
||||
// the trains of the line run towards the higher km
|
||||
bool km_rising(station::line const &Line, std::string const &Number) const;
|
||||
// m, the braking distance at the highest speed out along the line, at 160 km/h while its tracks have none, unless set by hand
|
||||
double line_braking(station::line const &Line) const;
|
||||
// the lines out of the open station, for the panel
|
||||
void survey_lines(std::vector<standing_signal> const &Standing);
|
||||
void render_lines();
|
||||
|
||||
@@ -458,6 +458,16 @@ editor_mode::track_intent editor_mode::track_intent_at(int const Mods)
|
||||
}
|
||||
return intent;
|
||||
}
|
||||
if (m_track_tab == track_tab::srk && m_srk.drawing())
|
||||
{
|
||||
bool valid{false};
|
||||
intent.track = m_hover.track;
|
||||
intent.path = m_hover.path;
|
||||
intent.position = m_hover.track != nullptr ? m_hover.point : ground;
|
||||
intent.action = m_srk.boundary_hover(intent.position, valid);
|
||||
intent.what = kind::srk_boundary;
|
||||
return intent;
|
||||
}
|
||||
if (m_track_tab == track_tab::srk && m_hover.track != nullptr)
|
||||
{
|
||||
intent.track = m_hover.track;
|
||||
@@ -810,6 +820,7 @@ void editor_mode::track_press(track_intent const &Intent)
|
||||
if (Intent.track != nullptr)
|
||||
m_km.pick(*Intent.track, Intent.position);
|
||||
return;
|
||||
case kind::srk_boundary: m_srk.boundary_click(); return;
|
||||
case kind::fouling:
|
||||
if (Intent.path == 1)
|
||||
m_fouling.fix(Intent.index);
|
||||
|
||||
@@ -11110,9 +11110,6 @@ msgstr "linia dwutorowa"
|
||||
msgid "a single-track line"
|
||||
msgstr "linia jednotorowa"
|
||||
|
||||
msgid "automatic (SBL)"
|
||||
msgstr "samoczynna (SBL)"
|
||||
|
||||
msgid "semi-automatic"
|
||||
msgstr "półsamoczynna"
|
||||
|
||||
@@ -11176,18 +11173,12 @@ msgstr "%s, auto"
|
||||
msgid "Auto: %s, %s"
|
||||
msgstr "Auto: %s, %s"
|
||||
|
||||
msgid "Automatic block (SBL)"
|
||||
msgstr "Blokada samoczynna (SBL)"
|
||||
|
||||
msgid "Placed on a double-track line only: on a single track the block signals would face both ways, the editor leaves those standing as they are"
|
||||
msgstr "Edytor stawia ją tylko na linii dwutorowej: na jednym torze semafory SBL musiałyby stać w obu kierunkach, takie, które już stoją, zostawia bez zmian"
|
||||
|
||||
msgid "Semi-automatic block"
|
||||
msgstr "Blokada półsamoczynna"
|
||||
|
||||
msgid "The block of the line, both tracks of a double-track one alike. Automatic (SBL): block signals with block sections, no warning disc. Semi-automatic: a warning disc ToA the braking distance before the entry signal. By itself: the automatic one where block signals stand along the line or it's double-track, else the semi-automatic one"
|
||||
msgstr "Blokada liniowa szlaku, na dwutorowym taka sama na obu torach. Samoczynna (SBL): semafory SBL z odstępami blokowymi, bez tarczy ostrzegawczej. Półsamoczynna: tarcza ostrzegawcza ToA w odległości drogi hamowania przed semaforem wjazdowym. Auto: samoczynna, gdy na szlaku stoją semafory SBL albo linia jest dwutorowa, inaczej półsamoczynna"
|
||||
|
||||
msgid "its SHP resonator belongs %.0f m before it"
|
||||
msgstr "rezonator SHP powinien stać %.0f m przed nim"
|
||||
|
||||
@@ -11251,17 +11242,107 @@ msgstr[0] "%zu ma tory kończące się przed miejscem rezonatora"
|
||||
msgstr[1] "%zu mają tory kończące się przed miejscem rezonatora"
|
||||
msgstr[2] "%zu ma tory kończące się przed miejscem rezonatora"
|
||||
|
||||
msgid "%zu warning disc stands along it, of the semi-automatic block: delete it in the Signals tool"
|
||||
msgid_plural "%zu warning discs stand along it, of the semi-automatic block: delete them in the Signals tool"
|
||||
msgstr[0] "Stoi na nim %zu tarcza ostrzegawcza, z blokady półsamoczynnej: usuń ją w narzędziu Sygnalizatory (H)"
|
||||
msgstr[1] "Stoją na nim %zu tarcze ostrzegawcze, z blokady półsamoczynnej: usuń je w narzędziu Sygnalizatory (H)"
|
||||
msgstr[2] "Stoi na nim %zu tarcz ostrzegawczych, z blokady półsamoczynnej: usuń je w narzędziu Sygnalizatory (H)"
|
||||
|
||||
msgid "%zu block signal stands along it, of the automatic block: delete it in the Signals tool"
|
||||
msgid_plural "%zu block signals stand along it, of the automatic block: delete them in the Signals tool"
|
||||
msgstr[0] "Stoi na nim %zu semafor SBL, z blokady samoczynnej: usuń go w narzędziu Sygnalizatory (H)"
|
||||
msgstr[1] "Stoją na nim %zu semafory SBL, z blokady samoczynnej: usuń je w narzędziu Sygnalizatory (H)"
|
||||
msgstr[2] "Stoi na nim %zu semaforów SBL, z blokady samoczynnej: usuń je w narzędziu Sygnalizatory (H)"
|
||||
|
||||
msgid "LMB: fly to the first of them"
|
||||
msgstr "LPM: leć do pierwszego z nich"
|
||||
|
||||
msgid "SBL, 3 aspects"
|
||||
msgstr "SBL trzystawna"
|
||||
|
||||
msgid "SBL, 4 aspects"
|
||||
msgstr "SBL czterostawna"
|
||||
|
||||
msgid "Automatic block, 3 aspects (SBL)"
|
||||
msgstr "Samoczynna blokada liniowa trzystawna (SBL)"
|
||||
|
||||
msgid "Automatic block, 4 aspects (SBL)"
|
||||
msgstr "Samoczynna blokada liniowa czterostawna (SBL)"
|
||||
|
||||
msgid "A block signal tells of the next one, Ie-1: red, orange for the next at stop, green. The block sections no shorter than the braking distance"
|
||||
msgstr "Semafor SBL zapowiada następny, Ie-1: czerwone, pomarańczowe gdy następny wskazuje Stój, zielone. Odstępy nie krótsze niż droga hamowania"
|
||||
|
||||
msgid "A block signal tells of the next two, Ie-1: red, orange for the next at stop, green flashing for the one after it at stop, green. The block sections no shorter than half the braking distance, two of them no shorter than it"
|
||||
msgstr "Semafor SBL zapowiada dwa następne, Ie-1: czerwone, pomarańczowe gdy następny wskazuje Stój, zielone migające gdy Stój wskazuje ten za nim, zielone. Odstępy nie krótsze niż połowa drogi hamowania, dwa razem nie krótsze niż cała"
|
||||
|
||||
msgid "No block section of the editor switches its block signals: it keeps the block of the scenery as it stands"
|
||||
msgstr "Jego semaforów SBL nie przełącza żaden odstęp edytora: zostaje blokada scenerii, tak jak stoi"
|
||||
|
||||
msgid "of the scenery"
|
||||
msgstr "ze scenerii"
|
||||
|
||||
msgid "Block signals stand along the line, none of them switched by a block section of the editor: the line keeps the block of the scenery as it stands"
|
||||
msgstr "Na szlaku stoją semafory SBL, ale żadnego nie przełącza odstęp edytora: szlak zostaje z blokadą scenerii, tak jak stoi"
|
||||
|
||||
msgid "The block of the line, both tracks of a double-track one alike. Automatic (SBL): block signals with block sections, no warning disc, of 3 or 4 aspects, the templates of the block signals standing swapped for those of the aspects. Semi-automatic: a warning disc ToA the braking distance before the entry signal. By itself: the automatic one where block signals stand along the line, of their aspects, or it's double-track, of the aspects of the block signal chosen in the Signals tool, else the semi-automatic one"
|
||||
msgstr "Blokada szlaku, na obu torach dwutorowego taka sama. Samoczynna (SBL): semafory SBL z odstępami, bez tarczy ostrzegawczej, trzy- albo czterostawna; szablony stojących semaforów SBL zostają podmienione na te o właściwej liczbie stawności. Półsamoczynna: tarcza ostrzegawcza ToA w drodze hamowania przed semaforem wjazdowym. Auto: samoczynna, gdy na szlaku stoją semafory SBL (stawność jak u nich) albo szlak jest dwutorowy (stawność jak u semafora SBL wybranego w narzędziu Sygnalizatory), inaczej półsamoczynna"
|
||||
|
||||
msgid "Draw the block boundaries"
|
||||
msgstr "Rysuj granice odstępów"
|
||||
|
||||
msgid "LMB on a track of a line of the automatic block, beyond the entry signal: block signals across both tracks there, numbered after the hectometre ahead of them, the tracks cut 15 m beyond them and the new block sections named; LMB on a block boundary standing takes its signals away, the sections either side joined. A line whose block signals stand keeps them: Set the line signals places them evenly only on a line without any. One step of undo each"
|
||||
msgstr "LPM na torze szlaku z SBL, za semaforem wjazdowym: semafory SBL na obu torach w tym miejscu, numerowane po hektometrze przed nimi, tory przecięte 15 m za nimi i nazwane nowe odstępy. LPM na istniejącej granicy zabiera jej semafory, a odstępy po obu stronach łączą się w jeden. Szlak, na którym stoją już semafory SBL, je zachowuje: Ustaw sygnalizatory szlakowe rozstawia je równo tylko na szlaku bez żadnego. Każde kliknięcie to jeden krok cofania"
|
||||
|
||||
msgid "LMB on a track of a line beyond the entry signal: a block boundary there; on one standing: taken away"
|
||||
msgstr "LPM na torze szlaku za semaforem wjazdowym: granica odstępu w tym miejscu; na istniejącej granicy: usunięcie"
|
||||
|
||||
msgid "No block section of the editor switches the block signals beyond %s: the line keeps them as they stand"
|
||||
msgstr "Semaforów SBL za %s nie przełącza żaden odstęp edytora: szlak zostaje, tak jak stoi"
|
||||
|
||||
msgid "The line beyond %s has the semi-automatic block: choose the automatic one for it in the table of the lines"
|
||||
msgstr "Szlak za %s ma blokadę półsamoczynną: wybierz dla niego SBL w tabeli szlaków"
|
||||
|
||||
msgid "The line beyond %s is single-track: the editor draws the block boundaries of double-track lines only"
|
||||
msgstr "Szlak za %s jest jednotorowy: edytor rysuje granice odstępów tylko na szlakach dwutorowych"
|
||||
|
||||
msgid "A block boundary stands %.0f m or more from the entry signals"
|
||||
msgstr "Granica odstępu musi stać co najmniej %.0f m od semaforów wjazdowych"
|
||||
|
||||
msgid "Click: take the block signals %s away, the block sections either side joined: %.2f km"
|
||||
msgstr "Klik: usuń semafory SBL %s, odstępy po obu stronach połączone: %.2f km"
|
||||
|
||||
msgid "Click: block signals %s here: the block sections %.2f km and %.2f km"
|
||||
msgstr "Klik: semafory SBL %s tutaj, odstępy %.2f km i %.2f km"
|
||||
|
||||
msgid "shorter than half the braking distance, %.0f m, of the 4-aspect block"
|
||||
msgstr "krótszy niż połowa drogi hamowania (%.0f m), a to SBL czterostawna"
|
||||
|
||||
msgid "shorter than the braking distance, %.0f m"
|
||||
msgstr "krótszy niż droga hamowania, %.0f m"
|
||||
|
||||
msgid "The line drawn on isn't there any more"
|
||||
msgstr "Szlaku, na którym rysujesz, już nie ma"
|
||||
|
||||
msgid "The line beyond %s has no automatic block the editor sets: choose one for it in the table of the lines"
|
||||
msgstr "Szlak za %s nie ma SBL, którą ustawia edytor: wybierz ją w tabeli szlaków"
|
||||
|
||||
msgid "The block section to %s is %.0f m long, shorter than half the braking distance of %.0f m, of the 4-aspect block"
|
||||
msgstr "Odstęp do %s ma %.0f m, mniej niż połowa drogi hamowania %.0f m, a to SBL czterostawna"
|
||||
|
||||
msgid "Drawing the block boundaries: LMB on a track of a line out of the station, beyond its entry signal"
|
||||
msgstr "Rysowanie granic odstępów: LPM na torze szlaku wychodzącego ze stacji, za semaforem wjazdowym"
|
||||
|
||||
msgid "%zu warning disc stands along it, of the semi-automatic block: Set the line signals takes it away"
|
||||
msgid_plural "%zu warning discs stand along it, of the semi-automatic block: Set the line signals takes them away"
|
||||
msgstr[0] "Stoi na nim %zu tarcza ostrzegawcza z blokady półsamoczynnej: Ustaw sygnalizatory szlakowe ją usunie"
|
||||
msgstr[1] "Stoją na nim %zu tarcze ostrzegawcze z blokady półsamoczynnej: Ustaw sygnalizatory szlakowe je usunie"
|
||||
msgstr[2] "Stoi na nim %zu tarcz ostrzegawczych z blokady półsamoczynnej: Ustaw sygnalizatory szlakowe je usunie"
|
||||
|
||||
msgid "%zu block signal stands along it, of the automatic block: Set the line signals takes it away"
|
||||
msgid_plural "%zu block signals stand along it, of the automatic block: Set the line signals takes them away"
|
||||
msgstr[0] "Stoi na nim %zu semafor SBL z blokady samoczynnej: Ustaw sygnalizatory szlakowe go usunie"
|
||||
msgstr[1] "Stoją na nim %zu semafory SBL z blokady samoczynnej: Ustaw sygnalizatory szlakowe je usunie"
|
||||
msgstr[2] "Stoi na nim %zu semaforów SBL z blokady samoczynnej: Ustaw sygnalizatory szlakowe je usunie"
|
||||
|
||||
msgid "%zu signal taken away"
|
||||
msgid_plural "%zu signals taken away"
|
||||
msgstr[0] "usunięto %zu sygnalizator"
|
||||
msgstr[1] "usunięto %zu sygnalizatory"
|
||||
msgstr[2] "usunięto %zu sygnalizatorów"
|
||||
|
||||
msgid "%zu given the template of the aspects of its line"
|
||||
msgid_plural "%zu given the templates of the aspects of their lines"
|
||||
msgstr[0] "%zu dostał szablon o stawności swojego szlaku"
|
||||
msgstr[1] "%zu dostały szablony o stawności swoich szlaków"
|
||||
msgstr[2] "%zu dostało szablony o stawności swoich szlaków"
|
||||
|
||||
msgid "Ctrl+Z takes it back"
|
||||
msgstr "Ctrl+Z cofa"
|
||||
|
||||
Reference in New Issue
Block a user