mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 14:07:06 +01:00
e4b90ce744ecdeb5c92bccfe7eb6ecedb3270587
11 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
1311de4fbb |
fix(editor): an object past a split goes onto the part beyond it, the joints follow every line laid again, the old tracks read in any case and named apart
- follow() anchors an object again also where its line now ends before it: a split keeps the id for the part before it, so an object past the split was clamped onto the end of that part. - The joints of the old tracks follow every line settle() lays again with a reshaping command, not only the line the command names: a taken-over line going on from a turnout of the line edited kept its joints at their old chainages. - velocity and none of an old track are read in any case, as the simulator lowers its tokens. - A line merged with one with no old tracks where it starts keeps that part out of the old tracks, rather than giving it the name and the circuit of the last old track of the first line. - <name>_2... of the pieces of an old track pass over the names other old tracks of the line have. - The old records of a line are refused on read where they aren't on the line or not in their order. |
||
|
|
b267da1d6e |
Merge branch 'feat/editor-model-in-editor' into feat/editor-legacy-takeover
The section of the anchors is read as anchor records here, its comments skipped as in the rest of the file: the fix of #461 keeping the lines of the section as they were read doesn't apply, and its test gives way to this branch's. |
||
|
|
cfc56e2965 | Merge branch 'ui/editor-lay-flow' into feat/editor-turnout-catalogue | ||
|
|
9d5e32980f |
fix(editor): the anchors section keeps its blank lines and comments, a reason keeps its blanks, a scenery including itself is told
- The section kept for the anchors is written back as it was read: its blank lines and its # comments were dropped before the section was looked at. - The reason of a legacy record is the rest of the line as written, its blanks kept: joined with one blank, a reason of two blanks came back changed after a save and a load. - A file of a scenery including itself, on its own or through others, is told and not read again; before, only the depth of 32 stopped it. |
||
|
|
eb376a2d3e | Merge feat/editor-model-in-editor into feat/editor-legacy-takeover | ||
|
|
28a81ee0bd |
Merge ui/editor-lay-flow into feat/editor-turnout-catalogue
# Conflicts: # editor/layout/layoutGenerator.cpp # editor/layout/layoutNetwork.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. |
||
|
|
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. |
||
|
|
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. |
||
|
|
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. |
||
|
|
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.
|