mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 12:57:06 +01:00
c508f5eef1fbaaefce65fac5d7bfe4815d08985f
162 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 |
||
|
|
9016b3a951 | Merge feat/editor-model-turnouts-ui into feat/editor-project-setup | ||
|
|
8b48cfddae |
Merge feat/editor-legacy-takeover into feat/editor-model-turnouts-ui
# Conflicts: # editor/project/projectSession.cpp |
||
|
|
0301c6e9cc |
fix(editor): the pieces of a cut old track get its events as the simulator fires them, its joints follow a line laid anew
- keep_old_tracks() kept all the events on the first piece of an old track. The simulator fires event1 as a vehicle enters a track at its Point2, event2 at its Point1 and event0 while it stands on it (TrkFoll.cpp), so with a 120 m track cut into 40 and 80 m a train running towards Point1 got event1 about 80 m late, and one standing on the second piece no event0. Now each piece gets event0/eventall0, the piece at Point1 event2/eventall2 and the piece at Point2 event1/eventall1. The keywords are compared in any case, as the simulator lowers its tokens. - The joints of the old tracks kept their chainages through move_vertex, set_vertex, insert_vertex and remove_vertex: widening a 90° curve by 20 m shortens the line by about 8.6 m, and a joint past the new end was dropped, a short buffer-stop or signal track there with its name, events and circuit. Each joint now goes to the point of the new line nearest to where it was. solved_line::nearest() is shared with the crossover planner. - Sonar: the seeded generators of the takeover tests are marked (S2245), two dereferences after a REQUIRE too (S2259). |
||
|
|
eb376a2d3e | Merge feat/editor-model-in-editor into feat/editor-legacy-takeover | ||
|
|
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 | ||
|
|
348cc2df47 |
fix(editor): migrated switches leave to the side their records say, bent ones migrate, a record fitting two types isn't guessed
- The migration mapped L to hand 1, but switch_store::classify() writes R where the diverging end lies to the positive cross of the direction, which is the side of hand 1 of the domain (its curvature above 0 turns that way). Every migrated switch came out mirrored, and the test checked hand == 1 for an L record without looking at where the diverging end lies. R is hand 1 now, and the test checks the side of the diverging end. - classify() writes a switch bent into a curve as Rlj or Rld with the radius of the ordinary switch it's bent from; the catalogue has it as an Rz, so no bent switch could migrate. They're looked up as Rz. - catalogue_type() took the first loose match. A movable nose isn't in the record, so the ordinary frog is taken where the catalogue has both; a record fitting two other types (the variants of an Rpd) is kept as it was, why with it. - Slips and crossings are kept as they were, as the header of the migration says. - Smaller: the type looked up is checked before its length is read; new diverging, slip and crossing tracks get the chainage of the turnout as a diverging track had before; the walk of a bent transition stops on a step that turned nothing instead of dividing by it. - Sonar: the leg check skips an end whose turnout isn't found (S2259), the spacing of a crossover is measured in whole steps counted in an integer (S2193), the seeded generator of the turnout kinds test is marked (S2245). |
||
|
|
28a81ee0bd |
Merge ui/editor-lay-flow into feat/editor-turnout-catalogue
# Conflicts: # editor/layout/layoutGenerator.cpp # editor/layout/layoutNetwork.cpp |
||
|
|
f53cb24c6e |
Merge feat/editor-project-file into ui/editor-consistency
# Conflicts: # application/editormodeselftestexpect.cpp |
||
|
|
b15f7dcdec |
fix(editor): file names outside the code page don't crash the project, includes are found in any case, a project file cut short isn't put in place
- The scenario index made a string of the name of every file in the folder, which throws on Windows for a name the ANSI code page can't hold (the class of GE#560). It looks at the extension first and leaves out a .scn the game couldn't open by its name either; the messages of the project file show paths as UTF-8. - The includes are read with the FileCased() fallback of the game (scenery_text::file_text), so on Linux an include written in another case no longer drops the scenario from the index, skips the migration of its file or marks its tracks as changed by hand. - save() closes the file before looking at it: a failed last flush no longer renames a truncated .new over the project. - "next node 0" is refused instead of wrapping to 0xffffffff. - open_project() writes no .eu07proj when there were no //$ lines to migrate, and asks exists() without throwing. |
||
|
|
2b36fbe9af | Merge feat/editor-track-turnouts into feat/editor-project-file | ||
|
|
fffdbb9578 |
fix(editor): no diverging track is laid from a main track that isn't laid, a switch track with no pieces isn't written
- lay_diverging() didn't look at turnout_frame::valid: with the main track unsolved the diverging track was laid from the origin and settle moved its end node there. Edits were rolled back by the check, but nothing refused it at its source. It now returns an error, for every caller. - whole_path() took Pieces.front() of a track the cutter gave no pieces of; the switch track is refused with the reason. - Sonar: the turnout lookups of the node and network checks are guarded (S2259), the search of the free transition and the test loops count in integers (S2193; 2 m steps, the same values as their sum), the seeded generator of the turnout edits is marked (S2245). |
||
|
|
e95ee2fc4c |
Merge ui/editor-first-steps into feat/editor-track-turnouts
# Conflicts: # editor/layout/layoutNetwork.cpp |
||
|
|
47995b9ae2 |
Merge lang/editor-track-pl into ui/editor-first-steps
# Conflicts: # application/editormodeselftestexpect.cpp |
||
|
|
4ae90e99c6 |
fix(editor): the norms see a Bloss transition as it is, a line splits at the tangent point of an arc with no transitions
- A Bloss transition went to the norms as an even one: 60 m into R 600 m at 100 km/h showed 63 mm/s of deficiency change,
where its middle reaches 109 mm/s, past the hard limit of 80 mm/s, so the edit wasn't blocked. norms::element::bloss makes the
engine follow 3t^2 - 2t^3 of the curvature, look at the transition in eight pieces, and take the shift as L^2 / 40R instead
of L^2 / 24R. Two Bloss halves no longer run on into one element of the chain.
- split_line right at the tangent point of an arc without transitions was refused ("the tangent there doesn't cross the
tangents of the curve"): the curvature there is already the arc's, so it now takes the start or the end of the curve.
- Sonar: the chain walk, describe_chain and check_norms check the lines they look up (S2259), join_ends returns when an end
isn't found rather than when a reason was given (S836), the test loops count in integers (S2193), the seeded generator
of the random edits is marked (S2245).
|
||
|
|
e3092df0ca | Merge feat/editor-norms into feat/editor-track-model | ||
|
|
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. |
||
|
|
35383409ee |
feat(editor): the aerial photos on the map of the wizard, from the service the photo under the scenery comes from
The map the centre of a new scenery is clicked on (and the one of the terrain panel) showed the base map of OpenStreetMap alone. Zoomed in to 40 m a pixel or finer it shows the orthophoto of GUGiK now, the same WMS as the photo under the scenery in the editor; further out the map, with "Zoom in for the photos" while the photos are chosen. Map | Photos in its corner switches between them, the photos chosen at first. Whose the picture is, is told by the line under the steps of the wizard and, for the photos, in the corner of the map: GUGiK, geoportal.gov.pl, or OpenStreetMap for the map. |
||
|
|
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. |
||
|
|
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.
|
||
|
|
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.
|
||
|
|
10d3da2164 |
feat(editor): an old scenery read with no scene, its lineside objects anchored to the lines with a confidence, the anchors in the project file
The rest of E6a (editor-tracks-domain.md §2 "Kotwica", §3 "Otoczenie", §9, §10 "Powiązania otoczenia ... z oceną pewności; wątpliwe pokazane do przejrzenia; przewody wiązane ze słupami"). - editor/project/legacyScenery: the tracks of the railway (normal and switch) and the lineside objects (models, wires, memory cells, event launchers) of a scenery read from the text of its files with their includes, as the simulator places them: the tracks and the wires moved by the origin only, the rest by the origin, the rotation and the scale (sceneryText now tells the placement in effect at each statement). The tracks naming an object: a memory cell's own, and those whose events (event0 to eventall2 of their entries, the events <track>:eventN) act on it, multiple events followed four deep. The kind of an object by its file and name, as the binding of the editor tells it (infra::classify). - editor/layout/layoutAnchors: an anchor puts an object along a line: its chainage, the offset to the left of the line (below 0 to the right), the height above it, its turn against the heading there; a wire by its four points, bound to the poles its ends hang on (a pole, or a model the names take for a part of the catenary, within 8 m of each end, along the same line). infer_anchors() anchors every object within 30 m of a line to the nearest one, with a confidence from 0 to 1 and the reasons for it: named by a track of a line, 0.95 at least (0.85 where another line is nearer, half of the fit where the line named isn't near); else how its distance fits its kind (a signal 0 to 6 m, a sign or a pole 1.5 to 8 m, a wire 0 to 1.5 m, equipment 0 to 3 m, logic and the rest 0 to 15 m, the environment at half), a third past the end of a line or 15 m above or below it, half where another line is as near within a metre, 0.8 for a sign, a signal or a pole turned more than 10 degree off square to the track; a wire on poles at both ends 0.9 at least, on none 0.7 of what it had. Below 0.6 doubtful, to be looked over. place() puts the object where it stands along its line now; follow() after a change of the network: an anchor whose line is there keeps its chainage, one whose line is gone (cut, joined, taken by a turnout) is anchored again where it stood, to the line there now; the anchors whose objects move, with where to. Moving the nodes of the scene, and taking the anchors back with an undo, is the editor's. - take_over_tracks() given the objects of the scenery anchors them to the lines it laid, the old tracks naming them by the lines they became, and lists the doubtful ones, with the deviations, for the question. - The project file: the anchors section, reserved and empty in version 1 so far, holds the anchors: "anchor <id> <kind> <name> <key> group <n> at <x y z> yaw <deg> line <id> chainage <m> offset <m> height <m> turn <deg> confidence <c> points <n> ... poles <n> ... [why <reasons>]". The schema stays 1: it's unreleased and the section was empty. - The //$b bindings of the old editor (the same mechanism along the paths of the tracks) aren't made anchors yet. Tests: G: data/takeover/old.scn, written by make_old.py (a line of 26 tracks with a curve of R 500 m, clothoids of 60 m and 80 mm, a break of the grade with no vertical curve, tracks of no name and written backwards, events and an isolated circuit; a switch at its end and a line on from each of its legs; a signal named by the events of a track and its memory cell, a pole every 50 m and the wires between them, hectometre posts, a tree 25 m off, a cabinet between two lines): read with no scene; its plain tracks taken over as three lines with no question, R 500 m, the clothoids and the cant read back within 1 and 5 %, the lines held at the legs of the switch in its headings, one step undone and done again the same; the tracks made again ending at the old joints, each old name once, the events and the circuit on their pieces, also after the curve was made 20 m wider; written into the project file and read back. The signal and its memory cell anchored with 0.9 or more, the poles with 1, every wire bound to its two poles, the tree and the cabinet doubtful; the curve made wider: the objects along it follow at their chainages and offsets, the signal on the straight before it stays; the anchors written into the project file and read back. The case of the project file which kept the section of the anchors as text reads and writes two anchors now. Unit tests 1104 -> 1108. |
||
|
|
5b83a5c1bc |
feat(editor): the old tracks of a scenery chained and taken over as lines by one command of the model, the norms told, not refusing
E6 (editor-tracks-domain.md §10): a set of old tracks made lines of the domain in one step to undo (editor/layout/layoutLegacy and the command take_over). Model only: the question with a preview before and after is the editor's, after E4a. - legacy_track: an old track as its entry has it, in the world, with no scene: its name, its paths, the words before and after them. walk_chains(): the plain tracks of the set chained the way a train runs them (the chain walking of the old digitization, kept): a track joined at an end to exactly one other plain track of the set, within the 2 cm the simulator joins them within, goes on into it; a switch, a track not taken over, a fork or a free end ends the chain, held in the heading of the main path of the switch or of the track holding it, which the line runs on from. Each chain runs from its end the smaller in x, then in z, whichever track it was found from. - plan_takeover(): each chain recognized (layoutRecognition), its held ends kept, the old tracks along it as its hard splits (a track named none of no name), the class of its line of the highest speed of its tracks; the deviation of each line and the worst of all; silent where each line keeps within the tolerance. Nothing is laid. - take_over, a command of the model: the lines between new nodes at the ends of their old tracks, their vertices, grade lines and old tracks as recognized. The invariants refuse it as they refuse any command; the norms don't: the BLOCK limits the old tracks pass are told in outcome::broken (an old track may break the norms where nobody touched it, improving it is a separate decision; edits of the lines after it are judged by edit_policy::no_new_block). take_over_tracks() executes it and returns the deviation of each line and whether the takeover is silent, for the question. - A switch stays an old track, a fixed constraint: the lines end at its legs in its headings. Its type recognized in the catalogue and the switch laid into the line as a turnout, so the line runs on through it, is left for later. Tests: U: the line of three curves cut into old tracks, each written the way it was: the tracks in three random orders, seeds 4401, 5502 and 6603, the walk starting from another one of them each time: the same line, its vertices to 1e-6 m and its radii and transitions to 1e-9, the same old tracks at the same chainages. Unit tests 1103 -> 1104. |
||
|
|
d87da1c476 |
feat(editor): the joints of old tracks as hard points of the pieces, the names, events and circuits of the old tracks kept by the lines
E6 (editor-tracks-domain.md §5 "Podział na kawałki zachowuje miejsca...", §10 "Stare złącza jako twarde punkty podziału"), the hook of the generator E2a left (generator_options::hard_splits, a line given any refused). - A line keeps the old tracks it was taken over from (line::hard_splits): where along it the stretch of each begins, its name, the words of its entry before the path (the width, the friction, ... the visibility and the materials) and after it (the speed, the events, the isolated circuits and the rest), whether it ran against the line. In the line rather than in the options of the generator, so a command which cuts or joins lines carries them and an undo puts them back: a line cut (split_line, a turnout laid into it) gives those past the cut to the part after it, and the old track cut in two keeps its name and its events on the part it ran into first, the other part a stretch of it the generator names (continued); two lines joined, the second one's after the first one's. - The generator ends the pieces at each joint inside the line (a joint stays, a break of the elements next to it gives way) and writes the pieces of a stretch as the old track was: its name on the piece it ran into first with all its attributes, <name>_2, <name>_3... on the others with them but its events (an event of a track is called once), its surface, the path written the way it ran (event1 and event2, the sign of the rolls); an old track of no name named by the generator, its events kept. A line with none is made as before. - The project file: "old <chainage> <name> reversed <0|1> continued <0|1> surface <words> attributes <words>" in the block of a line; version 1, unreleased, read as before without them. Tests: G: a line of three curves given three old tracks (one named with its events and its circuit, one of no name, one which ran against the line): the pieces end at the joints, each name once, the attributes of the first on its first piece and without its event on the others, the event of the unnamed one once, the one which ran against the line written from the end of the line; written into the project file and read back the same. It takes the place of the E2a case of the hook refusing. Unit tests 1103 -> 1103. |
||
|
|
3f5f2af1ce |
feat(editor): the old tracks recognized as lines of the domain: the curves read off the curvature, fitted by least squares, the deviation measured
The first part of E6 (editor-tracks-domain.md §10 "Automatyczne przejęcie odcinka", editor-tracks-tests.md §4 "E6"): a chain of the paths of an old scenery, Bezier curves drawn by hand or by older tools, made a line of the domain (editor/layout/layoutRecognition). Model only, nothing of the editor asks it yet. - The chain sampled along its arc length in the plan, every metre for the fit and every half metre for the deviation, each joint with the turn of the heading there: the point, the heading and the curvature of the Bezier curve as the simulator draws it, the cant of the roll turned evenly with the parameter as the simulator turns it (1500 mm sin roll, of the other sign where a path runs against the chain). - The curves found where the curvature changes: the heading differenced over 30 m (the noise of the ends of the old paths, written to the millimetre, and the ripple of the Bezier curves evened out), runs of one sign past 1/5000 m; a run whose curvature falls to a third of what it is on both sides cut in two; the arc of each where the curvature is half of it or more (the area over that width is the turn), its transitions where it rises from a tenth to nine tenths, the window taken off; a turn of more than a quarter of a circle laid as curves of a quarter at most. A turn of more than 5 mrad at one joint making up a curve is a kink (told, laid as the shortest curve which fits); an arc whose halves differ by a quarter is a compound curve (told, laid as one). - Each curve a vertex of the domain, clothoid - arc - clothoid, its point where the straights fitted around it cross; then the points, the radii and the transitions of all of them fitted by least squares to the offsets of the points of the chain from the line the domain lays (Levenberg-Marquardt, the Jacobian by differences over the points each parameter moves; the transitions by their squares, since what a transition moves the curve by grows with its square; the points and the radii first, then all of it). An end held by what stays beyond it (a switch, an old track not taken over) keeps the first or the last vertex on its heading. The curves the curvature doesn't show (a radius over 5 km, a turn spread over the joints) are added where the line keeps off the points by the tolerance, six at most; the small turns of old tracks laid jagged, joint by joint, are left out where the line keeps nearer without them; where it keeps more than a metre off, the plan of the added curves alone is tried; a vertex whose tangents cross behind the curve tells nothing of it, and a vertex no radius lays is taken out. - The cant of each vertex fitted to the rolls along its arc and its transitions; a cant the rolls ramp up with no transition under it is fitted again with transitions as long as the ramps, kept where the line keeps nearer so. The grade line: the heights as straight grades within 1 cm (Douglas and Peucker), the heights of the breaks by least squares, each vertical curve the largest of the usual radii which keeps within it. - The deviation measured densely: each point of the chain every half metre set square onto the line, the farthest and the root mean square of the distance in the plan, of the height and of the cant, where the farthest is. The tolerance of a takeover with no question (takeover_tolerance): 20 mm in the plan and in the height, as the simulator itself joins the ends of the tracks within 2 cm, so the tracks made again lie where the simulator takes the old ones to be; 10 mm of the cant, 0.4 degree of the roll, under the half degree many old files round the rolls to. The norms aren't asked here. Tests: U: three curves (R 800 m with clothoids of 80 m and 60 mm, R 600 m with 60 and 70 m and 90 mm, R 1500 m with none) and a grade line with two breaks, cut at random places 8 to 25 m apart, each piece a Bezier curve, the joints shaken by up to 4 mm across and in height, the rolls rounded to the tenth of a degree, seeds 1101, 2202 and 3303: the radii within 1 %, the transitions within 3 m or moving the arc within 5 mm of where the laid ones move it, the cants within 3 mm, the deviation within the tolerance; the same walked the other way round, the transitions swapped. A kink of 0.6 degree at a joint told and laid within the tolerance; an arc of 11 km found where the curvature shows none; an end held in a heading 2 mrad off the chain kept to 1e-9 rad. Unit tests 1101 -> 1103. |
||
|
|
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.
|
||
|
|
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. |
||
|
|
84dca7cccb |
feat(editor): the //$r switches of an old scenery on the lines of its alignments made turnouts of its project
E5, what E3 left (editor-tracks-domain.md §9 "Migracja"): the //$r records were kept in the project file as a block a file; the switches among them which the domain can lay now become its turnouts when the map is first opened. - A switch or a double switch of the editor becomes a turnout where its record names a type of the catalogue (its type, rail, radius, ratio and a, b of an ordinary or a symmetric one; the first of the catalogue's order where a movable nose is the only difference, which the record doesn't keep), its start lies on a line made of an alignment within a centimetre and its direction along the line or against it, and its main track is bent as the record says the line is there (straight, or the radius within 5 %). It's laid into the line by the command insert_turnout, the hand of the record, with edit_policy::no_new_block: the old line may break the norms where nobody touched it, the turnout may add no BLOCK finding to it. - Its record goes on its own into the project with the main track of the turnout (as an //$h record keeps the line it became); the rest of the block stays as written, the comments with it, why each switch didn't become a turnout with it: a slip or a crossing (their records don't tell the side of the crossing track), a connection (the solver of the connections lays it anew), a lifted outer track, no type of the catalogue, no line under it, a bending other than the line's, or the reasons the command refused it for. A block none of whose switches became one is kept as before, with the reasons. Tests: U: an alignment of data/records with five //$r lines: two switches on its straight, along it and against it, to the left and to the right, made turnouts of their types at their starts (the structure whole, no reason); one beside the line, one of no type of the catalogue and a connection kept in the block with the comment, each with why; the two records each with the main track of its turnout; the project written and read back the same. The records of data/records and of the map of data/project/migration (no switch on a line) kept whole as before. Unit tests 1096 -> 1097. |
||
|
|
efcc28b0ed |
feat(editor): the solver of the connections of the tracks: a crossover between two lines, the norms of the straight and the spacing
E5 (editor-tracks-domain.md §7 "Połącz tory", §8 "Połącz dwa końce ... odmowa ... z najlepszą propozycją"): editor/layout/layoutConnection plans a crossover between two lines running alongside, straight or curved, and the command connect_tracks lays it, one step to undo. - The first turnout where it's asked for, toward the other line; the second one on the other line running back, its diverging track facing the first one's, where the line between their ends turns by as much at both of them: on one straight between straights alongside (the headings of the ends within 1e-13 rad), one curve between curved lines. Found by the secant along the other line, each try the turnout laid in a copy of the network, so it's put as the command will put it. - The spacing of the lines measured along the whole crossover, a point every metre, not where it starts; the least of it against the least spacing of the type: of ST-T1-A6 tab. 11.2 where the catalogue gives it, or what its geometry needs with the least straight between its turnouts (crossover_spacing()), the larger. - The least straight between the turnouts from the norms: a new parameter of the E1 module, switch_straight, at the speed through them: max(0.15 V; 6) m in the running and the main tracks (11.3 pkt 7d, WARN), 30 m on a line of 160 km/h or more (pkt 7e, BLOCK; the new feature fast_line), 6 m recommended in the side tracks (pkt 7c). The solver asks for the normal limit. - Where they can't be met: refused with the reasons and the best which fits the spacing measured, a type of the catalogue of the rail of the one asked for before the others, the fastest; or that none fits, and the spacing the type asked for needs. - The line between the turnouts runs at the speed of their diverging tracks and is a part of the connection of the tracks for the norms (the feature switch_track of its class, which describe_chain() puts on its elements): an arc with no transitions nor cant where it isn't a straight, and the steps of the cant deficiency and the elements between them judged as in the tracks of turnouts (tab. 9.15, 9.16). Tests: U: crossovers of Rz 60E1-500-1:12 between straights 4.75 m apart, both ways to both sides: the spacing 4.75 m all along, the straight between the ends (4.75 m less twice the offset of an end) / sin(1:12), the norms' 9 m at 60 km/h, the ends facing each other on one straight, one step to undo; a line closing in on the other refused for its spacing along the crossover though wide enough at its start; 0.15 m short of the spacing for the 9 m straight refused with "11.3 pkt 7" and a type proposed, which then is laid; 30 m on a line of 160 km/h; Rz 60E1-760-1:14 refused at 4.74 m by tab. 11.2 though its geometry fits; between two curves of R 1200 and 1195.5 m 4.5 m apart (4.50086 to 4.50087 m along it), both turnouts bent, one curve turning by 0.6 degree between their ends; a slip, a line to itself, a line across and a type of none refused; the rows of switch_straight. Unit tests 1089 -> 1096. |
||
|
|
bed4898ca6 |
feat(editor): the bending of the turnouts exact: table 11.8 for the whole diverging track, the main track on a transition as it is
E5 (editor-tracks-domain.md §4 "Rozjazd", §7 "Na łuku — łukowanie z dokładnym wzorem (tab. 11.8)"), what E2b left: table 11.8 for the curve of the basic switch only, the rest of the diverging track bent with the main track by the sum of the curvatures, a main track on a transition taken at its mean curvature, the sign of the curvature of the diverging track judged from headings sampled every half metre. - Table 11.8 written for the curvatures, r" = (R r -+ t^2) / (R +- r) as k" = (k + K) / (1 - k K t^2) with the tangent t of the basic switch, bends every curve of the diverging track and the ends of its transitions, each as long as keeps its turn off the main track (the angle of the frog); the curve of the basic switch keeps switch_curve::bent_radius(), the same numbers as before; a straight goes with the main track as before (the formula gives K for k = 0). On a straight nothing changes. - The frame of a turnout knows its main track: where its curvature changes under the turnout (a transition curve, or the end of one) the diverging track is laid in steps of 2 m at most, each one's curvature at its ends by the table with the curvature of the main track at the station it runs by (along the main track, its heading off the main one taken in), the turn of each part kept; the straights and the lead with the main track step by step too. - The curvature of a diverging track of one sign all along it, from its elements (9.7 pkt 12, 11.4 pkt 6): a BLOCK rule of the turnout in place of the sampled check of switch_curve (KZW II), which a short straight through the frog going the other way could slip through. Tests: U: a diverging track of a curve of 800 m, the curve of the basic switch of 500 m and a transition off it, bent with main tracks of 1200 m both ways and of 3000 m: each by the table with the tangent of the basic switch, the basic one the same as bent_radius(), each turning off as far as in the basic switch, on a straight to the bit as it was; Rz 60E1-500-1:12 60 m into a transition of 200 m to R 1200 m: laid in steps, its curvature at the start by the table with the main track's there, growing along it, the frog against the main track where it ends beside it at 1:12.0004 (1:11.9966 by the mean curvature, the end 27 mm apart), moved and back the same; Rz 60E1-190-1:9 bent two-sided refused, its curve turning off to its side and the straight through its frog the other way (KZW II), one-sided not. Unit tests 1086 -> 1089. |
||
|
|
ca1f2239df |
feat(editor): the double, symmetric and secant switches, the slips and the crossings of the catalogue in the domain model
E5 (editor-tracks-domain.md §4 "Rozjazd", §7): every type of the catalogue is a turnout the model lays, its tracks lines it owns and its legs nodes, kept whole or refused like the ordinary switches E2b laid. E2b refused the rest with "stage E5". - Secant blades (S42): the diverging track runs along the main one for the pre-blade stretch and turns off it by the angle of the blades at their tips, the rest of 1:n on its arc; a turn inside the track, the node at the start keeping the heading of the main track. The generator ends a piece there with the heading of the element before it (unchanged where a line runs on in its heading). - Double switches (Rpd, Rpj, Rps): the main track cut at the start of the second switch, its node holding the main track, the main track of the second switch (main2) and its diverging track, to the other side or the same one, as switch_design::build() lays it. Written as the switch tool writes them: the first switch, a plain track of a metre before the second one (the simulation joins a switch to plain tracks only), the second switch. - Symmetric switches (Rls): both tracks turning off by half of the angle, to both sides, laid at a free end of a line, which they end (the line beyond it would have to turn at the node); not moved along the line. - Slips (Rkp, Rkpd) and diamond crossings (Skrz): the main track a part of the line, the crossing track across its middle at the angle of the slip between two nodes of its own, the slip curves from the start to the end of the crossing track and, of a double slip, from its start to the end of the main track; slip_of() lays the curves with the blades of the ordinary switch of the rail, radius and angle (no data of the slips' own blades was found), passing the crossing as near as the rails of the simulator's profile let them. The three with the blades outside of the diamond whose curves then reach past the half length of Id-4 (49E1 190-1:6,6, 300-1:9, 500-1:9, by up to 0.3 m) are laid as long as their curves. Written as the switch tool writes them: a switch at each leg a slip curve leaves, the tracks crossing and the middles of the slip curves plain tracks, the joints inside it the same numbers on both sides. - The rules: a double switch, a slip, a crossing (11.4 pkt 4 a, b) and a symmetric switch (no rule of table 11.8 for it) lie on straights only; an invariant, refused with the reason before anything is laid. The norms judge the tracks crossing at a slip or a crossing as crossings (no cant, tab. 9.6), its slip curves as diverging tracks. - The ends of the tracks of a turnout which carry no line through their node (the starts of the diverging tracks, the ends of the slip curves) are branch_end(); a node holds such an end beside a track of the same turnout on its side. settle() lays all the tracks a turnout lays itself (lay_tracks()), the nodes of its own where they end; lifting, moving, changing (to another kind too) and removing a turnout take all of them along. - The project file: the turnout record gets "second <node> <main2> <diverging2> <node>" and "crossing <line> <node> <node> slip <line>" where the turnout has them (diverging 0 0 for a crossing); version 1, unreleased, read as before without them. The generated section keeps each track a turnout is made of. - TSI INF 4.2.3.4(1), 150 m at least, judges the plain line, not the curves of switches (4.2.5): its hard row leaves out the tracks of the turnouts, so the industrial S42 switches of R 70 and 140 m are laid. Tests: U: every type of the catalogue laid (41 ordinary, 3 symmetric, 15 double, 18 slips, 20 crossings) on a straight to both sides along the line and against it, its legs where the catalogue puts them (the main track a + b, 1:n at the ends, the second switch at the stagger, the crossing track at the angle of the slip, half its length from the crossing), moved and taken out, the line one again, each a step to undo; the turn of the secant blades of S42-190-1:7 at the end of the pre-blade stretch; a double switch, two slips and a crossing refused in a curve, a secant S42 bent in a side track, a symmetric switch refused at the end of a curve. The three fitted to the tangents of S42-140-1:6,6 16/12 measured are refused by the norms (tab. 9.14) where the transition one is. P: 200 random edits with every type along arcs and transitions, seeds 5150, 2718 and 1618: the invariants after each, a refusal changing nothing, undone back to the start exactly. G: every type made into the tracks of the simulator and read back by TTrack::Load, the ends of the paths at the legs or at each other to the bit, the velocity and the frog; a double switch, a double slip and a crossing written to the project file and read back, their tracks laid again the same to the bit. The E2b case of the types refused now checks that they're laid. Unit tests 1077 -> 1086. |
||
|
|
e9f8b6a059 |
feat(editor): the catalogue of the turnouts a data file, the switch tool and the domain model reading it
The first part of E5 (editor-tracks-domain.md §7, "Katalog jako dane"): the types the editor lays its switches from were a table in switch_design::catalogue() and two in editor_track::standard_switch_templates(); now they are editor/data/turnouts.txt, one type a line, built into the executable as its text (CMakeLists.txt writes it out as editor_turnouts_txt.inc, as it does the icons), so the game data doesn't need it, and read once when first needed. - The format, which the templates of the user (eu07_switch_templates.txt) share: switch <name> <key> <value>... source <the rest>. A type of the catalogue gives its geometry as the instruction does (type, rail, radius, ratio, a, b, diverging, the blades tangent or secant, the cut tip of the blade; stagger and the keys of the second switch of a double one; middle and the half length of a slip; fit for the three fitted to measured tangents), the parts made of it as before; a template of the user gives its parts. What §7 asks besides the geometry, - where the source has nothing: the frog (fixed or movable), the locks (Id-4 tab. 14-3), the drive, the speed of the diverging track (ST-T1-A6 tab. 11.2), the bending (tab. 11.9), the least spacing for a crossover (tab. 11.2) and the source of the values, unconfirmed ones said so: the cut tips of SKMd-4 (190, 300, 500, 1200 m; 760 m the editor's own), the secant blades of S42 at 25' and the one fitted for S42-140-1:7, the a and b of 2500-1:26,5, the slips' blades (not found), the tip of a blade with no data by the rule sqrt(2R 0.005) - 0.125. - read_designs() reads the format, a line which isn't one left out with why; catalogue() the switches as before, in the same order, slips() the slips and the crossings, catalogue_entries() all of them, read once (secant_blade() no longer builds the catalogue at each call). - The slip curve and slip_of() moved from editor_track to switch_design, which the domain model lays its slips with (E5); editor_track keeps the names. - A template of the user with a movable nose writes frog movable, which it lost before; without one the line is what the builds before wrote (they leave out a template with a key they don't know). The lines they wrote read as they did. Tests: U: every switch of the data file the same to the bit as the catalogue of the code (kept in the test as it was), the slips and the crossings as the switch tool had them; every line read, with its source; each switch against Id-4 and ST-T1-A6: R, 1:n, a, the main track a + b, the pre-blade stretch, the blades (the tip lead + cut where the sheets give it, about sqrt(2R 0.005) - 0.125 where they don't; secant at 25'), the speed of tab. 11.2, the bending of tab. 11.9, the spacing of tab. 11.2; the rule of the tip against the sheets (190 m +3 mm, 300 m +105 mm, 500 m -56 mm, 1200 m +3 mm; the 4.5 mm rule +60, +143, -44, -49 mm); a template keeping its movable nose, an old line read as before; lines left out with why. Unit tests 1070 -> 1077. |
||
|
|
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.
|
||
|
|
ac5e735f91 |
feat(editor): the scenarios using a map and the tracks, events and memory cells they name in it
The last part of E3 (editor-tracks-domain.md §0 pkt 7, §3 "Indeks scenariuszy"): a change of the map mustn't take away what a scenario relies on. Read only, from the text of the files as the simulator reads it; nothing of the editor asks it yet (E4, E7). - The scenarios are the *.scn files of the scenery folder. A quick look at the include words of the files, each file once for all of them, tells which may reach the file of the map; those are read whole (sceneryText), their includes followed with the parameters of the templates, the terrain passed over where the scenario has its binary terrain. A scenario uses the map where the file of the map is among its files. - What the map defines: the tracks, the events and the memory cells of the statements of its files. What a scenario names in it: of the statements outside the files of the map, the tracks the trainsets start on (anywhere, a scenario being its own map too) and the vehicles standing on their own; the events called by multiple events, by event launchers and by the tracks of the scenario; the cells and tracks acted on by the events (updatevalues, getvalues, copyvalues and its source, whois, logvalues; switch, trackvel, trackbuckle), checked by their conditions (memcompare, trackoccupied, trackfree) and by the launchers; the tracks of the scenario's cells and isolated circuits; the events named after a track of the map, <track>:event1..., which the track calls. Each with what names it, the file and the line. The names as the parser makes them, A to Z small. - Not seen: the names the simulator makes (the tracks of the roads, the turntables), the scripts, the timetables, the commands the cells give the drivers, the random includes. Tests: U: data/project/index, a map of tracks, events and memory cells, some from a template included with parameters at an origin, and three scenarios: two using it (one through a file of its own) with their trainsets, vehicles, events, launchers, cells and isolated circuits, listed in full; the trainset on a track of the scenario, the names in comments, an event of none_ and a name of nothing left out; the scenario of another map with tracks of the same names not among them. The include tree read with the parameters and the placements; the words split as the parser splits them. |
||
|
|
f24714c6d6 |
feat(editor): the //$ lines of an old scenery taken into the project file when its map is first opened
Continues E3 (editor-tracks-domain.md §9 "Migracja", §10): what the //$ lines describe of the track geometry becomes the lines and the nodes of the domain where the domain lays it as the editor laid it; the rest is kept in the project file as it was written. The lines stay in the scenery files, untouched; the scenery files aren't written. - //$h, an alignment: a line between two nodes at its ends, its vertices where the design puts them (from the tangents of the ends for one, by the offsets for the first and the last of more), their radii, transitions and cants, the shape of the transitions, the origin as the chainage of the start, the speed as the highest of the class; a curve going on from the adjoining track as an end going on from the curvature and the cant of its node. Not a compound curve, two transitions with no arc between them, cant ramps of its own, a curve turning the longer way, a curve going on from a switch, a design kept for a part of its line, nor one the domain lays to a length 5 mm off the old one: kept as it was, with why. The free ends of two lines within 0.5 mm, running on from one another, join at a node (a turn of the headings over 1e-9 rad told). The record is kept whole in the project with the line it became: the points clicked, the old norms, the pieces and the fit have no place in the domain yet. - //$p, a grade line along such a line (its ends and length within 5 cm, either way): its breaks with their vertical curves as the breaks of the line, the heights of its ends as those of the nodes; not one with a break of no vertical curve, or along no line, or one the line can't be laid with. Kept whole too. - //$r switches (E5), //$k the kilometrage of the railway lines (the line's own chainage is the //$h origin), //$t the tracks fitted, //$w the tracks sharing a grade line, //$b the objects bound to the tracks (E6, the anchors), //$s the stations (E7): no place in the domain yet, kept as they were, a block a kind a file. //$c, //$o, //$z, what the editor keeps of itself, aren't taken. - The lines read as the editor reads them: the old letters of the marks under the new ones, the lines other tools put after the same marks (Rainsted's includes after //$r) left out. marked_files() finds the files of the map with their includes followed and the placement in effect at each; open_project() reads the project of the map, or makes it of the //$ lines and writes it where there's none. Tests: G: the sceneries of data/records/ made into a project: the alignment of clothoids a line within a millimetre of the old design along all of it, the one kept for a part of its line and the grade line along nothing kept with why, each other kind kept as the file has it and read back by editor_records as from the scenery, the camera, the orthophoto and the area left; written and read back the same. A map of data/project/migration (its tracks included at an origin) opened the first time: two alignments joined at a node in the world, the grade line of the second one its break and the heights of its ends, the one along the first refused for a break of no vertical curve, the compound curve kept; the scenery files byte for byte as they were; opened again, the file read and not made again. |
||
|
|
c912ed2ab1 |
feat(editor): the tracks the generator wrote kept by their checksums, a track changed by hand marking its line
Continues E3 (editor-tracks-domain.md §9, "Ręczna zmiana wygenerowanego węzła ... wykrywana po sumie kontrolnej"): the generated
section of the project file and what the scenery files hold of it now. Nothing of the editor writes the tracks yet (E4).
- generated: a record a track the generator wrote, its name, its line, the file it's written into and the FNV-1a checksum (64 bits)
of its text as the simulator reads it: the words joined by one blank, the comments left out, so the line ends and the blanks
another tool writes aren't a change; the switch track of a turnout kept by the main track of the turnout.
track l1_s11 line 1 file trasa/tory.scm sum 0123456789abcdef
switch t1 line 2 file trasa/tory.scm sum 00000000000000ff
hand 3
record_generated() puts the pieces of a line, or the switch track of a turnout, in the place of the ones the project had of it;
find_hand_changes() looks the names up in the text of the files now: a text of another checksum, or a track gone, or a file which
can't be read; mark_hand_changes() marks their lines changed by hand (hand <line>, kept by the file), may_overwrite() tells the
editor to leave them, until the line is written again by the editor (the author decided).
- editor/project/sceneryText: the text of the scenery files read as cParser and state_serializer read it, with no scene: the words
(blanks and semicolons between them, // and /* */ comments, the quotes), the node of a name and its words up to the end word of its
type, and the statements of a scenery with its includes followed relative to the scenery folder (the words of each file taken as
they're needed, the includes no deeper than 32), the parameters of a template in place of (p1)..., the placement of origin, rotate
and scale at each include, the terrain files passed over for a binary terrain. The scenario index and the migration read the files
with it.
Tests: U: two lines generated into one file among other nodes: as written nothing is changed, through the project file too; the speed
of a track of the second line edited: that line and that track told, marked changed by hand once, kept by the file, the first line
not; written again, not marked. The switch track of a turnout: its speed edited marks its main track. Blanks doubled, the line ends of
windows and comments inside a track aren't a change; a track taken away, a file which can't be read are. The node of a name found by
the words.
|
||
|
|
9c76001e9a |
feat(editor): the project file of the track geometry, one per map, of a schema of its own
The first part of E3 (editor-tracks-domain.md §9): the domain of the editor written next to the scenery, the .scn and .scm files
staying what the simulator reads. editor/project/projectFile reads and writes it, nothing else does; nothing of the editor uses it yet.
- <map>.eu07proj next to the file of the map, shared by the scenarios of the map; plain text, a line a record, the version of the
schema on the first line. Version 1:
eu07proj 1
next node 9 line 8 vertex 1 turnout 3
norms plk
area granica ch 4 -500 0 -100 0 -100 400 -500 400
lineprofile 91 en13803
class 1 vmax 80 vmin 0 traffic mixed track main load 5 features 0
node 3 at 300 101.2 0 heading 1 0 curvature 0 cant 0 grade 0.004 ends 3 1 end 1 2 start 1 4 start 1
line 1 from 1 to 3 class 1 chainage 0 transition clothoid ramp linear continues 0 0 turnout 0 profile tsi
vertex 2 at 0 800 radius 300 in 60 out 60 cant 40
grade 200 101.5 5000
end
turnouts
turnout 1 type Rz%2060E1-500-1:12 hand 1 direction 1 start 3 main 2 4 diverging 4 5 chainage 300 radii 0 500 cant 0
speeds 80 60 velocity -60 movable 0
end
anchors ... end kept for E6 as read, empty in version 1
generated ... end the tracks the generator wrote (the next commit)
legacy h trasa/tory.scm line 1 [why ...] / | <the //$ line> / end the //$ lines read when the map was first opened
The profile of the scenery, the areas and the lines by name; the classes of the lines, each one once, the lines naming theirs; the
nodes with all they hold, the ends in their order; the lines with their vertices, grade breaks, shapes, chainage, turnout and
profile of their own; the turnouts of E2b with their legs, their tracks and what they derive. Numbers in the shortest form which
reads back to the same double, names and files with %20 for a blank.
- Read: the lines laid between their nodes as read, then the diverging tracks laid by their turnouts off the main tracks, the nodes
and the turnouts as written; what refers to what checked (a line's ends held once by its nodes, the classes there, the turnouts and
their tracks each of the other); a file of a newer schema refused before anything of it is read, with the reason, as is one which
isn't a project file, has a record not of its version or a section not ended. Saved through a file next to it put in its place.
- The identifiers handed out are kept (next), so none is handed out again after a load, whatever was deleted before the save:
layout::network gets handed() and hand_out(), the turnouts' counter with them; nothing else of editor/layout changes.
Tests: G: a network edited by the model (a line deleted between two) written, read and written again: the same text, the lines laid
again the same to the bit as the model laid them; two turnouts, one against the line, and a line of a profile of its own: the same to
the bit, the diverging tracks too (the network as settle() leaves it: the model lays the diverging track of a turnout against the line
before the node at its start takes the grade of the line beyond it, 1e-16 off); the golden file of data/project/ read and written back
the same, with the line ends of windows too; the anchors kept as read. A newer schema, an empty file, not a project file, broken
records (a turnout whose track isn't its among them) refused cleanly. U: the identifiers after the last line is deleted, a save and
a load: the next line, its nodes and its vertices numbered past them.
|
||
|
|
b0f7744434 |
feat(editor): the switch tracks of the simulator made of the turnouts of the track geometry, the legs at their nodes to the bit
The generator (editor-tracks-domain.md §5, "Rozjazdy") makes a turnout one switch track entry TTrack::Load reads: the paths of its main and its diverging track, each from the start of the turnout. - Each path the pieces of its line as the generator cuts any line (within 0.5 mm of the elements, the rolls and the heights from the line), turned round where the main track runs against the turnout, written as pieces1/pieces2; the path itself the curve between their ends and headings for the versions which know only the path, or the one piece where one makes it. The ends of both paths are the numbers of the nodes of the legs, so the tracks on the other side of them meet them to the bit. - velocity as the speed rule gives it (the main limit for both where it's the lower, else the diverging one below 0), frogs, the movable nose and the blades of the type where it has them; the name <turnout_prefix><turnout>, t by default. - A track of a turnout isn't made as a line of its own; generate_all() makes the lines, then the turnouts. Tests (G): turnouts on a straight with a grade (a 1:12 to the left along the line, a 1:9 to the right against it, a 1:26.5 with a movable nose) and one bent outward into R 1200 m with 60 mm, written and read back: both paths from the start node, the main one to the end of the main track, the diverging one to its end, to the bit; the pieces as written, joined to the bit, each within 0.5 mm of its line both ways (the farthest 6e-6 mm: short arcs of one Bezier curve each); the radius of the bent diverging curve; the velocity, the movable nose and the frogs read back; the tracks of the lines on the other side of the legs ending there with the same numbers and rolls (of the other sign where they meet head on). The diverging track of Rz 60E1-2500-1:26,5 as the simulator draws it within the chord offsets of Id-4 (30 m chords, 41 to 49 mm in the middle): 45.0 mm all along, 130 km/h on it. Left for E5: the catalogue as a data file (now switch_design::catalogue() in code), the double, symmetric and secant switches, the bending exact everywhere (now table 11.8 for the curve of the basic switch, the rest of the diverging track bent with the main one, a main track on a transition taken at its mean curvature), the connection solver (crossovers, the spacing measured along). |
||
|
|
6f0b8be091 |
feat(editor): the edits E2a left: vertices, the grade line, the class and the profile of a line, a join from a curve, no new BLOCK
The rest of the list E2a left for E2b (editor-tracks-domain.md §8), commands of the domain model of the track geometry like the others: kept whole or refused with the reasons, one step to undo. - insert_vertex (after a vertex, or after the start, with its radius, transitions and cant, its id given) and remove_vertex. - set_grades: the breaks of the grade line with their heights and vertical radii; checked by the solver (overlapping vertical curves) and the norms. - set_line_class and set_line_profile: the class of a line (its speed, traffic, main or side track) and a profile of the norms of its own (the line's own wins over the areas, as norms::area_map has it); a chain of the norms doesn't run on into a line of another profile of its own. The tracks of a turnout take a class too, their speeds derived again. - join_ends from a free end in a curve (a line cut inside one): one curve where the tangents meet, going on from the curve at the end, its arc of the radius there with no transition (or, where that doesn't fit, a radius the norms prefer and a transition from the curvature of the end), the transition at the straight end as long as makes the curve begin right at the curved end (bisected to the bit), refused where both ends lie in curves or the curve would turn the other way. The original join and this one lay the new line the same way (add_joined). - edit_policy::no_new_block for old tracks (stage E6): an edit is refused by a BLOCK finding only where it adds one; one there before, of the same parameter on the same stretch (the elements within 1.5 m, the findings carry their element as points of the plan) and no worse, doesn't refuse; the same rule of the same turnout neither. The invariants refuse in any case. model(network) takes a network over as it is, the norms not asked. Tests: U: a vertex put in and another after it, both taken out, the line as it was; a grade break and its vertical curve, two overlapping and one of no radius refused; a class of 200 km/h refused on curves fine at 80, one of 60 kept; R 280 m at 80 km/h warned by PLK, not by the TSI as the line's own profile; a line joined to a free end in an arc going on from it with the transition the part taken away had, the track the same within a micrometre; both ends in curves refused; R 170 m laid by the TSI and judged by PLK: an edit refused when any BLOCK refuses, kept with no_new_block, a sharper curve and a cant past (R - 50) / 1.5 refused, a wider curve kept. P: 250 random edits of an old track breaking the norms (curves laid for 80 km/h judged at 120), seed 4242, with no_new_block: no BLOCK finding over all the network which wasn't there before, a refusal changing nothing, an undo exact; the random edits with turnouts put vertices into straight lines and take them out. |
||
|
|
4a3b36c204 |
feat(editor): the turnouts of the track geometry, laid into a line, moved, changed and taken out, their legs nodes
E2b (editor-tracks-domain.md §2, §4 "Rozjazd", §7, §8): a turnout is an aggregate of the domain model, laid from the catalogue the editor lays its switches from, its rules invariants which refuse. - layoutTurnout: the type of the catalogue (switch_design::catalogue(), Id-4) as the model lays it: R, 1:n, a, b, the main length, the lead and the parts of the diverging track, the movable nose, the blades; the ordinary switches whose diverging track leaves tangentially, the double, symmetric and secant ones refused with the reason (E5). The diverging track laid off the start along the turnout: on a straight the curve of the type; bent with the main track the curve of the basic switch of the radius of table 11.8 (switch_curve::bent_radius), over the length which keeps its turn off the main track, so the angle of the frog stays 1:n, the lead and the straight through the frog bent along with the main track; the cant of the main track all along it, the grade of its start. The speeds: the diverging one by switch_curve::branch_speed (the rule the editor writes), the main one the line's, bent no faster than the deficiency of the frog lets it; the velocity written by the same rule as the editor's. - The turnout: its type, hand, direction along the line, its start, the ends of its two tracks (nodes), its main and diverging track (lines it owns), derived: the kilometrage of its start, the bending, the cant, the speeds. The network keeps the turnouts with the lines and the nodes, in the snapshots of undo and in the transactions; settle() has a turnout whose main track or start changed lay its diverging track again, move the node at its end and lay again the lines going on from there. - The nodes: three ends at the start of a turnout, its two tracks on one side of it; the start of a diverging track tells its node nothing (the node keeps the curvature of the main track) and runs on into no line, the end of one sets its node. - check(): the turnouts whose tracks or legs are touched, their invariants (the legs, the tracks, the main track as long as the type) and the rules of Q2 and 11.4 through switch_curve::check (the curvature of each track of one sign, KZW II refused; the cant the same over it; the ends of the ramps at its ends or 6 m off it), a switch of 1:9.403 or steeper than 1:9 bent in a main track refused (the model knows a main track from a side one, where the editor only warns), table 11.9 and a transition under it as warnings. The norms of the E1 module with the switch context: the elements of a turnout track are a connection of tracks of their frog (fixed or movable nose: the deficiency of tab. 9.7), bent or not (the cant of tab. 9.6), at its speeds; the chain of the line runs through the main track, the element cut by a turnout open. BLOCK findings are kept apart from the broken invariants (verdict::blocks). - The commands: insert a turnout at a chainage of a line (cut at its legs, the part between them its main track), move it along its line (the lines on both sides and its main track one line again, cut anew, the ids kept, a line going on from the end of its diverging track carried with it), change its type or hand, remove it (the line one again where it can be: the merge laid and kept only where it's the same track within a micrometre). The tracks of a turnout aren't split, deleted or edited as lines; a line is joined to the free side of a turnout's start, or to the end of its diverging track from a straight (the curvature stepping there). Tests: U: the types laid and refused; the legs on a straight against the catalogue for four types both hands both ways (the main track a + b, the tangent of the diverging end meeting the main track at R tan(a/2), Id-4's a within half a millimetre, the angle 1:n, the speeds of table 11.2); Rz 60E1-500-1:12 bent outward and inward into R 1200 m with 60 mm (r" 857.8 m and 352.7 m, 60 km/h, the angle of the frog kept, the cant over it); refusals: KZW II, a ramp under it and 3 m off it, a 1:7.5 bent in a main track (laid in a side track), no type, no hand, no room; moved, changed, turned, taken out with the line laid again within a micrometre, each a step to undo; a line from the diverging end carried along. P: 250 random edits with turnouts each, seeds 20261124, 31 and 977 (laid, moved, changed, taken out, with vertices moved and set, splits, joins, deletions, undo, redo): the invariants after each (the legs and the nodes whole, three ends only at a start, the velocity by the rule), no BLOCK, a refusal changing nothing, an undo exact. |
||
|
|
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. |