17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-31 11:09:06 +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

@@ -4019,8 +4019,8 @@ void TTrain::OnCommand_oilfuelpumptoggle(TTrain *Train, command_data const &Comm
{
return;
}
// both pumps go off if both were on, otherwise both go on
auto const enable{false == (vehicle->FuelPump.is_enabled && vehicle->OilPump.is_enabled)};
// both pumps go off if both were on, otherwise both go on; a pump started automatically doesn't take part
auto const enable{false == vehicle->OilFuelPumpsEnabled()};
Train->ggOilFuelPumpButton.UpdateValue(enable ? 1.0 : 0.0, Train->dsbSwitch);
vehicle->FuelPumpSwitch(enable);
vehicle->FuelPumpSwitchOff(false == enable);
@@ -8980,8 +8980,8 @@ bool TTrain::Update(double const Deltatime)
btLampkaOpory.Turn(mvControlled->StLinFlag && mvControlled->ResistorsFlagCheck());
btLampkaBezoporowa.Turn(mvControlled->ResistorsFlagCheck() || mvControlled->MainCtrlActualPos == 0); // do EU04
btLampkaStyczn.Turn(mvControlled->LineContactorsLampLit()); // mozna prowadzic rozruch
btLampkaPrzekRozn.Turn(!mvControlled->GroundRelay && !mvControlled->ControlPressureSwitch && mvControlled->BrakePress < 1.0); // relay is off and needs a reset
btLampkaNadmSil.Turn(mvControlled->FuseFlagCheck() && !mvControlled->ControlPressureSwitch && mvControlled->BrakePress < 1.0); // relay is off and needs a reset
btLampkaPrzekRozn.Turn(!mvControlled->GroundRelay && mvControlled->MainCircuitLampsEnabled()); // relay is off and needs a reset
btLampkaNadmSil.Turn(mvControlled->FuseFlagCheck() && mvControlled->MainCircuitLampsEnabled()); // relay is off and needs a reset
btLampkaUkrotnienie.Turn(TestFlag(mvControlled->Couplers[mvControlled->CabOccupied == 1 ? rear : front].CouplingFlag, control));
btLampkaHamPosp.Turn(TestFlag(mvOccupied->Hamulec->GetBrakeStatus(), 1)); // lampka drugiego stopnia hamowania
// TODO: youBy wyciągnąć flagę wysokiego stopnia
@@ -11405,7 +11405,7 @@ void TTrain::set_cab_controls(int const Cab)
ggDoorStepButton.PutValue(mvOccupied->Doors.step_enabled ? 1.f : 0.f);
}
// heating
if (false == ggTrainHeatingButton.is_push() && false == mvControlled->HeatingSwitchImpulse)
if (false == ggTrainHeatingButton.is_push() && false == mvOccupied->HeatingSwitchImpulse)
{
ggTrainHeatingButton.PutValue(mvControlled->Heating ? 1.f : 0.f);
}
@@ -11461,7 +11461,7 @@ void TTrain::set_cab_controls(int const Cab)
// joint oil and fuel pump
if (ggOilFuelPumpButton.type() != TGaugeType::push)
{
ggOilFuelPumpButton.PutValue(mvControlled->FuelPump.is_enabled && mvControlled->OilPump.is_enabled ? 1.f : 0.f);
ggOilFuelPumpButton.PutValue(mvControlled->OilFuelPumpsEnabled() ? 1.f : 0.f);
}
// traction motor fans
if (ggMotorBlowersFrontButton.type() != TGaugeType::push)