18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 12:57:06 +01:00
Commit Graph

333 Commits

Author SHA1 Message Date
maj00r c508f5eef1 fix(editor): a photo origin aligned by hand isn't overridden by //$g, the 4K photos of the zoom take the tile under the camera alone
- //$g of the scenery file went before the origin of //$o, also where the user had aligned the photo by hand in the editor: the
  alignment was gone on the next opening. An origin typed in the editor is written into //$o with the word "aligned", and such
  an origin goes before //$g. The word is optional: a release before it passes it over and reads the origin as before, and an
  //$o without it is read as before. "Use it" (the origin of //$g) takes the word off.
- The zoom turned the 4K photos on for the 3 x 3 tiles around the camera, as the setting for them does: up to about 0.75 GB of
  the memory of the graphics card, unasked. By the zoom alone the 4K photo is the tile under the camera (about 85 MB); the
  setting keeps the 3 x 3.
2026-11-24 19:30:23 +01:00
maj00r 744a7c7dca Merge feat/editor-project-setup into feat/editor-photo-easy
# Conflicts:
#	application/editormodenmt.cpp
#	application/editormodeselftest.cpp
#	application/editormodeselftestexpect.cpp
#	application/editormodeselftestterrain.cpp
#	tests/editor/cases/fs_3_without_terrain.txt
2026-11-24 19:30:23 +01:00
maj00r 9016b3a951 Merge feat/editor-model-turnouts-ui into feat/editor-project-setup 2026-11-24 19:30:21 +01:00
maj00r 8b48cfddae Merge feat/editor-legacy-takeover into feat/editor-model-turnouts-ui
# Conflicts:
#	editor/project/projectSession.cpp
2026-11-24 19:15:20 +01:00
maj00r 0301c6e9cc fix(editor): the pieces of a cut old track get its events as the simulator fires them, its joints follow a line laid anew
- keep_old_tracks() kept all the events on the first piece of an old track. The simulator fires event1 as a vehicle enters a
  track at its Point2, event2 at its Point1 and event0 while it stands on it (TrkFoll.cpp), so with a 120 m track cut into 40
  and 80 m a train running towards Point1 got event1 about 80 m late, and one standing on the second piece no event0. Now each
  piece gets event0/eventall0, the piece at Point1 event2/eventall2 and the piece at Point2 event1/eventall1. The keywords are
  compared in any case, as the simulator lowers its tokens.
- The joints of the old tracks kept their chainages through move_vertex, set_vertex, insert_vertex and remove_vertex: widening
  a 90° curve by 20 m shortens the line by about 8.6 m, and a joint past the new end was dropped, a short buffer-stop or signal
  track there with its name, events and circuit. Each joint now goes to the point of the new line nearest to where it was.
  solved_line::nearest() is shared with the crossover planner.
- Sonar: the seeded generators of the takeover tests are marked (S2245), two dereferences after a REQUIRE too (S2259).
2026-11-24 19:15:18 +01:00
maj00r eb376a2d3e Merge feat/editor-model-in-editor into feat/editor-legacy-takeover 2026-11-24 19:15:17 +01:00
maj00r 14bbd392b2 fix(editor): a save writing some tracks of a line keeps the records of the others, a plan edit refused in part changes nothing
- record_written() erased every record of the line and added only the pieces written in this save, while the scenery writes
  only the tracks changed since. After a gizmo move and Ctrl+Z on one track of a line, the next save kept a record of that
  track alone: on reopening the line owned one track, and the next Plan edit left the others as duplicates. The records of
  the tracks the line still has and this save didn't write now stay.
- model_run() kept each command before trying the next: with the radius of one vertex carried out and the cant of the next
  refused, the first stayed changed under "Refused, nothing changed". Several commands are now all tried on a copy first.
- The fingerprint of the scenario index made a string of every file name before its .scn filter, which throws on Windows
  outside of the code page, on a detached thread (the class of GE#560). The extension is looked at first, as in the index
  itself; scenery_text::name_of() and has_extension() are shared by both.
- A Del deferred by the check of the scenarios reads Shift as it was at the key press, not at the click on "go on".
- open_project() writes no project file for a map with nothing to migrate (#461): the session test expects that.
2026-11-24 19:15:15 +01:00
maj00r fa06830c64 Merge feat/editor-turnout-catalogue into feat/editor-model-in-editor 2026-11-24 19:15:15 +01:00
maj00r 348cc2df47 fix(editor): migrated switches leave to the side their records say, bent ones migrate, a record fitting two types isn't guessed
- The migration mapped L to hand 1, but switch_store::classify() writes R where the diverging end lies to the positive cross of
  the direction, which is the side of hand 1 of the domain (its curvature above 0 turns that way). Every migrated switch came
  out mirrored, and the test checked hand == 1 for an L record without looking at where the diverging end lies. R is hand 1
  now, and the test checks the side of the diverging end.
- classify() writes a switch bent into a curve as Rlj or Rld with the radius of the ordinary switch it's bent from; the
  catalogue has it as an Rz, so no bent switch could migrate. They're looked up as Rz.
- catalogue_type() took the first loose match. A movable nose isn't in the record, so the ordinary frog is taken where the
  catalogue has both; a record fitting two other types (the variants of an Rpd) is kept as it was, why with it.
- Slips and crossings are kept as they were, as the header of the migration says.
- Smaller: the type looked up is checked before its length is read; new diverging, slip and crossing tracks get the
  chainage of the turnout as a diverging track had before; the walk of a bent transition stops on a step that turned nothing
  instead of dividing by it.
- Sonar: the leg check skips an end whose turnout isn't found (S2259), the spacing of a crossover is measured in whole steps
  counted in an integer (S2193), the seeded generator of the turnout kinds test is marked (S2245).
2026-11-24 19:15:13 +01:00
maj00r 28a81ee0bd Merge ui/editor-lay-flow into feat/editor-turnout-catalogue
# Conflicts:
#	editor/layout/layoutGenerator.cpp
#	editor/layout/layoutNetwork.cpp
2026-11-24 19:15:02 +01:00
maj00r 2217da8648 Merge ui/editor-consistency into ui/editor-lay-flow
# Conflicts:
#	application/editormodeselftestexpect.cpp
2026-11-24 18:55:28 +01:00
maj00r f53cb24c6e Merge feat/editor-project-file into ui/editor-consistency
# Conflicts:
#	application/editormodeselftestexpect.cpp
2026-11-24 18:54:50 +01:00
maj00r b15f7dcdec fix(editor): file names outside the code page don't crash the project, includes are found in any case, a project file cut short isn't put in place
- The scenario index made a string of the name of every file in the folder, which throws on Windows for a name the ANSI code
  page can't hold (the class of GE#560). It looks at the extension first and leaves out a .scn the game couldn't open by its
  name either; the messages of the project file show paths as UTF-8.
- The includes are read with the FileCased() fallback of the game (scenery_text::file_text), so on Linux an include written in
  another case no longer drops the scenario from the index, skips the migration of its file or marks its tracks as changed by
  hand.
- save() closes the file before looking at it: a failed last flush no longer renames a truncated .new over the project.
- "next node 0" is refused instead of wrapping to 0xffffffff.
- open_project() writes no .eu07proj when there were no //$ lines to migrate, and asks exists() without throwing.
2026-11-24 18:54:33 +01:00
maj00r 2b36fbe9af Merge feat/editor-track-turnouts into feat/editor-project-file 2026-11-24 18:52:09 +01:00
maj00r fffdbb9578 fix(editor): no diverging track is laid from a main track that isn't laid, a switch track with no pieces isn't written
- lay_diverging() didn't look at turnout_frame::valid: with the main track unsolved the diverging track was laid from the origin
  and settle moved its end node there. Edits were rolled back by the check, but nothing refused it at its source. It now
  returns an error, for every caller.
- whole_path() took Pieces.front() of a track the cutter gave no pieces of; the switch track is refused with the reason.
- Sonar: the turnout lookups of the node and network checks are guarded (S2259), the search of the free transition and the
  test loops count in integers (S2193; 2 m steps, the same values as their sum), the seeded generator of the turnout edits
  is marked (S2245).
2026-11-24 18:52:04 +01:00
maj00r e95ee2fc4c Merge ui/editor-first-steps into feat/editor-track-turnouts
# Conflicts:
#	editor/layout/layoutNetwork.cpp
2026-11-24 18:50:23 +01:00
maj00r 44d94ae3d3 fix(editor): the answer Without terrain keeps to the scenery open, the settings stay as they were
nmt_decline_offer() turned off terrain_while_laying and terrain_model().area in the settings of the editor and saved them, so
one Without terrain for a scratch scenery left the terrain off for every scenery opened later. The answer now holds for the
scenery open only (nmt_state::declined, read through nmt_area()); the checkbox of the terrain panel shows it and, ticked, turns
the terrain on again and keeps it in the settings. The nmtquestion self-test no longer writes the tester's settings, and fails
the run if the answer changed them.
2026-11-24 18:49:59 +01:00
maj00r 47995b9ae2 Merge lang/editor-track-pl into ui/editor-first-steps
# Conflicts:
#	application/editormodeselftestexpect.cpp
2026-11-24 18:48:52 +01:00
maj00r 4ae90e99c6 fix(editor): the norms see a Bloss transition as it is, a line splits at the tangent point of an arc with no transitions
- A Bloss transition went to the norms as an even one: 60 m into R 600 m at 100 km/h showed 63 mm/s of deficiency change,
  where its middle reaches 109 mm/s, past the hard limit of 80 mm/s, so the edit wasn't blocked. norms::element::bloss makes the
  engine follow 3t^2 - 2t^3 of the curvature, look at the transition in eight pieces, and take the shift as L^2 / 40R instead
  of L^2 / 24R. Two Bloss halves no longer run on into one element of the chain.
- split_line right at the tangent point of an arc without transitions was refused ("the tangent there doesn't cross the
  tangents of the curve"): the curvature there is already the arc's, so it now takes the start or the end of the curve.
- Sonar: the chain walk, describe_chain and check_norms check the lines they look up (S2259), join_ends returns when an end
  isn't found rather than when a reason was given (S836), the test loops count in integers (S2193), the seeded generator
  of the random edits is marked (S2245).
2026-11-24 18:48:49 +01:00
maj00r e3092df0ca Merge feat/editor-norms into feat/editor-track-model 2026-11-24 18:40:24 +01:00
maj00r a8e1e6ab71 fix(editor): TSI and EN take close jumps of the cant deficiency together, the norms queue keeps its own span after a delete
- TSI INF and EN 13803 limit an abrupt change of the cant deficiency but give no intermediate length, so two jumps a few metres
  apart were each checked alone: at km 478 of the golden line CH reported 191 mm over the TSI limit, TSI itself nothing. With
  no intermediate length in the profiles of the element, the longest any profile asks for is taken. The golden report changes
  that way: TSI gets the 191 mm hard limit at km 478, EN reports it instead of 106 and 85 mm one by one.
- forget() moves the span whose findings alone are kept (a diverging track) down by the spans removed before it, and drops a
  queued line whose own span was removed, instead of leaving the index on another span.
- The report test of R 400 / 80 mm runs at 90 km/h and requires the finding: at 80 km/h there was none and the check never ran.
2026-11-24 18:40:23 +01:00
maj00r 001dd0439a Merge test/editor-track-golden into feat/editor-norms
# Conflicts:
#	application/editormodeselftestexpect.cpp
2026-11-24 18:35:42 +01:00
maj00r 4217650469 test(editor): the entries known to be lost are checked apart from should_fail, the cant test says where the inspector conversion is tested
- A normal test checks that known_lost.scn and each of its entries are there and read, so the should_fail tests can't pass for
  data gone missing.
- The comment of test_cant.cpp said the tests of cant_of_roll()/roll_of_cant() are here; they are the self-test case
  1_inspector_cant.txt, as the unit tests don't link the editor.
2026-11-24 18:35:19 +01:00
maj00r 6ed30b0fbd Merge fix/editor-switch-rules into test/editor-track-golden 2026-11-24 18:34:45 +01:00
maj00r 0de04dceed Merge ui/editor-track-panels into fix/editor-switch-rules
# Conflicts:
#	application/editormodeselftestexpect.cpp
2026-11-24 18:34:44 +01:00
maj00r 65e4870318 test(editor): a mistyped track fails the self-test, indented comments are skipped, case 7b checks the switch got bent
- A blank line or an indented `#` comment in a script is no longer a command no group takes.
- `trackcant`, `routegauge` and `tracksetdelete` with a track that isn't there count as a failed expectation.
- `expect shaped <switch> <yes|no>`: 7b checks that the gizmo drag bent the switch out of its record before deleting it.
- The ramp-length loop of test_alignment counts in an integer (Sonar S2193).
2026-11-24 18:34:25 +01:00
maj00r 58521e565f test(editor): the cases of the aerial photo with no fuss, and fs_3 with the line in place of the question
ph_1: the photo turned off with the button of the toolbar stays off over the wizard's //$o on 1 when the scenery is opened
again, on again after the next. ph_2: the first L in a scenery placed on the map asks nothing, the terrain loads in the
background with its line in the panel of the laying, Without terrain stops it. ph_3: the tracks drawn over the photo in the top
view zoomed in under 0.5 m a pixel, not without the photo. ph_4: the button and ~ are the user's choice, the terrain of the model
made afterwards doesn't turn the photo on again, F1 opens.

fs_3 still checks the answer Without terrain, now the button of the line which took the place of the question in a window, and
that no window asks. New for the scripts: expect photo <on|chosen|zoom4k|tracksover>, expect terrain <loading|question>,
toolbar <key|name>, orthophoto forget, and the key grave (~) for tap.
2026-11-24 01:29:32 +01:00
maj00r 344e5eff3c feat(editor): no question of the terrain at the first L, it loads in the background and the photo doesn't wait for it
The first L in a new scenery with no tracks nor terrain asked in a window whether to load the terrain. Now nothing is asked:
where the scenery lies on the map the terrain model loads in the background around it, as the answer Load the terrain did, and
a line in the panel of the laying says "Terrain: loading..." with Without terrain, which stops it as that answer did; it goes
once the terrain is in. A scenery not placed on the map has Place it... there, to Terrain (F5). Whether a new scenery gets its
terrain by itself is a checkbox of the settings of the terrain loading, where the window had it. A download of the model that
failed is told there, and in the banner of the loading and the terrain panel, in plain words as the photo tells its own, not
as the code of WinHTTP (which stays in the log).

A tile of the photo no longer waits for the chunks of the terrain still to come under it: it lies flat at the height of the
ground found last (of the layer before any was) and goes onto the ground as it comes. The window and its strings are gone.
2026-11-24 01:29:32 +01:00
maj00r 41b298ac69 feat(editor): the aerial photo turned on or off kept per scenery, //$g of the scenery first for its origin
The photo on or off is the scenery's now, as the user left it in it: a global off kept by the editor no longer hides the photo
of a scenery the wizard made with //$o on 1, and the old global choice is left behind. With nothing chosen in the scenery it's
as the scenery keeps it, else off, and the terrain model turns it on where the scenery lies on the map.

The origin of the scenery is taken from //$g of its file before the one the editor remembered for a scenery of that name, or
wrote into //$o with it; where they're apart by more than a metre the status line says so, and the settings of the
orthophoto tell that an origin typed there is for the session.

The rules the photo goes by stand on their own (editorPhotoRules), with their unit tests; the settings of the editor are read
and written through a stream, so they're tested without the user's file.
2026-11-24 00:05:22 +01:00
maj00r 075a66d169 feat(editor): the assumptions of the project asked for at the start, what's drawn, kept with the map
editor-project-setup.md: a new user drew with no word of what: the norms, the speed, the gauge and the rail lay about the panels, set
on the way. Now one short step, "What do you draw?" (Co rysujesz?), one screen of defaults and one button:

- The fields: the norms (PLK ST-T1-A6, TSI alone, EN 13803, CH; PLK by default, no "none": a fictional scenery has a profile too), the
  speed of the line (chips 40..200, 100 km/h), the traffic, a main or a side track, the gauge (1435 / 1520 / 1000 / 750 / 600 mm),
  the rail (60E1 / 49E1 / S42), the look of the tracks under More (the rails and the trackbed as now where left empty).
  application/editorsetupui.* draws them for all three places below.
- Asked for as the last step of the wizard of a new scenery (4., or 2. for a fictional one; its button Start: create and open in the
  editor), which writes them into the new scenery; and in a scenery with none, as a card in the inspector of the tracks in place of the
  first steps, until its Start. Changed later in their window, Assumptions of the project, from the editor settings or the line of
  them under the first steps in Tracks; a change checks the lines laid before against them, the report in the window of the norms,
  nothing laid changed by it.
- Kept with the map (editor/editorProjectSetup.*, one record "setup norms plk speed 100 traffic mixed track main gauge 1435 rail 60E1"):
  in its project file where it has one (a record of its own; the profile of the scenery the model judges by set with it), else in the
  scenery as //$u lines, which the simulator skips and the scene layers keep as a mark of the editor. Read when the map is opened, the
  project file first. A scenery saved without them holds nothing new.
- The defaults of the tools from them: the speed of the laying and of the route design, the gauge and the rails and the trackbed of the
  tracks laid, the norms checked against, the rail of the switch tool and the usual switch of the rail for the speed on its diverging
  track (the closest speed, the ratio usual for it). A route with no speed of its own takes the speed of the assumptions.

Self-test: setup [<key> <value>]..., setupwindow [close]; expect setup none|<key> <value>, expect setupmark <present|absent>, expect layspeed <km/h>. The cases
ps_1_setup_saved (set, saved into the scenery, read back after a reopen) and ps_2_setup_project (into the project file with the
editing on the model, read from there after a reopen with it off).

Tests: U: the record written and read back, the defaults, what it can't read, the class of the line, kept in the project file.

lang/editor_pl.po: the Polish of the new texts.
2026-11-23 23:24:28 +01:00
maj00r 482777f742 fix(editor): the tracks of a line of the model saved into a file under an origin aren't taken for changed by hand
The last part of E4b (E4a left it): a track the generator made, written into a layer of another placement than the one its entry was
made for (a file under an origin), went by its own export, recorded by none, and the scenery opened again took its line for changed by
hand.

- project::moved_entry: the entry of a track of the generator, a plain track or a switch track, as written into a file of another
  placement: the points of its paths moved by the difference of the origins, in the shortest form of the generator, the control vectors
  as they are. The save writes it so and records it, the track keeps it as its text for the next save; reopened, the checksums of the
  file are the ones recorded.

Self-test: tests/editor/run.py takes a line `#> append <text>` of a case, added at the end of the copy of the fixture. The case
m_14_layer_origin (a line of the model laid under origin 2000 0 0, saved, reopened, saved again and reopened: nothing changed by hand).

Tests: U: the entry of a track moved for a file under an origin, its control vectors as they were; not moved, the checksum the same.
2026-11-23 18:49:11 +01:00
maj00r 75ce03b95a feat(editor): the parallel tool beside a line of the model lays a line of the model, its arcs concentric
Continues E4b (editor-tracks-domain.md §8, "Odsuń tor równoległy"): with the editing on the model on, the parallel tool beside a track of
a line of the model lays a new line of the model at the spacing, one create_line, checked by the norms.

- editor/layout/layoutParallel: the line alongside a line, pure: the legs of the tangents offset, the vertices where the offset legs
  meet, the arcs concentric with the line's, the radius less on the inside of a curve and more on the outside, the transitions recomputed
  from the shift of the arc so the centre stays the line's; the cant and the class of the line, its grade breaks at the same share of
  the length. In a curve the spacing is widened by the widening of the gauge of both tracks on the sides facing each other (PLK tom II
  annex 1, gauge::curve_widening, under R 250 m), where the transitions of the curve can take it; where they can't, told so. The norms
  of the track geometry have no spacing of their own yet.
- The tool tells the line laid, the spacing in each curve widened, what the norms warn of; refused, why, nothing changed.

Self-test: expect modelspacing <line> <other> <m> <low> <high>. The case m_13_parallel (a line laid on the inside of the curve of a line
of the model, 4.5 m on the straight and in the arc, one step).

Tests: U: the line alongside a straight and alongside three curves on both sides, laid, the arcs concentric within 2 mm; alongside a
curve of R 200 m the spacing widened by the gauges, the transitions longer on the inside and shorter on the outside; not widened where a
curve has no transitions, told why.

lang/editor_pl.po: the Polish of the new texts.
2026-11-23 18:49:10 +01:00
maj00r 8b1720f873 feat(editor): curves added to a line of the model and taken out, a line laid on from its free end sharing the node there
Continues E4b (editor-tracks-domain.md §4, §8): two edits E4a left.

- The route design of a line of the model adds a curve at a distance from its start (insert_vertex: a vertex on the leg of the tangents
  there, no curve until it's dragged off the line, then of the radius of the lay tool) and takes the curve of a vertex out
  (remove_vertex), a command each, the design read again from the model; a handle dragged told above them.
- The lay tool laying from the free end of a line of the model, or to one, makes the new line go on from the node of that end, shared,
  not a free node of its own beside it: create_line given the node (layout::create_line::start_node, end_node: a free end of a line of
  its own, the line leaving it along its heading or against it as its first leg does), its leg there put onto the tangent of the node, so
  the line goes on with no kink. Its tracks and the other line's end at the numbers of the node, to the bit, also after a save and a
  reopen.

Self-test: modelvertexadd <m>, modelvertexdel <index>; expect modelvertices <line> <count>, expect modelnodes <count>. The cases
m_10_grade_curves (a curve added, bent, taken out, a step each) and m_12_lay_from_end (a line laid on from a free end shares its node, the
ends to the bit after a reopen).

Tests: U: a line laid on from the free end of another one and back from its start share the nodes, a node of two ends no free end, a kink
refused, undone the node free again.

lang/editor_pl.po: the Polish of the new texts.
2026-11-23 18:49:01 +01:00
maj00r b3a2f1fef2 feat(editor): the vertices of a line of the model dragged on the map, the line as the model would lay it shown before they're let go
Continues E4b (editor-tracks-domain.md §0 pkt 2, §8 "Przesuń wierzchołek", "Zmień R / L / D wierzchołka"): the route design opened on a
line of the model has its handles on the map, a vertex and the grip of the radius of each curve.

- While a handle is dragged the change is tried on a copy of the network as it goes: the line as the model would lay it drawn over the
  map, green, or red where it's refused, and by the mouse and in the panel why it's refused or what the norms say of it ("The norms:
  2 notes"). Let go, it's one command of the model: move_vertex for a vertex moved, set_vertex for a radius dragged; a vertex moved and
  its curve changed at once one set_vertex with its place (layout::set_vertex::point), one step. The first and the last vertex of a
  line of two or more go along the tangents of its ends, as the route design drags them.
- No gizmo on the tracks of a line of the model, nor the points of their paths dragged by hand: the line is edited through the route
  design. The gizmo stays for the old tracks and the models.

Self-test: modelplan opens the route design in the field of the tracks; expect modelvertexat <line> <index> <x> <z> <tolerance>, expect
modelpreview <shown|none>. The case m_11_vertex_drag (the vertex dragged with the mouse, the preview told while it's held, one step).

Tests: U: a vertex moved and its curve changed by one set_vertex, one step, taken back.

lang/editor_pl.po: the Polish of the new texts.
2026-11-23 18:48:19 +01:00
maj00r 6e8383df6f feat(editor): the grade line of a line of the model drawn in the profile tool, its command
Continues E4b (editor-tracks-domain.md §8, "Zmień załom lub Rv niwelety"): with the editing on the model on, the profile tool opened on a
track of a line of the model is the profile of the whole line, its points the breaks of the grade line as the model has them with their
vertical radii, the heights of the ends its nodes'.

- Applied, the points between the ends are set_grades of the line (chainages along it, the route run along it or against it), a break
  with no radius given the one the line needs; the model is the judge of it, before the checks of the profile tool: refused, nothing
  changes and the profile tells why in red; kept, one step, the tracks made anew, the profile read again from the model, what the norms
  warn of under it. The heights of the ends aren't changed here: a line of the model keeps the heights of its nodes.

Self-test: modelgrade <track> <m> <height> <vertical radius> (a break put into the grade line of the profile opened on the line, applied),
expect modelgrades <line> <count>. The case m_10_grade_curves (a break 1 m up taken back and brought again; one too near the end to be
rounded refused, nothing changed).

lang/editor_pl.po: the Polish of the new text.
2026-11-23 18:48:19 +01:00
maj00r 6c2d467c5a feat(editor): the switches of the switch tool on the lines of the model its turnouts, inserted, moved, changed and taken out by its commands
Continues E4a (editor-tracks-domain.md §7, §8; stage E4b): with the editing on the model on, a switch dragged on a track of a line of
the model is a turnout of the catalogue of the model, and so on, each a command, refused with the reasons or one step of the history.
The switches of the old tracks are laid the old way.

- The drag of the switch tool, let go on a line of the model (on a straight or along a curve), is insert_turnout: the type of the
  catalogue the template is of (a template of the user's own isn't), its start where it was pressed, its chainage on the line
  (layout::chainage_of), the side of the drag its hand, the way it was dragged its direction. While it's dragged the panel tells in its
  red line why the model would refuse it, tried on a copy; let go, a refusal is told there with the value, the limit and the paragraph
  ("(9.6 pkt 16)"), nothing changed. Laid: its switch track made by the generator (t<n>), selected, the panel placed, its speed told.
- A turnout of the model selected: the inspector shows its type, side, speeds and bending, the templates of its kind of the catalogue
  (change_turnout), the other side (change_turnout of the hand), moved by a distance (move_turnout), taken out (remove_turnout). The
  slide of the switch tool moves it, another template changes it, Del takes it out (after the scenarios are looked through), each a
  command. Plan on a track of a turnout doesn't open: the turnout is edited through itself.
- A crossover dragged between two lines of the model is connect_tracks of the solver of the connections; refused, the solver's best
  proposal is told with the reasons ("Proposal: Rz 60E1-300-1:9 needs them 4.498 m apart").
- The tracks after a command: of a turnout one of whose tracks changed, its tracks of the simulator made again whole, kept by its main
  track (kind switch, the plain tracks of a double switch, a slip or a crossing with them); written with the scenery as the generator
  made them, recorded in the project with their kind and the file each went into (session::record_written of pieces of several files),
  found again when the map is opened, nothing taken for changed by hand. project::session::generate(turnout_id).

Self-test: modelturnoutside <track>; expect modelproposal <holds|lacks> <text>, expect handlines <count>; expect modelends checks the
paths of the switch tracks at the numbers of the nodes; a crossover of the connection command between two lines of the model goes to
the solver of the model. The cases m_8_turnout (a turnout dragged on, taken back and brought again, moved, given another type and side,
taken out by Del; one 2 m off the end of a cant ramp refused, nothing changed; saved and found after a reopen) and m_9_crossover (a
crossover between lines 4.75 m apart, one between lines 4 m apart refused with the proposal).

Tests: U: the chainage of a point on a line and its distance; the switch track of a turnout made by the session, the tracks of a line
written into two files recorded.

lang/editor_pl.po: the Polish of the new texts.
2026-11-23 18:48:19 +01:00
maj00r c0e6a70f5f test(editor): the recognition of old tracks measured on sceneries of the game, read only, skipped unless asked for
editor-tracks-tests.md §4 "E6", the measure: tests/unit/test_takeover_measure.cpp, a case skipped by default (it needs the data of the game,
so it isn't a test of the build), run as
  EU07_TAKEOVER_MEASURE="<scenery folder>;<file>;..." eu07_unit_tests --no-skip --test-case="takeover measure*"
It reads the tracks of each file with its includes, takes all the plain ones over in a plan (nothing laid, nothing written) and prints the
lines made, how far they keep off their old tracks in the plan, the height and the cant, how many would be taken over with no question and
why the others ask it, what the domain lays otherwise (kinks, compound curves, cants with no transition), the worst lines;
EU07_TAKEOVER_TRACK=<name> prints the curves found and the vertices of the line of a track.

Measured on the game data, read only (baltyk/baltyk_torowisko.scm, l02/l02_tory.scm, linia61/l61_tory.scm, lk197/lk197_tory_uniwersalne.scm,
drawinowo/tory.scm, calkowo_v2/v2_tory.scm): 31 411 tracks (2 111 switches), 3 594 lines of 30 297 tracks, 1 477 km, 2 chains not laid,
8 minutes. With no question 3 112 lines (87 %) but 591 km (40 %): the short tracks of the stations fit within 5 mm, the long lines drawn by
hand ask. The farthest in the plan: up to 5 mm 2 890 lines, 10 mm 195, 20 mm 113, 50 mm 134, 100 mm 97, 500 mm 99, more 66 (bulging
Bezier curves, compound curves of stations, a few tracks of no sense). The question for 482: the plan 297, the height 74 (buffer stops of
tracks climbing a metre), the cant 12, more than one 99.
2026-11-23 16:59:29 +01:00
maj00r 10d3da2164 feat(editor): an old scenery read with no scene, its lineside objects anchored to the lines with a confidence, the anchors in the project file
The rest of E6a (editor-tracks-domain.md §2 "Kotwica", §3 "Otoczenie", §9, §10 "Powiązania otoczenia ... z oceną pewności; wątpliwe
pokazane do przejrzenia; przewody wiązane ze słupami").

- editor/project/legacyScenery: the tracks of the railway (normal and switch) and the lineside objects (models, wires, memory cells, event
  launchers) of a scenery read from the text of its files with their includes, as the simulator places them: the tracks and the wires
  moved by the origin only, the rest by the origin, the rotation and the scale (sceneryText now tells the placement in effect at each
  statement). The tracks naming an object: a memory cell's own, and those whose events (event0 to eventall2 of their entries, the events
  <track>:eventN) act on it, multiple events followed four deep. The kind of an object by its file and name, as the binding of the editor
  tells it (infra::classify).
- editor/layout/layoutAnchors: an anchor puts an object along a line: its chainage, the offset to the left of the line (below 0 to the
  right), the height above it, its turn against the heading there; a wire by its four points, bound to the poles its ends hang on (a pole,
  or a model the names take for a part of the catenary, within 8 m of each end, along the same line). infer_anchors() anchors every
  object within 30 m of a line to the nearest one, with a confidence from 0 to 1 and the reasons for it: named by a track of a line, 0.95
  at least (0.85 where another line is nearer, half of the fit where the line named isn't near); else how its distance fits its kind (a signal 0 to 6 m, a
  sign or a pole 1.5 to 8 m, a wire 0 to 1.5 m, equipment 0 to 3 m, logic and the rest 0 to 15 m, the environment at half), a third past
  the end of a line or 15 m above or below it, half where another line is as near within a metre, 0.8 for a sign, a signal or a pole turned
  more than 10 degree off square to the track; a wire on poles at both ends 0.9 at least, on none 0.7 of what it had. Below 0.6 doubtful,
  to be looked over. place() puts the object where it stands along its line now; follow() after a change of the network: an anchor whose
  line is there keeps its chainage, one whose line is gone (cut, joined, taken by a turnout) is anchored again where it stood, to the line
  there now; the anchors whose objects move, with where to. Moving the nodes of the scene, and taking the anchors back with an undo, is
  the editor's.
- take_over_tracks() given the objects of the scenery anchors them to the lines it laid, the old tracks naming them by the lines they
  became, and lists the doubtful ones, with the deviations, for the question.
- The project file: the anchors section, reserved and empty in version 1 so far, holds the anchors: "anchor <id> <kind> <name> <key>
  group <n> at <x y z> yaw <deg> line <id> chainage <m> offset <m> height <m> turn <deg> confidence <c> points <n> ... poles <n> ...
  [why <reasons>]". The schema stays 1: it's unreleased and the section was empty.
- The //$b bindings of the old editor (the same mechanism along the paths of the tracks) aren't made anchors yet.

Tests: G: data/takeover/old.scn, written by make_old.py (a line of 26 tracks with a curve of R 500 m, clothoids of 60 m and 80 mm, a break
of the grade with no vertical curve, tracks of no name and written backwards, events and an isolated circuit; a switch at its end and a
line on from each of its legs; a signal named by the events of a track and its memory cell, a pole every 50 m and the wires between them,
hectometre posts, a tree 25 m off, a cabinet between two lines): read with no scene; its plain tracks taken over as three lines with no
question, R 500 m, the clothoids and the cant read back within 1 and 5 %, the lines held at the legs of the switch in its headings, one
step undone and done again the same; the tracks made again ending at the old joints, each old name once, the events and the circuit on
their pieces, also after the curve was made 20 m wider; written into the project file and read back. The signal and its memory cell
anchored with 0.9 or more, the poles with 1, every wire bound to its two poles, the tree and the cabinet doubtful; the curve made wider: the
objects along it follow at their chainages and offsets, the signal on the straight before it stays; the anchors written into the project
file and read back. The case of the project file which kept the section of the anchors as text reads and writes two anchors now. Unit
tests 1104 -> 1108.
2026-11-23 16:59:29 +01:00
maj00r 5b83a5c1bc feat(editor): the old tracks of a scenery chained and taken over as lines by one command of the model, the norms told, not refusing
E6 (editor-tracks-domain.md §10): a set of old tracks made lines of the domain in one step to undo (editor/layout/layoutLegacy and the
command take_over). Model only: the question with a preview before and after is the editor's, after E4a.

- legacy_track: an old track as its entry has it, in the world, with no scene: its name, its paths, the words before and after them.
  walk_chains(): the plain tracks of the set chained the way a train runs them (the chain walking of the old digitization, kept): a track
  joined at an end to exactly one other plain track of the set, within the 2 cm the simulator joins them within, goes on into it; a
  switch, a track not taken over, a fork or a free end ends the chain, held in the heading of the main path of the switch or of the track
  holding it, which the line runs on from. Each chain runs from its end the smaller in x, then in z, whichever track it was found from.
- plan_takeover(): each chain recognized (layoutRecognition), its held ends kept, the old tracks along it as its hard splits (a track named
  none of no name), the class of its line of the highest speed of its tracks; the deviation of each line and the worst of all; silent where
  each line keeps within the tolerance. Nothing is laid.
- take_over, a command of the model: the lines between new nodes at the ends of their old tracks, their vertices, grade lines and old
  tracks as recognized. The invariants refuse it as they refuse any command; the norms don't: the BLOCK limits the old tracks pass are told
  in outcome::broken (an old track may break the norms where nobody touched it, improving it is a separate decision; edits of the lines
  after it are judged by edit_policy::no_new_block). take_over_tracks() executes it and returns the deviation of each line and whether
  the takeover is silent, for the question.
- A switch stays an old track, a fixed constraint: the lines end at its legs in its headings. Its type recognized in the catalogue and the
  switch laid into the line as a turnout, so the line runs on through it, is left for later.

Tests: U: the line of three curves cut into old tracks, each written the way it was: the tracks in three random orders, seeds 4401, 5502 and
6603, the walk starting from another one of them each time: the same line, its vertices to 1e-6 m and its radii and transitions to 1e-9,
the same old tracks at the same chainages. Unit tests 1103 -> 1104.
2026-11-23 16:59:28 +01:00
maj00r d87da1c476 feat(editor): the joints of old tracks as hard points of the pieces, the names, events and circuits of the old tracks kept by the lines
E6 (editor-tracks-domain.md §5 "Podział na kawałki zachowuje miejsca...", §10 "Stare złącza jako twarde punkty podziału"), the hook of the
generator E2a left (generator_options::hard_splits, a line given any refused).

- A line keeps the old tracks it was taken over from (line::hard_splits): where along it the stretch of each begins, its name, the words of
  its entry before the path (the width, the friction, ... the visibility and the materials) and after it (the speed, the events, the
  isolated circuits and the rest), whether it ran against the line. In the line rather than in the options of the generator, so a command
  which cuts or joins lines carries them and an undo puts them back: a line cut (split_line, a turnout laid into it) gives those past the
  cut to the part after it, and the old track cut in two keeps its name and its events on the part it ran into first, the other part a
  stretch of it the generator names (continued); two lines joined, the second one's after the first one's.
- The generator ends the pieces at each joint inside the line (a joint stays, a break of the elements next to it gives way) and writes the
  pieces of a stretch as the old track was: its name on the piece it ran into first with all its attributes, <name>_2, <name>_3... on the
  others with them but its events (an event of a track is called once), its surface, the path written the way it ran (event1 and event2,
  the sign of the rolls); an old track of no name named by the generator, its events kept. A line with none is made as before.
- The project file: "old <chainage> <name> reversed <0|1> continued <0|1> surface <words> attributes <words>" in the block of a line;
  version 1, unreleased, read as before without them.

Tests: G: a line of three curves given three old tracks (one named with its events and its circuit, one of no name, one which ran against
the line): the pieces end at the joints, each name once, the attributes of the first on its first piece and without its event on the
others, the event of the unnamed one once, the one which ran against the line written from the end of the line; written into the project
file and read back the same. It takes the place of the E2a case of the hook refusing. Unit tests 1103 -> 1103.
2026-11-23 16:59:27 +01:00
maj00r 3f5f2af1ce feat(editor): the old tracks recognized as lines of the domain: the curves read off the curvature, fitted by least squares, the deviation measured
The first part of E6 (editor-tracks-domain.md §10 "Automatyczne przejęcie odcinka", editor-tracks-tests.md §4 "E6"): a chain of the
paths of an old scenery, Bezier curves drawn by hand or by older tools, made a line of the domain (editor/layout/layoutRecognition).
Model only, nothing of the editor asks it yet.

- The chain sampled along its arc length in the plan, every metre for the fit and every half metre for the deviation, each joint with
  the turn of the heading there: the point, the heading and the curvature of the Bezier curve as the simulator draws it, the cant of the
  roll turned evenly with the parameter as the simulator turns it (1500 mm sin roll, of the other sign where a path runs against the
  chain).
- The curves found where the curvature changes: the heading differenced over 30 m (the noise of the ends of the old paths, written to the
  millimetre, and the ripple of the Bezier curves evened out), runs of one sign past 1/5000 m; a run whose curvature falls to a third of
  what it is on both sides cut in two; the arc of each where the curvature is half of it or more (the area over that width is the turn),
  its transitions where it rises from a tenth to nine tenths, the window taken off; a turn of more than a quarter of a circle laid as
  curves of a quarter at most. A turn of more than 5 mrad at one joint making up a curve is a kink (told, laid as the shortest curve
  which fits); an arc whose halves differ by a quarter is a compound curve (told, laid as one).
- Each curve a vertex of the domain, clothoid - arc - clothoid, its point where the straights fitted around it cross; then the points,
  the radii and the transitions of all of them fitted by least squares to the offsets of the points of the chain from the line the domain
  lays (Levenberg-Marquardt, the Jacobian by differences over the points each parameter moves; the transitions by their squares, since
  what a transition moves the curve by grows with its square; the points and the radii first, then all of it). An end held by what stays
  beyond it (a switch, an old track not taken over) keeps the first or the last vertex on its heading. The curves the curvature doesn't
  show (a radius over 5 km, a turn spread over the joints) are added where the line keeps off the points by the tolerance, six at most;
  the small turns of old tracks laid jagged, joint by joint, are left out where the line keeps nearer without them; where it keeps more
  than a metre off, the plan of the added curves alone is tried; a vertex whose tangents cross behind the curve tells nothing of it, and
  a vertex no radius lays is taken out.
- The cant of each vertex fitted to the rolls along its arc and its transitions; a cant the rolls ramp up with no transition under it is
  fitted again with transitions as long as the ramps, kept where the line keeps nearer so. The grade line: the heights as straight grades
  within 1 cm (Douglas and Peucker), the heights of the breaks by least squares, each vertical curve the largest of the usual radii which
  keeps within it.
- The deviation measured densely: each point of the chain every half metre set square onto the line, the farthest and the root mean
  square of the distance in the plan, of the height and of the cant, where the farthest is. The tolerance of a takeover with no question
  (takeover_tolerance): 20 mm in the plan and in the height, as the simulator itself joins the ends of the tracks within 2 cm, so the
  tracks made again lie where the simulator takes the old ones to be; 10 mm of the cant, 0.4 degree of the roll, under the half degree
  many old files round the rolls to. The norms aren't asked here.

Tests: U: three curves (R 800 m with clothoids of 80 m and 60 mm, R 600 m with 60 and 70 m and 90 mm, R 1500 m with none) and a grade line
with two breaks, cut at random places 8 to 25 m apart, each piece a Bezier curve, the joints shaken by up to 4 mm across and in height,
the rolls rounded to the tenth of a degree, seeds 1101, 2202 and 3303: the radii within 1 %, the transitions within 3 m or moving the arc
within 5 mm of where the laid ones move it, the cants within 3 mm, the deviation within the tolerance; the same walked the other way
round, the transitions swapped. A kink of 0.6 degree at a joint told and laid within the tolerance; an arc of 11 km found where the
curvature shows none; an end held in a heading 2 mrad off the chain kept to 1e-9 rad. Unit tests 1101 -> 1103.
2026-11-23 16:59:26 +01:00
maj00r 00f5dbb98a feat(editor): the scenarios naming a track looked through before it goes, the index of the map built in the background and kept
The last part of E4a (editor-tracks-domain.md §0 pkt 7; §8, deleting a line): with the editing on the model on, a track a scenario of
the map names goes, or is renamed, only when the user says so.

- editor/project/scenarioIndexCache: the scenario index of E3 built on a thread of its own as the map is opened, and kept: in memory,
  and in a file of the cache of the user between the sessions (scenario_index/<map>.txt; not for the self-tests), for as long as the
  *.scn files of the folder are the ones it was built of (their names, sizes and times); on a big map it takes minutes, once. The
  editor doesn't wait for it to close. users_of() tells the scenarios naming the tracks, with what names them and where.
- Del on an old track with a name, on a set of them, or on a track of a line of the model (its line goes), the route design applied
  to old tracks, and a track renamed in the inspector (editor_mode::track_rename) wait for the index ("Checking the scenarios":
  cancel, or go on without checking), then go at once where no scenario names the tracks, or ask: "Track used by 2 scenarios", each
  scenario with the trainsets, events and the rest naming the track, the file and the line; delete (rename) anyway, or cancel and
  nothing changes.
- The self-tests: the scenarios of the map of the fixture, tests/editor/scenery/autotest_editor.<part>.scn, copied by run.py next to
  the copy of the fixture as autotest_editor_<case>_<part>.scn, naming that copy (autotest_editor.uses.scn: a trainset on s1, an event
  on d2). The index of the fixture's map over the scenarios of the game's folder takes about 80 s.

Tests: U: the index written and read back with its fingerprint, other versions refused; the users of a track by its name as the
simulator compares it; built once in the background, given again for the scenarios as they are, built again when one changed, read
from the file of the cache in the next session, built for another map. Self-test: modelwait, modelrename, expect question
<waiting|scenarios> [n]; the case m_5_index_delete (Del on s1 asks: cancelled it stays, confirmed it goes; d2 renamed the same; a3 and
a line of the model go at once); m_6 and m_7 wait for the index.

lang/editor_pl.po: the Polish of the new texts.
2026-11-23 15:58:30 +01:00
maj00r 1a0535ae25 feat(editor): the curves of a line of the model changed in the route design as its commands, refused with the reasons; split, join, delete
Continues E4a (editor-tracks-domain.md §4 "Edycja = polecenie", §8): a line of the model is edited through its commands, each kept
whole or refused with the reasons, one step of the history.

- The route design opened on a track of a line of the model shows the line as the model has it, its curves with their radii,
  transitions and cants. The preview is the route design's as before; applied, each change is a command of the model: a vertex moved
  (move_vertex), its radius, transitions or cant typed (set_vertex). A command refused changes nothing and the panel tells why, with
  the value, the limit and the paragraph ("cant 200, the limit 150 (ST-T1-A6 tab. 9.6)"); one kept is laid, one step, and what the
  norms warn of, or would prefer, is the quality line of the panel. Curves added or taken out aren't applied to a line of the model yet.
- Under the line in the panel: split it at a distance from its start, join its free end to the free end of the nearest other line of
  the model (a new line solved between them), delete it; Del on one of its tracks deletes the line too.
- A command which lays anew, or takes away, a line whose tracks were changed by hand (found so in the files when the map was opened,
  or changed in the editor by the other tools since the model made them) asks first, in a window naming the line: keep the change by
  hand, and nothing is done; or overwrite it, the line laid anew and no longer taken for changed by hand.

Self-test: modelplan <track>, routeradius|routecant <vertex> <value>, routemove, modelsplit, modeljoin, modeldelete, modelselect,
modeldel, modelanswer <yes|no>, modelmark; expect modelrefused, modelmessage, modelvertex, modelsame, question. The cases
m_2_plan_refusal (a cant of 200 mm refused with its reason, nothing changed; a wider curve laid in one step), m_3_model_undo (a command
taken back and brought again with its tracks, a split taken back, the project saved after an undo read back as it was),
m_4_hand_change (a track's speed changed in the inspector: kept, nothing changes; overwritten, laid anew; a change by hand saved found
after a reopen), m_6_split_join (two lines joined, the new one split and deleted, each a step).

lang/editor_pl.po: the Polish of the new texts.
2026-11-23 15:58:30 +01:00
maj00r 693779461b feat(editor): a line laid in the straights, or the route design applied to old tracks, a line of the model, its tracks the generator's
Continues E4a (editor-tracks-domain.md §3, the generator as the layer between the domain and the simulator; §4, §10): with the editing
on the model on, the lines laid in the editor are lines of the model and their tracks its tracks; the old tracks stay as they are, the
old tools edit them.

- The lay tool in the straights: Enter lays the line its preview shows as a create_line command of the model, its vertices where the
  preview has them with their radii, transitions and cants, an even grade from end to end (the grade line through the model is E4b),
  the speed designed for as the class of the line. Refused, the panel tells why with the value, the limit and the paragraph, nothing
  is laid and the points are kept to be put right; kept, the generator makes its tracks, named after the line and its elements
  (l1_s11, l1_v1a1...), of the style of the track it goes on from or the lay tool's, one step of the history; what the norms warn of
  is told under it. A curve traced, a curve going on from the curve of a free end, a compound curve or one with cant ramps of its own
  are laid the old way, told why.
- The route design applied to old tracks makes them a line of the model in their place, one step: not through switches, nor tracks
  with events or in isolated circuits (their events would be lost until E6), nor a line with a grade line of its own; those are laid
  the old way, told why.
- A track the model made is marked as its line's: the inspector shows "Line L1 (managed)". Ctrl+Z takes the command back with its
  tracks, Ctrl+Y brings it again: the editor's step keeps the token of the model's step (EditorSnapshot::model_token).
- editor_track::load_entry: a track of the entry the generator wrote, its numbers as written.

Self-test: a track named @<line>.<index>, modeltracks, expect managed, expect modelends (the tracks of each line from end to end at the
numbers of its nodes and at each other, to the bit), expect hand. The cases m_0_setting_off (the setting off: no project, old tracks),
m_1_lay_managed (a line laid is a line of the model, the project file written next to the copy of the scenery, the ends to the bit
before and after a reopen, nothing changed by hand), m_7_plan_converts (the route design applied to a1..a3 makes them a line, Ctrl+Z
brings them back).

lang/editor_pl.po: the Polish of the new texts.
2026-11-23 15:58:30 +01:00
maj00r a7a641944f feat(editor): the project of the map opened with the scenery and written with it, behind a setting of the editing on the model
The first part of E4a (editor-tracks-domain.md §3, §9, §14): the domain model of E2 and the project file of E3 brought into the
running editor, behind a setting, "Editing on the model (trial)" in the settings of the editor, off by default. Off, nothing of it
runs and the editor is as it was.

- editor/project/projectSession: the project of the map open in the editor, no scene. open() reads the project file of the map, or
  makes it of the //$ lines the first time (open_project of E3), and compares the tracks the generator wrote with the files as they
  are now: a track changed or gone outside the editor marks its line changed by hand. trial() tries a command on a copy of the network
  and tells the lines it lays anew or takes away (differences()), nothing changed; execute() carries it out, the lines of Overwrite
  no longer taken for changed by hand with it. A command kept is a step of the model's history with a token, which the editor's step of
  it takes back and brings again (undo(Token), redo(Token)): only the latest step kept, or taken back, can be, so the two histories
  can't go out of step; the marks of a change by hand go with the step. record_written() records the tracks of a line as the scenery
  save wrote them, save() writes the project with the network as it is, the records of the lines gone taken out.
- The setting on, the project of the map (the file of the scenery opened, <map>.eu07proj next to it) is opened with the scenery and
  written with it. The scenery save asks for the text of each track it writes (scene::node_layers::path_writer): a track the generator
  made, as long as nothing else changed it, is written as the generator made it (the numbers in the shortest form which reads back to
  the same double, not the 15 digits of the export), and its checksum recorded; one changed by the other tools is written by its own
  export and its line marked changed by hand. The tracks of the lines of the project are found in the scene by their names, with the
  text the file has for each (scene::node_layers::source() tells the file and the placement of a node).

Tests: U: a map opened gets its project file; a command refused, tried or carried out, changes nothing and isn't a step; a command
tried changes nothing, carried out tells its lines (new, split, a curve changed, deleted); the steps taken back and brought again by
their tokens in the order of the history, another token refused, a command after an undo dropping the step taken back, the
identifiers not given again; the tracks of two lines written and recorded, a reopen finding nothing changed and the line the same to
the bit as the model laid it, a speed edited in the file marking its line alone, deleting it writing over it too, the mark taken off by
a command writing over it and back with its undo, the records of a line deleted gone with it at the save.

Self-test: modelediting <0|1> (the setting for the run, not kept), expect modellines, expect projectfile <present|absent|lines n>.

lang/editor_pl.po: the Polish of the new texts.
2026-11-23 15:58:30 +01:00
maj00r 84dca7cccb feat(editor): the //$r switches of an old scenery on the lines of its alignments made turnouts of its project
E5, what E3 left (editor-tracks-domain.md §9 "Migracja"): the //$r records were kept in the project file as a block a file; the switches
among them which the domain can lay now become its turnouts when the map is first opened.

- A switch or a double switch of the editor becomes a turnout where its record names a type of the catalogue (its type, rail, radius, ratio
  and a, b of an ordinary or a symmetric one; the first of the catalogue's order where a movable nose is the only difference, which the
  record doesn't keep), its start lies on a line made of an alignment within a centimetre and its direction along the line or against it,
  and its main track is bent as the record says the line is there (straight, or the radius within 5 %). It's laid into the line by the
  command insert_turnout, the hand of the record, with edit_policy::no_new_block: the old line may break the norms where nobody touched
  it, the turnout may add no BLOCK finding to it.
- Its record goes on its own into the project with the main track of the turnout (as an //$h record keeps the line it became); the rest of
  the block stays as written, the comments with it, why each switch didn't become a turnout with it: a slip or a crossing (their records
  don't tell the side of the crossing track), a connection (the solver of the connections lays it anew), a lifted outer track, no type of
  the catalogue, no line under it, a bending other than the line's, or the reasons the command refused it for. A block none of whose
  switches became one is kept as before, with the reasons.

Tests: U: an alignment of data/records with five //$r lines: two switches on its straight, along it and against it, to the left and to
the right, made turnouts of their types at their starts (the structure whole, no reason); one beside the line, one of no type of the
catalogue and a connection kept in the block with the comment, each with why; the two records each with the main track of its turnout;
the project written and read back the same. The records of data/records and of the map of data/project/migration (no switch on a line)
kept whole as before. Unit tests 1096 -> 1097.
2026-11-23 14:49:35 +01:00
maj00r efcc28b0ed feat(editor): the solver of the connections of the tracks: a crossover between two lines, the norms of the straight and the spacing
E5 (editor-tracks-domain.md §7 "Połącz tory", §8 "Połącz dwa końce ... odmowa ... z najlepszą propozycją"): editor/layout/layoutConnection
plans a crossover between two lines running alongside, straight or curved, and the command connect_tracks lays it, one step to undo.

- The first turnout where it's asked for, toward the other line; the second one on the other line running back, its diverging track facing
  the first one's, where the line between their ends turns by as much at both of them: on one straight between straights alongside (the
  headings of the ends within 1e-13 rad), one curve between curved lines. Found by the secant along the other line, each try the turnout
  laid in a copy of the network, so it's put as the command will put it.
- The spacing of the lines measured along the whole crossover, a point every metre, not where it starts; the least of it against the
  least spacing of the type: of ST-T1-A6 tab. 11.2 where the catalogue gives it, or what its geometry needs with the least straight
  between its turnouts (crossover_spacing()), the larger.
- The least straight between the turnouts from the norms: a new parameter of the E1 module, switch_straight, at the speed through them:
  max(0.15 V; 6) m in the running and the main tracks (11.3 pkt 7d, WARN), 30 m on a line of 160 km/h or more (pkt 7e, BLOCK; the new
  feature fast_line), 6 m recommended in the side tracks (pkt 7c). The solver asks for the normal limit.
- Where they can't be met: refused with the reasons and the best which fits the spacing measured, a type of the catalogue of the rail of
  the one asked for before the others, the fastest; or that none fits, and the spacing the type asked for needs.
- The line between the turnouts runs at the speed of their diverging tracks and is a part of the connection of the tracks for the norms
  (the feature switch_track of its class, which describe_chain() puts on its elements): an arc with no transitions nor cant where it isn't a
  straight, and the steps of the cant deficiency and the elements between them judged as in the tracks of turnouts (tab. 9.15, 9.16).

Tests: U: crossovers of Rz 60E1-500-1:12 between straights 4.75 m apart, both ways to both sides: the spacing 4.75 m all along, the
straight between the ends (4.75 m less twice the offset of an end) / sin(1:12), the norms' 9 m at 60 km/h, the ends facing each other on
one straight, one step to undo; a line closing in on the other refused for its spacing along the crossover though wide enough at its
start; 0.15 m short of the spacing for the 9 m straight refused with "11.3 pkt 7" and a type proposed, which then is laid; 30 m on a
line of 160 km/h; Rz 60E1-760-1:14 refused at 4.74 m by tab. 11.2 though its geometry fits; between two curves of R 1200 and 1195.5 m
4.5 m apart (4.50086 to 4.50087 m along it), both turnouts bent, one curve turning by 0.6 degree between their ends; a slip, a line to
itself, a line across and a type of none refused; the rows of switch_straight. Unit tests 1089 -> 1096.
2026-11-23 14:49:35 +01:00
maj00r bed4898ca6 feat(editor): the bending of the turnouts exact: table 11.8 for the whole diverging track, the main track on a transition as it is
E5 (editor-tracks-domain.md §4 "Rozjazd", §7 "Na łuku — łukowanie z dokładnym wzorem (tab. 11.8)"), what E2b left: table 11.8 for the curve
of the basic switch only, the rest of the diverging track bent with the main track by the sum of the curvatures, a main track on a transition
taken at its mean curvature, the sign of the curvature of the diverging track judged from headings sampled every half metre.

- Table 11.8 written for the curvatures, r" = (R r -+ t^2) / (R +- r) as k" = (k + K) / (1 - k K t^2) with the tangent t of the basic switch,
  bends every curve of the diverging track and the ends of its transitions, each as long as keeps its turn off the main track (the angle of
  the frog); the curve of the basic switch keeps switch_curve::bent_radius(), the same numbers as before; a straight goes with the main
  track as before (the formula gives K for k = 0). On a straight nothing changes.
- The frame of a turnout knows its main track: where its curvature changes under the turnout (a transition curve, or the end of one) the
  diverging track is laid in steps of 2 m at most, each one's curvature at its ends by the table with the curvature of the main track at the
  station it runs by (along the main track, its heading off the main one taken in), the turn of each part kept; the straights and the lead
  with the main track step by step too.
- The curvature of a diverging track of one sign all along it, from its elements (9.7 pkt 12, 11.4 pkt 6): a BLOCK rule of the turnout in
  place of the sampled check of switch_curve (KZW II), which a short straight through the frog going the other way could slip through.

Tests: U: a diverging track of a curve of 800 m, the curve of the basic switch of 500 m and a transition off it, bent with main tracks of
1200 m both ways and of 3000 m: each by the table with the tangent of the basic switch, the basic one the same as bent_radius(), each turning
off as far as in the basic switch, on a straight to the bit as it was; Rz 60E1-500-1:12 60 m into a transition of 200 m to R 1200 m: laid in
steps, its curvature at the start by the table with the main track's there, growing along it, the frog against the main track where it ends
beside it at 1:12.0004 (1:11.9966 by the mean curvature, the end 27 mm apart), moved and back the same; Rz 60E1-190-1:9 bent two-sided
refused, its curve turning off to its side and the straight through its frog the other way (KZW II), one-sided not. Unit tests 1086 -> 1089.
2026-11-23 14:49:35 +01:00
maj00r ca1f2239df feat(editor): the double, symmetric and secant switches, the slips and the crossings of the catalogue in the domain model
E5 (editor-tracks-domain.md §4 "Rozjazd", §7): every type of the catalogue is a turnout the model lays, its tracks lines it owns and its
legs nodes, kept whole or refused like the ordinary switches E2b laid. E2b refused the rest with "stage E5".

- Secant blades (S42): the diverging track runs along the main one for the pre-blade stretch and turns off it by the angle of the blades
  at their tips, the rest of 1:n on its arc; a turn inside the track, the node at the start keeping the heading of the main track. The
  generator ends a piece there with the heading of the element before it (unchanged where a line runs on in its heading).
- Double switches (Rpd, Rpj, Rps): the main track cut at the start of the second switch, its node holding the main track, the main track
  of the second switch (main2) and its diverging track, to the other side or the same one, as switch_design::build() lays it. Written as
  the switch tool writes them: the first switch, a plain track of a metre before the second one (the simulation joins a switch to plain
  tracks only), the second switch.
- Symmetric switches (Rls): both tracks turning off by half of the angle, to both sides, laid at a free end of a line, which they end (the
  line beyond it would have to turn at the node); not moved along the line.
- Slips (Rkp, Rkpd) and diamond crossings (Skrz): the main track a part of the line, the crossing track across its middle at the angle of
  the slip between two nodes of its own, the slip curves from the start to the end of the crossing track and, of a double slip, from its
  start to the end of the main track; slip_of() lays the curves with the blades of the ordinary switch of the rail, radius and angle (no
  data of the slips' own blades was found), passing the crossing as near as the rails of the simulator's profile let them. The three with
  the blades outside of the diamond whose curves then reach past the half length of Id-4 (49E1 190-1:6,6, 300-1:9, 500-1:9, by up to 0.3 m)
  are laid as long as their curves. Written as the switch tool writes them: a switch at each leg a slip curve leaves, the tracks crossing
  and the middles of the slip curves plain tracks, the joints inside it the same numbers on both sides.
- The rules: a double switch, a slip, a crossing (11.4 pkt 4 a, b) and a symmetric switch (no rule of table 11.8 for it) lie on straights
  only; an invariant, refused with the reason before anything is laid. The norms judge the tracks crossing at a slip or a crossing as
  crossings (no cant, tab. 9.6), its slip curves as diverging tracks.
- The ends of the tracks of a turnout which carry no line through their node (the starts of the diverging tracks, the ends of the slip
  curves) are branch_end(); a node holds such an end beside a track of the same turnout on its side. settle() lays all the tracks a turnout
  lays itself (lay_tracks()), the nodes of its own where they end; lifting, moving, changing (to another kind too) and removing a turnout
  take all of them along.
- The project file: the turnout record gets "second <node> <main2> <diverging2> <node>" and "crossing <line> <node> <node> slip <line>"
  where the turnout has them (diverging 0 0 for a crossing); version 1, unreleased, read as before without them. The generated section
  keeps each track a turnout is made of.
- TSI INF 4.2.3.4(1), 150 m at least, judges the plain line, not the curves of switches (4.2.5): its hard row leaves out the tracks of the
  turnouts, so the industrial S42 switches of R 70 and 140 m are laid.

Tests: U: every type of the catalogue laid (41 ordinary, 3 symmetric, 15 double, 18 slips, 20 crossings) on a straight to both sides
along the line and against it, its legs where the catalogue puts them (the main track a + b, 1:n at the ends, the second switch at the
stagger, the crossing track at the angle of the slip, half its length from the crossing), moved and taken out, the line one again, each a
step to undo; the turn of the secant blades of S42-190-1:7 at the end of the pre-blade stretch; a double switch, two slips and a crossing
refused in a curve, a secant S42 bent in a side track, a symmetric switch refused at the end of a curve. The three fitted to the tangents
of S42-140-1:6,6 16/12 measured are refused by the norms (tab. 9.14) where the transition one is. P: 200 random edits with every type along
arcs and transitions, seeds 5150, 2718 and 1618: the invariants after each, a refusal changing nothing, undone back to the start exactly.
G: every type made into the tracks of the simulator and read back by TTrack::Load, the ends of the paths at the legs or at each other to
the bit, the velocity and the frog; a double switch, a double slip and a crossing written to the project file and read back, their tracks
laid again the same to the bit. The E2b case of the types refused now checks that they're laid. Unit tests 1077 -> 1086.
2026-11-23 14:49:35 +01:00
maj00r e9f8b6a059 feat(editor): the catalogue of the turnouts a data file, the switch tool and the domain model reading it
The first part of E5 (editor-tracks-domain.md §7, "Katalog jako dane"): the types the editor lays its switches from were a table in
switch_design::catalogue() and two in editor_track::standard_switch_templates(); now they are editor/data/turnouts.txt, one type a
line, built into the executable as its text (CMakeLists.txt writes it out as editor_turnouts_txt.inc, as it does the icons), so the
game data doesn't need it, and read once when first needed.

- The format, which the templates of the user (eu07_switch_templates.txt) share: switch <name> <key> <value>... source <the rest>.
  A type of the catalogue gives its geometry as the instruction does (type, rail, radius, ratio, a, b, diverging, the blades tangent or
  secant, the cut tip of the blade; stagger and the keys of the second switch of a double one; middle and the half length of a slip;
  fit for the three fitted to measured tangents), the parts made of it as before; a template of the user gives its parts. What §7 asks
  besides the geometry, - where the source has nothing: the frog (fixed or movable), the locks (Id-4 tab. 14-3), the drive, the speed of
  the diverging track (ST-T1-A6 tab. 11.2), the bending (tab. 11.9), the least spacing for a crossover (tab. 11.2) and the source of the
  values, unconfirmed ones said so: the cut tips of SKMd-4 (190, 300, 500, 1200 m; 760 m the editor's own), the secant blades of S42 at
  25' and the one fitted for S42-140-1:7, the a and b of 2500-1:26,5, the slips' blades (not found), the tip of a blade with no data by the
  rule sqrt(2R 0.005) - 0.125.
- read_designs() reads the format, a line which isn't one left out with why; catalogue() the switches as before, in the same order, slips()
  the slips and the crossings, catalogue_entries() all of them, read once (secant_blade() no longer builds the catalogue at each call).
- The slip curve and slip_of() moved from editor_track to switch_design, which the domain model lays its slips with (E5); editor_track
  keeps the names.
- A template of the user with a movable nose writes frog movable, which it lost before; without one the line is what the builds before
  wrote (they leave out a template with a key they don't know). The lines they wrote read as they did.

Tests: U: every switch of the data file the same to the bit as the catalogue of the code (kept in the test as it was), the slips and the
crossings as the switch tool had them; every line read, with its source; each switch against Id-4 and ST-T1-A6: R, 1:n, a, the main
track a + b, the pre-blade stretch, the blades (the tip lead + cut where the sheets give it, about sqrt(2R 0.005) - 0.125 where they
don't; secant at 25'), the speed of tab. 11.2, the bending of tab. 11.9, the spacing of tab. 11.2; the rule of the tip against the sheets
(190 m +3 mm, 300 m +105 mm, 500 m -56 mm, 1200 m +3 mm; the 4.5 mm rule +60, +143, -44, -49 mm); a template keeping its movable nose,
an old line read as before; lines left out with why. Unit tests 1070 -> 1077.
2026-11-23 14:49:35 +01:00