18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-20 13:54:58 +01:00

fix(ai): the AI switches the local converter of an interlocked section back on

The player switches the fans of the own ET42 section off (converterlocal_sw)
and hands the train to the AI. The AI only works the main converter switch,
and takes the converters for running as the other section's is, but with
LineContactorsInterlock=Converter the line contactors of the own section
stay open and the AI waits at the first controller position forever.

- Switching the converters on (the converteron action), the AI also puts the
  local switch back on in the vehicles under its control whose line
  contactors wait for their own converter.
- With such a switch off the AI doesn't take the engine for ready, so it
  goes back to preparing it, also when the switch is flipped while it
  drives. The human driver may still run with a section switched off.
- Vehicles without the interlock are left as they were.

The lever of the switch in the cab doesn't follow the AI, like the one of
the main converter switch; it is set anew when the cab is entered.

(eu07/maszyna#460)
This commit is contained in:
jerrrrycho
2026-11-11 15:00:41 +01:00
parent efe5b682f7
commit 2589cff5f4
4 changed files with 36 additions and 2 deletions

View File

@@ -241,6 +241,21 @@ TEST_CASE("line contactors interlock: a blower starting with the speed, switched
CHECK(std::abs(mover.Im) > 0.5);
}
TEST_CASE("line contactors interlock: held by the local converter switch only where they wait for that converter") {
// what the AI driver looks at to switch the converter of a section back on (TController, the converteron hint)
auto interlocked{ready("Converter")};
CHECK_FALSE(interlocked->LineContactorsHeldByLocalConverterSwitch());
interlocked->ConverterAllowLocal = false;
CHECK(interlocked->LineContactorsHeldByLocalConverterSwitch());
for (auto const *other : {"", "MotorBlowers"}) {
CAPTURE(other);
auto locomotive{ready(other)};
locomotive->ConverterAllowLocal = false;
CHECK_FALSE(locomotive->LineContactorsHeldByLocalConverterSwitch());
}
}
TEST_CASE("line contactors interlock: the ET42 section with its fans switched off doesn't start") {
test::consist et42;
et42.add(definition::fiz("et42_v2/112e-a").set("Cntrl", "LineContactorsInterlock", "Converter"), 1);