18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-27 23:57:09 +01:00
Commit Graph

3 Commits

Author SHA1 Message Date
jerrrrycho
a3df3a07c8 test: count the shunting seconds in a function of its own, not a lambda holding the vehicle 2026-11-17 00:48:28 +01:00
jerrrrycho
611dc365eb test: Sonar on the cruise control test: no empty statements, the lambda's captures named 2026-11-16 22:37:04 +01:00
jerrrrycho
dda38b6c0d feat: the cruise control apart from the field shunting (eu07/maszyna#69)
The secondary controller (ScndCtrl) is the switch of the cruise control
(SpeedCtrl) on the vehicles which have one: its first position switches
it on (IncScndCtrl), zero off (DecScndCtrl), and the speed buttons and
steps work only off its zero position. On the 6Dg, the ST45 and the
BR285, diesel-electrics with SpeedCtrl=Yes, the same controller shunts
the field of the traction motors by itself (AutoRelay), refuses the
driver's moves, and nothing could switch the cruise control on.

Now the cruise control has a switch of its own wherever the secondary
controller shunts the field (ElectricSeriesMotor, DieselElectric) or
there's none:

- IsSpeedCtrlSeparate(): which vehicles; IsSpeedCtrlEngaged(): on or
  off, SpeedCtrlUnit.IsActive for those, ScndCtrlPos > 0 for the rest;
- SpeedCtrlSwitch(): the driver's switch, on at the speed of the moment
  or off; on the others IncScndCtrl(1) / DecScndCtrl(2), as before;
- the buttons, the steps and the power limit go by IsSpeedCtrlEngaged(),
  the automatic turning off (SpeedCtrlATOF) by SpeedCtrlSwitch(false);
- the cab's tempomat_sw / tempomatoff_sw toggle it, and follow its state
  rather than the secondary controller's; the AI's SpeedCntrl() uses it.

The .fiz and .mmd formats are unchanged, with no new keys: the
SpeedControl section and the cab's scndctrl and tempomat_sw entries
stay as they are and now work side by side. Nothing changes for the
vehicles with only one of the two: the whole unit test suite matches
golden traces recorded before the change bit for bit.

Tests (test_speed_control.cpp): the field shunting of the EU07, SM42 and
SU45 and the cruise control of the Impuls and EU47 as before, the 6Dg's
and ST45's shunting as before, the 6Dg's and ST45's cruise control on
its own switch holding and changing the speed with the shunting going
on by itself, the 214M railbus switched by the secondary controller
through SpeedCtrlSwitch(). The 6Dg's definition joins
tests/unit/data/fiz as on test/6dg-power-steps-real-data.
2026-11-16 21:38:18 +01:00