mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 12:57:06 +01:00
98e66d6228affae6e2a19354d290a21135c02b0e
9 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
28a81ee0bd |
Merge ui/editor-lay-flow into feat/editor-turnout-catalogue
# Conflicts: # editor/layout/layoutGenerator.cpp # editor/layout/layoutNetwork.cpp |
||
|
|
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 |
||
|
|
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).
|
||
|
|
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. |
||
|
|
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. |
||
|
|
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. |
||
|
|
555b77b11d |
feat(editor): the nodes of the track geometry and the commands editing the lines, kept whole or refused, one step to undo
Continues E2 (editor-tracks-domain.md §4 "Edycja = polecenie", §8): the lines meet at nodes, and every edit is a command which proposes a new state, has what depends on it laid again, is checked and kept, or refused with its reasons and nothing changed. - layoutNetwork: the node, its place (the only coordinates of the ends of the lines), the heading, the curvature, the cant and the grade, and the ends of the lines meeting there, each with its sense along the heading; the network of the nodes and the lines with the profiles of the norms by place and the identifiers handed out once, never again (an undone line made again is a new one). A transaction keeps each line and node the first time it touches it, so a change is rolled back whole or recorded. - settle(): the lines touched laid again; the nodes take the values of their ends (a free end follows its line, a node keeps the curvature and the cant a line going on from it reads), a line going on from a node whose curve changed is laid again. - check(): the invariants of the touched lines and nodes: laid, at their nodes, two ends at most on the two sides of a node (more is a turnout, E5), the heading the same within 1e-9 rad, the cant within 0.5 mm, the grade within the 2 per mille that needs no rounding; and the norms along the chains through the touched lines (the lines running on through the nodes as one line, the elements running on alike across a node as one, a jump of the curvature at a node a step of the deficiency the profile judges): BLOCK refuses, WARN and PREFER are told as notices. - layoutCommands: create a line between two new nodes; move a vertex; set its radius, transitions or cant; split a line at a chainage (the track kept as it was: on a straight, in an arc, in a clothoid with a straight ramp, the parts going on from the new node at its curvature and cant; refused inside a vertical curve and inside a Bloss or cubic parabola transition); join two free ends with a line solved between them (a straight, a curve where the tangents meet, or two curves, the largest radius which fits with the cant and the transitions the norms prefer, a grade line meeting the grades of the ends); delete a line (a node left with no end goes). The model keeps the network and the steps: undo and redo restore the snapshots of the lines and nodes a command touched, one step a command. Tests: the cases of each command, a refusal (a radius under the least, a cant over the greatest, curves overlapping, transitions too long) leaving the state as it was, a WARN radius kept with its notice, undo and redo, the track the same along a line split on a straight, in an arc and in a clothoid, a middle part deleted and joined again both ways round, a straight joining two ends on one straight. P: 300 random edits each with the seeds 20261123, 7 and 450 (moved vertices, new radii, transitions and cants, splits, joins, deletions, undo, redo): after each the invariants checked on their own (each element running on from the last, the cant running on, the ends of the lines at their nodes to the bit, the heading, the cant and the grade running on through the nodes) and no BLOCK along any chain; a refused command leaves the state as it was, an undo gives the state before the command. |