mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 17:37:09 +01:00
c508f5eef1fbaaefce65fac5d7bfe4815d08985f
3 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
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. |
||
|
|
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.
|