mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 08:17:09 +01:00
c508f5eef1fbaaefce65fac5d7bfe4815d08985f
332 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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. |
||
|
|
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 |
||
|
|
e85f5fbed0 |
fix(editor): the assumptions of the project aren't lost with a project not saved, a texture field cleared is the lay tool's own again
- With the editing on the model, setup_store() took the //$u lines out of the scenery and left the assumptions to the project of the model, which is written after the scenery and may fail to be: then they were in neither. The scenery keeps the line as well; the project's is read first, as before. - A texture typed into the assumptions and cleared again left the lay tool with the one typed: empty is the tool's own. |
||
|
|
9016b3a951 | Merge feat/editor-model-turnouts-ui into feat/editor-project-setup | ||
|
|
44deb60a5a |
fix(editor): the plan preview follows a drag of the first or last vertex, "This path" lays beside the path alone, Esc clears the preview
- model_plan_preview() keyed on vertex.position, which a drag of the first or the last vertex of a line with two or more curves doesn't change (it moves vertex.offset along the tangent of the end): the green or red line and the text of the norms froze after the first frame, and the release could be refused where the preview showed it within the norms. The key has the offset now. - parallel_build() laid the whole line with model_parallel beside a managed line whatever the scope, so "This path" on a 50 m track of a 2 km line previewed 50 m and laid 2 km. The model's parallel line is laid for the scope of the whole line only. - Esc during a handle drag restored the design but left the preview of the model on screen. |
||
|
|
8b48cfddae |
Merge feat/editor-legacy-takeover into feat/editor-model-turnouts-ui
# Conflicts: # editor/project/projectSession.cpp |
||
|
|
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. |
||
|
|
fa06830c64 | Merge feat/editor-turnout-catalogue into feat/editor-model-in-editor | ||
|
|
da1ef628bf |
fix(editor): the lay panel says "Laid" only while the step it was laid with is on top of the history
lay_panel_state() told the line laid from laid_step == m_history.size(). Lay, Ctrl+Z, then any one-step edit made the size the same again, and the panel said "Laid … Ctrl+Z undoes" for a line that was gone; at the cap of 200 steps it stayed "laid" for good. The panel now compares the serial of the step on top of the history (EditorSnapshot::serial), which each step made has of its own. |
||
|
|
2217da8648 |
Merge ui/editor-consistency into ui/editor-lay-flow
# Conflicts: # application/editormodeselftestexpect.cpp |
||
|
|
1d5e5ac527 | fix(editor): the checkbox of the terrain around the camera in the layers shows the answer Without terrain of the scenery open | ||
|
|
f53cb24c6e |
Merge feat/editor-project-file into ui/editor-consistency
# Conflicts: # application/editormodeselftestexpect.cpp |
||
|
|
e95ee2fc4c |
Merge ui/editor-first-steps into feat/editor-track-turnouts
# Conflicts: # editor/layout/layoutNetwork.cpp |
||
|
|
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. |
||
|
|
47995b9ae2 |
Merge lang/editor-track-pl into ui/editor-first-steps
# Conflicts: # application/editormodeselftestexpect.cpp |
||
|
|
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. |
||
|
|
001dd0439a |
Merge test/editor-track-golden into feat/editor-norms
# Conflicts: # application/editormodeselftestexpect.cpp |
||
|
|
6ed30b0fbd | Merge fix/editor-switch-rules into test/editor-track-golden | ||
|
|
0de04dceed |
Merge ui/editor-track-panels into fix/editor-switch-rules
# Conflicts: # application/editormodeselftestexpect.cpp |
||
|
|
dfb15fee32 | Merge test/editor-selftest-expect into ui/editor-track-panels | ||
|
|
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). |
||
|
|
9f33045c2e |
fix(editor): the panels of the editor opaque, the 3d scene doesn't show through the docks around the view
The 3d scene is drawn under the whole window and the windows took the opacity of the simulator's interface (ui.bg.opacity, 0.65 in the ini of the game): the tracks and the models beside the view showed through the docks around it. The editor's windows are opaque now; the ones over the view meant to be seen through set their own alpha as before. The simulator keeps ui.bg.opacity for its own interface. |
||
|
|
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. |
||
|
|
5eb61fe7e1 |
feat(editor): the aerial photo in the toolbar of the tracks with its opacity, ~ the scenery's choice and in F1
The toolbar of the tracks has the photo: its button shows or hides it for the scenery, as the user's choice, and while it's shown over the view a slider of its opacity is beside it, kept with the editor. ~ (and Ctrl+~, which turns it on to hurry the view's tiles) count as the user's choice now: turned off with ~, the terrain model made afterwards no longer turned it on again behind the user. ~ and Ctrl+~ are listed in F1 with the camera. |
||
|
|
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. |
||
|
|
8c257fb6ad |
feat(editor): the tracks laid drawn over the aerial photo in the top view zoomed in as well
The photo is drawn over the view, the 3d tracks under it: zoomed in under 0.5 m a pixel they were left to the 3d tracks and the photo dimmed them. With the photo shown over the view the tracks are drawn over it there too, as their two rails in the colour of the rails of the top view where they're apart on the screen, so the tracks laid and the ones of the photo are seen together; the tracks being laid are drawn after them, on top. How many were drawn in the last frame is kept for the self-test. |
||
|
|
604c61976f |
feat(editor): the downloads of the aerial photo look after themselves: the area grown at its edge, the failures told and tried again, 4K zoomed in
The download area grows by itself where the camera or the laying comes within a tile of its edge: the tiles of 5 x 5 around them added to its tiles, as one outline along the grid with its holes filled, now and then (5 s apart at least) and not past 1600 tiles; the status line tells it, and the limit once. The area is saved with the scenery as before. A tile which failed is tried again later and later, up to 5 min apart, and never given up for good, around the camera and in the area alike. The ones failed are outlined red in the view, and the status bar tells how many with the reason in plain words (no connection, the server didn't answer, ...) in place of the code of WinHTTP, and Retry (Ponów) at once. The 4K photos (6 cm/px) of the tiles next to the camera come by themselves with the view zoomed in to 15 cm a pixel, and go again past 25 cm, within the limits on the 4K downloads as they were; the area is put into the cache in the products of the setting alone. |
||
|
|
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. |
||
|
|
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. |
||
|
|
81e53bbdef |
feat(editor): the switch tool a step at a time, the template chosen as a line
The panel of the switch tool goes by states as the lay tool's does, each with its step at the top (editor-lay-flow.md, second part): - Ready: "Press on a straight and drag along it and to the side" (a slip, a crossing and a connection with steps of their own). What to place as one bar, [Switch | Slip | Crossing], in place of the tiles in two rows. The rail of the track, or the rails [60E1 49E1 S42] where it doesn't tell its rail, and the speed on the diverging track as chips beside "Diverging speed (km/h)"; the template they pick as one line, "Rz 60E1-300-1:9, 50 km/h", its tooltip the lengths and the rest of its label, a pencil at its end opening the list of the templates and All templates under it. The gestures of placing are in the card and in the bar under the view, no longer rows in the panel; the template editor among More settings. - Dragging: "Let go to insert" and one line, "27.1 m, left, 40 km/h"; what keeps the switch from being laid (the rules a switch bent into a curve or laid on from a free end breaks) in one line in red, the switch moved back onto its straight or into its curve and the branch that doesn't fit into a track in orange. - Placed: "Switch z1 inserted, Ctrl+Z undoes" while the switch is the one the last step of the history laid, else "Switch z1: drag it along its track to move it". The sketch, its length and side in its tooltip; the speed chips and the template as the line with the pencil, as when placing; Flip the side. A switch with no drive says so with what puts one there; the name, the record, the angle, the drive, the frog and the check rails, the slide along its track and the note of the inspector are under Details, folded. What the tool told of it besides the step under it all. - Refused: the reason in red right under the step, the rest of a long one in its tooltip. The drive of the switch is drawn by a function of its own (render_switch_drive), no longer a lambda of the panel. The status of the switch tool is told in red while it's the refusal last told (m_switch.refusal), the expectations of the self-tests read it as before. The bar under the view keeps the gestures of the view first, "List in the panel" after them. Self-test: expect switchpanel <ready|dragging|placed|selected>, and the case lf_2_switch_panel_states: ready after a switch refused, placed after one laid, selected after another one laid since. lang/editor_pl.po: the Polish of the new texts. |
||
|
|
f065098717 |
feat(editor): the lay tool a step at a time, its settings folded while the points are clicked
While the points of a line were clicked, the same things were told in four places at once: the card of the
tool with seven gestures, the panel (the points not laid, the buttons, the modes with their explanation,
the speed with its chips, the height, the curves with their legend), six lines by the cursor with the full
texts of the norms, and the gestures again in the bar under the view. The panel of the lay tool now goes by
states, each with one line of what to do now at its top (editor-lay-flow.md):
- Ready, nothing clicked: "Click on the ground or at a free end of a track" (with a curve traced: "Click
points along the curve on the photo"), and the three settings: the shape [Straights | Curve], with what it
makes of the points under the "?" beside it (a click opens its lesson), the radii of a curve traced in the
same place, the speed (the field and its chips), the height [Fitted | Point to point | Flat]. The rest
under More settings, the pieces added at the free end of the selected track there too.
- Clicking, a point or more: "Click the next bends" and the keys "Enter lays, Backspace takes back a point,
Esc drops". The line in one line, "Length 300 m, 2 curves, slowest 35 km/h", and a badge, green "meets the
norms" or orange "2 curves below the norms for 100 km/h"; "details" (or the badge) opens the curves one by
one, the breaches of the norms in their words, how the curves go on from those of the tracks joined, the
speed designed for, the grades and what the norms say where the line goes on from a switch. The legend of
the labels is by the cursor over a curve. [Lay (Enter)] as the main button and [Drop]. The settings
folded to one line, "Straights, 100 km/h, through the points" (a curve traced with its radii), a pencil at
its end opening them. The details open under it all, so the buttons stay where they are.
- Laid: back to ready, with one line over the settings, "Laid 214 m (14 tracks), Ctrl+Z undoes" in green,
the rest of what the laying told under "notes" beside it. It goes as the history moves on or back.
- Dragged out of a free end: "Drag to lay from the end; let go to lay it", the line of its length and
radius with the badge, the settings as the line of their summary. The drag tells the line laid as Enter
does.
- By the cursor, the leg drawn to it in a line or two: "straight 40 m", "curve R 76 m, up to 35 km/h" with
the sign of a warning (drawn, the font has no glyph of it) and the line in orange where it's below the
norms; joining a free end, the shape of the join, a line that can't be laid, Alt, the first Esc and what
Tab switched to. The texts of the norms are in the details only.
- The labels in the view short: "R 198, up to 60 km/h", orange below the norms; the straights as before.
- The bar under the view shows the three gestures of the state: ready "LMB the first point, LMB on a free
end from the end, Tab a curve from the photo"; clicking "LMB the next bend, Enter lay, Backspace take
back". The rest of them in the card unfolded and in F1, Ctrl+Shift+wheel (the speed) added there; the
length typed after the three.
Nothing is taken away: what the panel showed is behind a fold, the pencil, the "?" or F1. The messages the
lay tool logs for the self-tests keep their words, the line laid told as "Laid 214 m (14 tracks)" now.
The flow: application/editorflow.h, the step line, the summary line with its pencil, the badge with its
details, the message of one line with the rest in its tooltip, for the panels of other tools as well.
Self-test: expect laypanel <ready|clicking|laid|extending> <shown|folded>, and the case lf_1_lay_panel_states
through the states, in straights and in a curve traced.
lang/editor_pl.po: the Polish of the new texts as the spec words them; the laying texts of "the photo"
named the orthophoto as the rest of the editor ("na ortofotomapie", "z ortofotomapy").
|
||
|
|
fef7eaac11 |
feat(editor): one card for the tools, one layout of the fields, windows of their own, one name for each thing
The consistency pass of the editor's interface after its first steps (P2 of the plan of the editor's interface):
- One card for the tool in use in every field of work. The card of the track tools (its icon, name, family and key, what
the tool is for, the mouse and the keys drawing its gestures, the link to all the shortcuts) is a component of its own,
render_tool_card, fed by the tracks as before and now by the surroundings, the roads and the terrain: their tools, kept in
one table each with their icons, keys, tooltips and gestures for the toolbar and the card, had a plain heading and a line
of keys or a few rows of gestures there. The tool options of the surroundings are headed by the field of work as the
others are. The card is folded to its title row unless the user opened it, for all the tools: what the tool is for shows
over the title, a click opens the gestures, which are in the strip under the view of the tracks as well. Kept with the
settings of the editor under the key tool_card_folded, so the open card the tracks had by default before stays behind.
- One layout of the fields: the name on the left, the field on the right (begin_fields and field_row, as in the inspector of
the tracks) in the inspector of the surroundings (the name, the position, the rotation, the scale), Weather and time,
Change history, the settings of the orthophoto and the settings of the editor. The square buttons of the download area go
on to the next line at the edge, the last one was cut off.
- Windows of their own, which don't hide the inspector: Editor settings, Weather and time and the orthophoto settings float
over the view, opened in its top left corner below the rows of the tools and kept between them and the status line, as
the window of a lesson is. They were tabs over the inspector, and the orthophoto settings unfolded inside the layers; Map >
Orthophoto settings..., the button of the terrain tools and the button in the layers open the window now.
- One list of the objects of the scenery: Windows > Scene Hierarchy, a plain list of the same nodes, is gone; Windows >
Scene opens the Scene tab (by layer and group, with the filter) and brings it forward when it lies behind the layers.
- One name for each thing, in the menus, the toolbar, the panels, the tutorial and F1: the orthophoto ("Ortofotomapa
(zdjęcia lotnicze z geoportal.gov.pl)" where it's introduced, "ortofotomapa" in the rest, for "zdjęcia lotnicze",
"ortofoto" and "zdjęcie"), the terrain model ("Teren z map (NMT)" for "Prawdziwy teren z map", "model terenu", "prawdziwy
teren", "Teren z NMT"), the plan tool ("Plan", the lesson "Correcting a curve" and the section of F1 "Plan of a curve"
before), the area fill (the terrain's "Fill" is "Area fill" as in the surroundings, with the icon of it, Water without).
The texts of the laying, whose panel is to be redone, are left as they are.
- The node bank: a model clicked with the select tool of the surroundings arms the insert tool with it (the click did
nothing before), the random model of a set is left off then. A model inserted where there's no ground under the cursor
stands at the height 0 where the cursor points, or in front of the camera when it points above the horizon, and the
status says where; it stood at the point the renderer last had under the cursor, out of sight. The search field of the
bank has no name beside it, which was cut to its first letter.
- The settings in one place: Editor settings holds the movement and the speed of the camera (as View > Camera speed), the
gizmo and the colours, the terrain made of the terrain model by itself (as in the layers and the download area) and the
maximum placement distance (as in Change history).
- F1 and the menus: Esc closes the window of the shortcuts, before anything else; the window stays in the work area as the
window of a lesson; the menus are opaque, the windows under them showed through.
- What the first steps left: with an empty scenery the panel in the middle of the view gives way to the inspector, which
says the same with the button of the lay tool and the first steps; it's drawn only while the inspector isn't seen. A
switch whose speed limits its diverging track alone shows that speed under its empty speed field ("The diverging track
40 km/h, the main one no limit"), read only; the field alone said no limit.
- Self-tests: the command bankpick, the expectations tool, window and selected, the cases c_1_bank_card_arms_insert and
c_2_esc_closes_shortcuts.
lang/editor_pl.po: the Polish of the new texts (the cards of the tools, the windows, the fields, the notices), the entries of
the texts renamed given their new English, those no longer used taken out, and the names unified in the Polish of the
orthophoto and of the terrain model.
|
||
|
|
31dc959cec |
feat(editor): the speed of the diverging track of a switch, one rule for the editor and the domain model
The formula Q2 gave the editor (editor_mode::branch_speed_of) taken out into a pure function of the switch curve module, which the domain model of the track geometry (editor/layout, E2b) calls for its turnouts too, so the two write the same speed. - switch_curve::branch_speed(): of the basic switch of R and 1:n, its main track bent by table 11.8, the cant with its sign toward the side the diverging track leaves to: formula 9.9 with the normal deficiency of the frog (table 9.7), rounded down to the steps of the speed limits, no more than table 11.2 gives the basic switch. It reports the radius, the cant into the turn, the deficiency, the formula, the rounded speed and the table, which the editor's message tells. - switch_curve::basic_speed(): table 11.2, moved from editor_track::diverging_speed(), which now returns it. - switch_curve::written_velocity(): the one velocity a switch keeps, the main limit for both where it's the lower, else the diverging one below 0; write_switch_speed() calls it. - speed_check::suggested() inline in editorSpeed.hpp, so the switch curve module takes it in the unit tests, which don't build the checks of the speed. The editor computes the same numbers the same way: the basic radius and the bent main radius as before (bent only where the type is known), the cant toward the diverging side the same product, its sign flipped by the bent radius as before (a multiplication by -1, exact), then the same calls in the same order. tests/unit/test_switch_curve.cpp unchanged and passing. Tests (U): the examples of Q2 through branch_speed (Rz 60E1-500-1:12 outward in R 1200 m with 60 mm 60 km/h, inward 60 by the table; Rz 60E1-190-1:9 in R 600 m with 60 mm 30 and 40 km/h), the table of the basic switches, a movable nose kept to 130 km/h, a diverging track bent straight, the editor's table the same, the velocity written. |
||
|
|
cd20d8ec94 |
feat(editor): the first steps in the inspector, one way to start, the line laid summed up
The first steps of the editor, after the first-run pass at 1920x1080 and 1366x768 (P1 of the plan of the
editor's interface):
- The tutorial no longer opens by itself as a window over the middle of the view (at 1366x768 over all
of it, its close button under the tool row). With nothing selected, the inspector shows a compact
"First steps" card: the lesson of the tool in use, its steps to try ticked as they're reached, the
links "Show the lesson", "The camera" (the first lesson) and "Hide" (the setting first_steps, which
the checkbox of the window now names "Show the first steps in the inspector"). Opened, the window of
the lesson goes into the corner of the view by the inspector, below the rows of the menu and the
tools; moved, it stays between them and the status line, as high as that room at most, the lesson
scrolled inside. Its close button is always within reach.
- The lesson follows the tool: the select tool of Tracks opens "Laying track" until its steps are done,
so a new scenery opened in Tracks starts there, not with the camera, which stays the first page and a
link of the card.
- An empty scenery in Tracks with nothing selected: "The scenery has no tracks yet" and one highlighted
button, "Lay the first track (L)"; the tutorial is the card under it, a "Tutorial" link when the card
is hidden. With tracks, the select tool keeps its hints and a plain "Lay a track (L)".
- "Without terrain", the answer to the question of the terrain at the first L, turns off the terrain
made of the terrain model by itself: under the tracks as they're laid (the checkbox of the layers) and
around the camera within the download area (the checkbox of the terrain panel), stops putting the
squares of the area into the cache, a square on its way giving way at once, and drops the squares
waiting. Kept on, the model went on being asked for, and offline the log filled with "NMT square ...
not fetched: WinHTTP error"; now nothing is asked for after the answer.
"Load the terrain" turns both on again. The squares of the area go to the cache, and the aerial photos
ask for the model to lie on, only while some terrain is made of the model by itself. The question
stands in the middle of the view, the window of the lesson waiting meanwhile. The warning of no ground
under the mouse shows only while the pointer is over the view and the terrain is to be there.
- The tooltip of the line being laid names the panel the rest of its warnings are in ("listed in the
tool options"): the translation of the text before said "in the panel on the right", the panel is on
the left.
- While the pointer is over a panel, the line being laid stays as it was: the point of the cursor, the
free end it snaps to and its height aren't taken from where the pointer is under the panel, which
added a leg there with curves and warnings of its own. A drag begun in the view goes on over a panel.
- After Enter the inspector sums up the line laid: its tracks, length and curves, those below the norms
in orange, and what comes next, "A switch (T)" and "Save (Ctrl+S)". It stays while the last track is
the selection the laying left; a click on a track shows the sheet of that track. The switch tool with
nothing clicked shows the same, not the sheet of the last track laid.
- A switch the switch tool refuses is told in its panel and by the cursor, no longer in the status line
and the layers window as well, where it stayed after the next switch was laid. Why a branch couldn't
lead into a free end goes into the panel with the rest; a switch laid takes the note by the cursor
away.
- The panel of the lay tool fits one screen at 1366x768: what the tool is for is the tooltip of the
title of its card, the paragraph of the radius at the bends the tooltip of its "?" (which still opens
the lesson), "This speed also on from a track with a speed of its own" is under More settings; the
mode, the speed and the height stay up front.
- The layout made on the first start: the side columns 22% of the width, at least 300 px, at most the
400 and 460 px they had and 30%; at 1366 px the view has about 766 px instead of 557. The tool options
take 60% of the left column, and in a window under 800 px high the layers are a tab beside them, the
tool options shown, so the panel of a tool has the whole column. The line of the keys of the
surroundings goes on under itself at the edge of the panel. Layouts kept in imgui.ini are left as they
are.
- The names of the period of the day, the season and the weather in Weather and time, and the type of a
node in the inspector of the surroundings, go through the translations ("(day)", "(autumn)",
"(scattered)", "Typ: track" before). The degree sign of the air temperature is written as its UTF-8
bytes: CMakeLists.txt sets COMPILE_OPTIONS of eu07 and eu07_core after add_compile_options("/utf-8"),
which drops /utf-8, so MSVC writes the "°" of a literal as the single byte 0xB0 of the ANSI code page,
not UTF-8, and ImGui drew '?'.
- Self-tests: the expectations statuslacks, refusal, statusline, laycursor and terrain, the command
nmtquestion, and the cases fs_1_preview_over_panel, fs_2_switch_refusal_cleared and
fs_3_without_terrain.
lang/editor_pl.po: the Polish of the new texts (the card of the first steps, the summary of the line laid,
"Lay the first track", the names of the periods, seasons and weathers and of the node types), the entries
of the texts replaced given their new English ("Show the first steps in the inspector", "and %zu more,
listed in the tool options", "Lay the first track (L)" in place of "Or start with:"), and "(do
transmisji)" in place of the English "(stream)" of the drawn cursor.
|
||
|
|
38f90387c4 |
feat(editor): the norms checked on the tracks laid, read only: a Norms tab of the track analysis and its report
The second half of E1: what the tracks of a scenery are against a profile of the norms, listed. Nothing of the tracks is changed. - editor/editorNormsReport: a line of paths sampled a metre apart, two samples at each joint, into what the norms read a line from: the plan, the curvature signed by the turn, the cant on the base of 1500 mm (as the simulator takes the rolls) signed by the side it leans to as the line runs, the grade, the speed of each path (a switch's for its diverging track alone too), and what the path is a part of (a switch, its diverging track, a curved switch, a movable frog, a crossing). The line described, checked, and each finding set back on its path with a point of it; its message, "cant ramp 3.00 mm/m, PLK allows at most 2.50 mm/m (tab. 9.12)", "break of the grade with no vertical curve, PLK asks for a radius of at least 2500 m (tab. 10.2)", through STR_C; the text of the report: the class, the elements, the cant, the grade line and the findings of each line. - The Norms tab of the track window, under More beside Speed and Joints, no key; its window is ###trackanalysis, as theirs. The line through the selected path (run_route, as the speed check walks it) or the whole scenery: the lines through the plain tracks, then each path of a switch none of them ran along, checked with the line it lies in and its own findings kept, a place two lines run through listed once. The profile (PLK by default) and the class of the line folded under a line saying it: the line speed for the tracks with none of their own (on by default: the speed of each track), the slow trains (tab. 8.1 by default), the traffic, main track or siding, the load, at a platform. The results in the table of the speed check and the joints, the worst first, coloured by the tier, the values above the recommended ones on a tick; a click on a row shows the place, the hard limits and the warnings are marked in the view. The icon is drawn into its own cell of editor_icons.png only (the generator has it): the sheet drawn again with this Pillow differs in other cells. - Self-test: normsreport <file> [scope] [plk|tsi|en|ch] [km/h] writes the report to the file; expect findings <tier> <least> <most>; the case e1_norms_report checks the curves k0..k3 of the fixture at 60 km/h against PLK and the whole scenery against the TSI. - Golden: data/norms/line.scn, a line of 14 tracks written by make_line.py there (curves with and without transitions, cant on and off a curve and along a straight, reverse curves 10 m apart, short straights, a grade with breaks), and its report against the four profiles in data/norms/line_report.txt; EU07_UNIT_TESTS_UPDATE_GOLDEN=1 writes it anew. A test lays a canted corner with the alignment of the editor and finds the samples leaning into it, both turns and run both ways, I = Deq - D. alignment::limits stays as the laying tools use it. Where its values differ from PLK P0: - unbalanced 0.6 m/s2 is I 92 mm on the 1500 mm base; P0 110 mm (P1 130) on the running lines, 80 on the sidings; - ramp_factor 10, a ramp of 1:(10 V), 1 mm/m at 100 km/h and 2.5 mm/m at 40 km/h, has no counterpart: P0 1.6 mm/m at any speed; - jerk 0.3 m/s3 is dI/dt 46 mm/s; P0 55 mm/s; - vertical_factor 0.4 V^2 and vertical_min 2000 m; P0 max(0.77 V^2, 5000 m) (P1 max(0.35 V^2, 5000), P2 max(0.25 V^2, 2000)); - arc_min 20 m and arc_min_factor 0.4 V; P0 max(0.35 V, 30 m) up to 120 km/h, 0.40 V up to 200 km/h, also for the straights, where tangent_min_time is 0; - the same: cant_max 150 mm (P0 = P1 = P2 on ballast), cant_rate 35 mm/s (P0 of tab. 9.13), the base of 1500 mm. |
||
|
|
e27d3b7e73 |
test(editor): golden round trips of the tracks and of the //$ lines, the cant at the joints
The safety net of the track editor before its domain model changes (E0 of
editor-tracks-tests.md): what the editor reads from the scenery files and
writes back is read, written and read again in tests/unit, with no game data.
Tracks (test_track_text.cpp, data/tracks/). Entries written the way the game
writes them, read by TTrack::Load() and written by export_as_text(), come out
byte for byte the same, and read again give the same track field by field:
plain tracks with all their attributes (events, speed, isolated, overhead,
vradius, rail profile, friction cell), a curve with cant, radius, uneven,
buckle, cwr and sleeper models, a bridge, switches with trackbed, frogs,
movable nose, blades, uneven of both paths and timbers, a turntable, paths of
pieces, the speeds +40, -40, 0.5, 0 and none of tracks, switches and
turntables, a river, a tributary, a road and a crossing. What the game writes
otherwise than given is checked as it is (table as turn, mountain as
mountains, the length of the path, a switch heard from 10 m, the events in
order, names in lower case, model paths with forward slashes, the texture
length, rolls as floats, no overhead and no vradius left out).
The seam: TTrack built from text with no scene. The engine stubs of the tests
had none of it, so the tests link the few sources reading and writing a track
takes (world/Track.cpp, Segment.cpp, TrackUneven.cpp, MemCell.cpp,
scene/scenenode.cpp, utilities/Timer.cpp, rendering/geometrybank.cpp) and
track_stubs.cpp stands in for the rest: a renderer keeping the materials by
their names, and the scene, events, vehicles and the geometry of the rails,
which reading and writing never reach and which stop the test with their name
if one does. It tests the game's own Load() and export, where a parser of its
own would have meant rewriting Load(), and changes no code of the game. The
stub of basic_node::radius_() goes, scenenode.cpp brings the real one. The
rails don't buckle in the tests (TrackBuckle.cpp needs the environment), the
buckle declared is read and written either way; material names go through a
stand-in, the game's material manager isn't tested here.
The //$ lines (test_editor_records.cpp, data/records/). Their readers and
writers were members of editor_mode, srk_tool and the stores, with the scene
around them; they move as they were into editor/editorRecords.cpp, the one
place each kind is read and written, which the stores call (and which the
migration to the project file of E3 will need apart anyway). The methods of
scene::layer_context move into scene/scenelayercontext.cpp so it links alone.
Each kind, h r k p t w b s c o z, read from golden lines and written back comes
out the same, in the coordinates of the file and of a file placed at an
origin; //$e, the descriptions of the templates, read and saved by
editor_includes in a template in a scratch folder, leaves the file as it was.
Cant (test_cant.cpp). The paths an alignment lays roll by asin(cant/gauge),
signed with the turn, back to the cant of the line at every end; a curve the
other way rolls the other way. At a joint editor_track::match_rolls() gives
the joined track the roll for the travel across it, turned where the paths
face or stand back to back, and the track written keeps it. The inspector's
own conversion on 1500 mm stays in its lambdas here; named, as
editor_mode::cant_of_roll()/roll_of_cant(), it comes with the quick fixes.
Known bugs found, tests of the change each (doctest::should_fail, passing
until fixed, then reported to drop the decorator), data/tracks/known_lost.scn:
- angle1/angle2 are read and dropped: not written back.
- fouling1/fouling2 are read and dropped: not written back.
- name@circuit: the circuit is taken out of the name with the letter before
the @ ("tor1@iso1" becomes track "tor"; substr(0, i - 1)).
- the attributes of the entry (gauge, friction, texture sizes, speed...) are
written to 6 significant digits, a float has 9: more digits are lost on the
first save.
None in the //$ lines.
Unit tests: 957 cases before, 974 after, all passing.
|
||
|
|
c7afa3ca10 |
fix(editor): a switch laid gets the speed of its diverging track, one breaking a hard rule of ST-T1-A6 isn't laid
- Every switch laid writes the speed of its diverging track (`velocity`): the switch tool on a straight, into a curve, from a free end and linked, a double switch, the switches of a slip, a switch given another template of the catalogue, and a switch moved along the curve it's bent into. A switch of the catalogue had no limit before, one copied from a switch of the scenery kept that one's, one laid without a track had the laying speed on both its tracks. The limit is for the diverging track alone (`velocity -V`); the own limit of the track it goes into stays for both where it's the lower. The switch tool says the speed and what gives it. - The speed is formula 9.9 of PKP PLK ST-T1-A6 the other way round, V = sqrt((I + D) r / 11.8), with the normal cant deficiency of the frog of table 9.7 (110 mm a fixed frog, 130 mm a movable nose), rounded down to the steps of the speed limits and no more than table 11.2 gives the basic switch. For the fixed frogs the formula gives table 11.2 itself (190 40, 300 50, 500 60, 760 80, 1200 100 km/h); the 2500-1:26.5 with a movable nose stays 130. A switch bent into a curve takes the radius of its diverging track from table 11.8 (one-sided r" = (Rr - t^2)/(R + r), two-sided (Rr + t^2)/(R - r)) and the cant of the line with its sign: leaning against the diverging track it takes speed away, where the speed check counted it as helping. Rz 60E1-190-1:9 bent out of the curve R 600 m with 60 mm: 30 km/h, not 40; the 60E1-500-1:12 of the review, out of R 1200 m with 60 mm: 60 km/h at its fixed frog (54 at I = 100 mm, the 0.65 m/s2 the editor took), not 107. - A switch breaking a hard rule isn't laid, the tracks left as they were, and the switch tool says why, with the value, the limit and the paragraph: the cant changing within it (11.4 pkt 7), a cant ramp ending within it or nearer than 6 m (9.6 pkt 16-17; one ending right at an end of the switch is let be, as the snapping of the start offers it), a double switch, a slip or a crossing bent (11.4 pkt 4), the curvature of its diverging or its main track turning from one side to the other (9.7 pkt 12, KZW II). They were warnings shown after the switch was laid, and on a straight the cant wasn't looked at at all. The line is looked at 10 m past the ends of the curve or the straight too, so the ramp on the straight before a curve counts. The previews show the refusals. - A switch moved along its straight or the curve it's bent into, a double switch moved along its straight, and a switch given another template go through the same checks; one breaking a rule stays as it is. - Warnings still: 1:9.403 and steeper than 1:9 bent (11.4 pkt 4c-d), a rule of the running and the main tracks, which the editor doesn't tell from the side ones, as the warning now says; the limits of table 11.9 and a cant over 100 mm in a bent switch (table 9.6), as before. Tests: unit tests of tables 11.8 and 11.9 (the least main radius bends the diverging track to the least radius the table gives), table 9.7, the speeds of table 11.2 by formula 9.9, the speed of a bent switch with the cant with its sign (the example of the review), the cant over a switch on a straight and a double switch bent. Editor cases `q2_1_switch_speed`, `q2_2_switch_refusals` and `q2_3_switch_move`, with `expect status` (the status of the switch tool) and `expect steps` (the undo steps), the fixture with a straight taking a cant on and a compound curve without cant. All pass; with the changes of the editor reverted all three fail. |
||
|
|
02c36b33cf |
feat(editor): the track tool panels keep their fields, results and buttons within the panel
- The card of the tool: after a long gesture the action goes under it, at its indent, when what is left of the row is narrower than 8 font sizes or the longest word of the action. It was squeezed into a sliver and broken in the middle of its words. - A click on the title row of the card folds it to that row (icon, name, family, key, and a small triangle marker) and opens it again. One flag for all the tools, kept with the editor settings (`track_card_folded` in eu07_editor.ini), open by default: the card took 250-300 px at the top of every tool and repeats the hint bar of the view. - The grade labels of the vertical profile, on the graph and in the view, write the per mille as the panel does (the translated "per mille", the per mille sign in Polish), not "o/oo". - The track analysis window: the thresholds of the speed check and of the joints keep to their widest name and a field of 10 font sizes where the window is wider than that, as docked across the bottom (`begin_fields_fitted`). The results are tables with each column as wide as what is in it: the speed check with its column names kept at the top as the list scrolls, the joints with the kind, the value and the two tracks next to each other. A click on a row shows it as before. - `same_line_if_fits` puts the next button beside the one before only when it fits in what is left of the line, at the start of the next line otherwise. Used where the route design puts buttons side by side, for "Forget the design" in the profile panel, which was cut off at the edge, and for the buttons of a switch in the inspector. - The laying options: the speed, the curve radius and the longest path are fields with the name on the left in two columns (`begin_fields`/`field_row`), as in the inspector, the route and the profile, the chips of the quick values under them. The segmented choices give the short names less of the room when a long one doesn't fit in its even share, and go on in a second bar when they don't fit side by side: "Through the clicked points" overflowed its third of the bar. |
||
|
|
690c913ef0 |
test(editor): self-test scripts that fail, a runner, and a case for each fix of the track editing
The editor's self-test scripts only logged: nothing made a run fail. Now: - `expect` commands check the state and log `SELFTEST PASS` or `SELFTEST FAIL ... got X, expected Y`: the cant at a track end, the joint at an end (gap, angle, cant step), the records of a switch and the connections naming it, speed, gauge, a track present or removed, the laying norms' gauge, heights and lifts against a mark, whether a track is in the line under the route tool, and the includes of a turntable. A command no group takes counts as a failure, so a mistyped one can't make the checks after it pass. - At `quit` the result is logged, and a script whose expectations failed ends the editor with exit code 2 (a failed start stays 1; the simulator's test mode is unchanged). - The commit of the inspector's cant field is `track_cant_commit`, which the inspector and the `trackcant` command both call; `routegauge` sets the laying norms as the route tool does, and `tracksetdelete` deletes a set of tracks by name. - `tests/editor/run.py` runs each script of `tests/editor/cases` on a copy of the fixture scenery in the game folder, with a wall-time limit and a memory cap, reads the exit code and the `SELFTEST` lines, and deletes the copy. A `#> reopen` line restarts the editor on the saved scenery. See `tests/editor/README.md`. - One case per fix of the track editing quick fixes (inspector cant, norms after deleting, the gauge paste group, turntable speed saved, deleting a set, a set with a double switch, a slip and a crossover, deleting a switch of a crossover, a bent switch). All pass; with the fixes reverted all fail. |