17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 05:09:20 +02:00

feat(editor): digitizing takes the good parts of a line: a run whose design can't be read whole is split at the track the reading fails at and each part is digitized on its own, only single tracks that make no line are left out and named in the log; Digitize all reports the lines digitized and the paths left out, opening a line digitized in parts says so with the reason for the paths left out; a stored radius agrees with the one its design makes within 0.1 %

This commit is contained in:
maj00r
2026-10-12 18:00:26 +02:00
parent 95c3842748
commit 9b75e64c9b
4 changed files with 71 additions and 22 deletions

View File

@@ -96,9 +96,10 @@ bool agrees(std::vector<stored_element> const &Stored, std::vector<alignment::el
made.push_back(describe(e));
if (stored.size() != made.size())
return false;
auto const close = [](double const A, double const B) { return std::abs(A - B) <= 0.01 + 1e-3 * std::abs(A); };
for (std::size_t i = 0; i < stored.size(); ++i)
if (stored[i].kind != made[i].kind || std::abs(stored[i].chainage - made[i].chainage) > 0.01 || std::abs(stored[i].length - made[i].length) > 0.01 ||
std::abs(stored[i].radius_start - made[i].radius_start) > 0.01 || std::abs(stored[i].radius_end - made[i].radius_end) > 0.01)
false == close(stored[i].radius_start, made[i].radius_start) || false == close(stored[i].radius_end, made[i].radius_end))
return false;
return true;
}