18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-21 16:44:58 +01:00

fix(cab): a diesel with only the starter button stops its engine with the main switch off command (eu07/maszyna#427)

The SM03 had no way to stop its engine. Its fuel pump starts on its own, so the fuel pump switch is ignored; the
engine runs the converter feeding the low voltage circuit, so the battery switch doesn't starve the fuel pump either;
and its cab has only the starter button, for which TTrain::OnCommand_linebreakeropen() kept a legacy branch which
animated the button and returned without opening the circuit. MainSwitch(false) itself stops the engine fine.

The command now opens the circuit on diesels whose cab has only the starter button
(TMoverParameters::MainCircuitOpensWithStarterOnly()), without animating the button, which held down would start
the engine again. Other vehicles with only the button closing the circuit keep ignoring the command.

Tests: tests/unit/test_engine_shutdown.cpp, on a shunter made after the SM03.
This commit is contained in:
jerrrrycho
2026-11-07 10:05:10 +01:00
parent 466cbbbfa1
commit 7e426192b7
4 changed files with 136 additions and 1 deletions

View File

@@ -2466,6 +2466,13 @@ class TMoverParameters
{
return false == StLinFlag && MainCircuitLampsEnabled();
}
// whether the cab command opening the main circuit opens it where the only cab switch of the circuit is the button
// closing it: on a diesel that's the starter button, and the command is the one way to stop an engine whose fuel pump
// starts on its own (eu07/maszyna#427). the other vehicles with such a button keep ignoring the command
bool MainCircuitOpensWithStarterOnly() const
{
return EngineType == TEngineType::DieselEngine || EngineType == TEngineType::DieselElectric;
}
// whether the pumps a joint oil and fuel pump switch works, those not started automatically, are all switched on
bool OilFuelPumpsEnabled() const
{