18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-27 21:45:16 +01:00
Files
maszyna/tests/scenarios/cases/traxx_td_timetable.json
jerrrrycho 3ccd4fe73f fix(ai): read the motor parameters of ESMVelocity() within the table (#486)
* fix(ai): read the motor parameters of ESMVelocity() within the table

TController::ESMVelocity() indexed MotorParam with the field shunting
step of the next master controller position. For a position with a
step of its own that index is RList[].ScndAct, the sixth column of the
RList rows of the .fiz, which readRList() takes as it is. A step of 11
or more read past the 11 entries of MotorParam.

The pole flux is now read through motor_param(), which keeps the index
inside the table, as MomentumF() in the same loop and Momentum() already
do. Nothing changes for a .fiz with valid steps.

The unit tests show the loader keeping an out-of-range ScndAct and
motor_param() clamping it; ESMVelocity() itself is in Driver.cpp, which
the unit tests don't build.

* test(scenarios): a Traxx, with a brake handle with a time chamber, starting up

None of the cases had a driver's brake handle with a time chamber
(MHZ_K5P, MHZ_6P, M394, Knorr, St113, FVel6, FVE408), for which the AI
getting the vehicle ready has a rule of its own for releasing the train
brake (5775493b2). Three cases run a Traxx (E186, MHZ_6P) on td.scn: the
timetable run from a trainset ready to depart, the same from a cold
start, and the locomotive standing ready to depart with nobody in it
until a driver is put in. In each the driver puts the handle to running
and leaves.

* test: read the EP09 definition into a json with '=', not braces

GCC takes nlohmann::ordered_json in braces for an initializer list and
makes an array holding the parsed object, so at("RList") threw on the
Linux build (type_error 304); MSVC kept the object.
2026-11-25 05:15:27 +01:00

18 lines
883 B
JSON

{
"description": "Traxx (E186, p160dc) on td.scn, AI driver on the td/rozklad timetable: a driver's brake handle with a time chamber (MHZ_6P), for which the AI getting the locomotive ready has a rule of its own for releasing the train brake (5775493b2, #444). Starts from Stacja1, keeps to the speed limit, brakes to a stop at Przystanek.",
"base_scenery": "td.scn",
"time": "10:34",
"fragment": "td_timetable.scn",
"vars": {
"consist": "node -1 0 {{vehicle}} dynamic pkp/e186_v2 146_226-6 p160dc 0 headdriver 0 0 enddynamic"
},
"duration": 240,
"timeout": 600,
"checks": [
{ "type": "starts", "min_speed": 20, "within": 150 },
{ "type": "max_speed", "limit": 90, "tolerance": 3 },
{ "type": "brakes", "min_pressure": 0.5 },
{ "type": "stops", "moving_speed": 20, "stop_speed": 1.0, "hold": 0, "min_distance": 1380, "max_distance": 1420 }
]
}