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

5 Commits

Author SHA1 Message Date
maj00r dce6f9d11c feat(editor): the messages of the model of the track geometry and of its norms told in the language of the editor
The first part of E4b (editor-tracks-domain.md §8; E4a left the messages of the model in English): what the model refuses a command for,
and what the norms warn of, reach the user through the catalogue of the editor, the model staying as it is, English and pure.

- The editor layer formats them: a message of the model is matched against the forms it's made by (a BLOCK limit along a line, a finding
  of the norms with its value, limit and paragraph, a rule of a turnout, a line or a vertex which can't be laid, the solver of the
  connections and its proposal...), the form of the catalogue (STR) filled with its numbers and names, the parts which are messages
  of their own (the name of a parameter of the norms, what a line or a turnout is refused for) shown so in turn; a whole message the
  catalogue has, as it is. One with no form stays English.
- The editing on the model keeps both: what the model told, English, for the log and the self-tests, and what the user reads, in the
  route design, the lay tool and the panels of E4b. The window of the application is split off editormodemodel.cpp into
  editormodemodel.h, shared by the files of E4b.

Self-test: expect modelmessage holds or lacks the text in either of them, so the cases run in any language.

lang/editor_pl.po: the Polish of the forms and of the names of the parameters of the norms the editor hadn't yet.
2026-11-23 18:48:19 +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