From f5895abfa814909240f587b09d48109a3d2b65ff Mon Sep 17 00:00:00 2001 From: maj00r Date: Mon, 12 Oct 2026 03:24:23 +0200 Subject: [PATCH] feat(editor): tracks drawn without a design get digitized: the route design keeps the line it opens in the scenery when no design is kept for it, or says why it can't (straights meeting with no curve, the curves read leaving a path by how much), trying the other transition shape before giving up; Digitize all the tracks in the route design does it for every line of the scenery and reports the count; a kept design counts as departed only where no path lies along it any more, so a parallel track or a diverging one beside a digitized line no longer shows it as left by metres; self-test command digitizeall --- application/editormode.h | 3 +- application/editormodeselftest.cpp | 7 ++ application/editormodetrack.cpp | 155 +++++++++++++++++++++++------ editor/editorAlignmentStore.cpp | 96 ++++++++++++++++-- editor/editorAlignmentStore.hpp | 1 + lang/editor_pl.po | 34 +++++-- 6 files changed, 250 insertions(+), 46 deletions(-) diff --git a/application/editormode.h b/application/editormode.h index 77df0691..9cd0c3af 100644 --- a/application/editormode.h +++ b/application/editormode.h @@ -836,7 +836,8 @@ class editor_mode : public application_mode, private editor_track::observer void render_switch_record(TTrack const &Track) const; void route_store(); bool digitize_drawn(std::vector const &Created, bool const Alone = true); - bool digitize_chain(editor_track::chain const &Chain); + bool digitize_chain(editor_track::chain const &Chain, std::string *Reason = nullptr); + void digitize_all(); void render_route_stored(); void route_update() { diff --git a/application/editormodeselftest.cpp b/application/editormodeselftest.cpp index 3f9dd817..1d07b753 100644 --- a/application/editormodeselftest.cpp +++ b/application/editormodeselftest.cpp @@ -1036,6 +1036,12 @@ editor_mode::selftest_result editor_mode::selftest_track(std::string const &comm WriteLog("SELFTEST " + command + ": " + m_route.status + " " + m_route.error); return selftest_result::handled; } + if (command == "digitizeall") + { + digitize_all(); + WriteLog(format("SELFTEST digitizeall: %zu alignments", alignment_store::records().size())); + return selftest_result::handled; + } if (command == "alignments") { auto const &records{alignment_store::records()}; @@ -2471,6 +2477,7 @@ editor_mode::selftest_result editor_mode::selftest_terrain(std::string const &co // routevertex , routearc , routeshare , routekm // routeapply, routetake as the buttons of the route design do it // alignments logs the alignments kept in the scenery and the element under each path +// digitizeall every line not digitized yet kept in the scenery, as the button of the route design does it // splitkind , nudgekind the first path over an element of the kind split in two, or moved // switchplace