mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 08:17:09 +01:00
47995b9ae2f624ebf11289cd109c87819df67d15
8 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
47995b9ae2 |
Merge lang/editor-track-pl into ui/editor-first-steps
# Conflicts: # application/editormodeselftestexpect.cpp |
||
|
|
001dd0439a |
Merge test/editor-track-golden into feat/editor-norms
# Conflicts: # application/editormodeselftestexpect.cpp |
||
|
|
0de04dceed |
Merge ui/editor-track-panels into fix/editor-switch-rules
# Conflicts: # application/editormodeselftestexpect.cpp |
||
|
|
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). |
||
|
|
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. |
||
|
|
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. |
||
|
|
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. |