18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 18:47:06 +01:00
Commit Graph

1 Commits

Author SHA1 Message Date
maj00r 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.
2026-11-23 12:41:49 +01:00