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

fix: review of the separate engine start switches (eu07/maszyna#80)

- initialise the cooling power read from the .fiz to its default, no division by an indeterminate value
- integer step counters in the engine start tests
- main_sw opening the consist turns the two-state mainb_sw / mainc_sw off too, left on they'd start the engines again
- the doc comment of MainCircuitOpensWithStarterOnly() back on it; the .fiz read is the controlled vehicle's
This commit is contained in:
jerrrrycho
2026-11-08 17:38:59 +01:00
parent 46e0628fbe
commit 91e0d90e8d
5 changed files with 31 additions and 13 deletions

View File

@@ -3727,6 +3727,18 @@ void TTrain::OnCommand_linebreakeropen(TTrain *Train, command_data const &Comman
if (true == Train->mvControlled->MainSwitch(false, Train->mvControlled->MainSwitchRange()))
{
Train->m_linebreakerstate = 0;
if (Train->mvControlled->MainSwitchRange() != range_t::local)
{
// the engines of the vehicles in multiple stopped along: their two-state switches go off too, left on
// they'd start them again after the delay
for (auto &controls : Train->m_remotelinebreakers)
{
if (controls.main_switch.SubModel != nullptr && controls.main_switch.type() == TGaugeType::toggle)
{
controls.main_switch.UpdateValue(0.0);
}
}
}
}
}
else if (Command.action == GLFW_RELEASE)

View File

@@ -13,9 +13,10 @@ class TMoverParameters;
// starting the engines (closing the line breakers) of the vehicles in multiple from the cab (eu07/maszyna#80). in
// vehicles like the ST43, the SP32 or the SN61 every engine of the train has its own switches in the cab: main_* work
// the cab's own vehicle, mainb_* the second one and mainc_* the third one under its control. Engine:JointEngineStart=No
// in the .fiz of the cab's vehicle keeps main_* to that vehicle alone (TMoverParameters::MainSwitchRange()); by
// default it works all of them, as before.
// the vehicle the cab controls (TTrain::mvControlled: the cab's own vehicle, on an EMU its motor car), mainb_* the
// second one and mainc_* the third one under its control. Engine:JointEngineStart=No in the .fiz of the controlled
// vehicle (on an EMU the motor car's, not the one of the car with the cab) keeps main_* to that vehicle alone
// (TMoverParameters::MainSwitchRange()); by default it works all of them, as before.
namespace engine_start {
// the Number-th vehicle with an engine under the cab's control: 1 is Controlled, the cab's own; then the others