mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 21:07:06 +01:00
9f33045c2e315d3feb864ffe914bf51cc1bfcdb3
12 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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. |
||
|
|
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. |
||
|
|
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. |
||
|
|
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. |
||
|
|
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.
|
||
|
|
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. |
||
|
|
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.
|
||
|
|
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. |
||
|
|
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.
|
||
|
|
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.
|
||
|
|
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. |
||
|
|
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. |