17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-29 22:07:28 +01:00

fix: review findings of PR 217

- the pressures of the mover are in bar (MinCP=7.0 in the vehicle definitions), so the 0.2 the pneumatic horns
  needed was 0.2 bar; it's 2 bar now, and the tests take their pressures in bar too,
- the lamps of the ground relay and of the motor overload relays follow the pressure switch as the line
  contactors one does, TMoverParameters::MainCircuitLampsEnabled(), so the lamps of one cab go out together,
- the joint oil and fuel pump switch leaves out a pump started automatically, which ignores the switching:
  with one, it couldn't turn the other off, and showed off with both running (OilFuelPumpsEnabled()),
- the kind of the train heating switch comes from the occupied vehicle on entering the cab too, as in the
  switch commands; in a multiple unit these are different vehicles,
- CouplerForce() put the force taken back by the other vehicle on its far coupler when the vehicles faced each
  other (Couplers[1 - End] rather than the coupler it's coupled with),
- the velocity difference along the coupler axis computed once, CouplerVelocityDifference(), for CouplerForce()
  and CollisionVelocity(),
- the attachcoupler flag added without the SetFlag() call with 0, the index of the mirror moves noted as by side.

Tests: the coupler force of vehicles facing each other, the joint switch with an automatic pump, the lamps of
the main circuit, the horn and compressor pressures in bar.
This commit is contained in:
jerrrrycho
2026-10-17 17:15:28 +02:00
parent db220a1a98
commit 00805cfe77
9 changed files with 128 additions and 29 deletions

View File

@@ -424,3 +424,19 @@ TEST_CASE("couplers: automatic couplers of different control systems couple with
CHECK(pair.coupling() == (coupling::coupler | coupling::brakehose));
}
}
TEST_CASE("couplers: the coupler force of vehicles facing each other lands on the couplers holding them") {
// the force a vehicle takes from its coupler, the other one takes back on its own coupler of the pair, whichever
// way the vehicles face; it used to land on the far end of the other vehicle when they faced each other
auto first{automatic_wagon(5.0, "first")};
auto second{automatic_wagon(0.0, "second")};
test::pair pair{first, end::front, second, end::front, 1.0};
pair.run(5.0);
REQUIRE(pair.coupled());
pair.step();
REQUIRE(second->Couplers[end::front].CForce != 0.0);
CHECK(first->Couplers[end::front].CForce == doctest::Approx(-second->Couplers[end::front].CForce));
CHECK(first->Couplers[end::rear].CForce == 0.0); // nothing there
CHECK(second->Couplers[end::rear].CForce == 0.0);
}