18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-12-01 17:37:09 +01:00

refactor(physics): the compressed air supply and the pipes keep their state to themselves

The compressor, the main reservoir and the pipes along the train
(physics/components/airsupply.h) become classes, as the parts of the main
circuit: the definition in `config`, the state behind queries and operations.

The step of the compressor (the programmer of a unit, its supply and its start
delay, the governor and its lock, the venting over the top pressure) moves into
AirCompressor::Update(), with what it needs from the vehicle as plain values
(CompressorInputs); the vehicle follows the step up as before (the switching
delay, the counter of the debug panel, the sound of the relay). The leaks and
the pressure of the main reservoir move into AirSupply, and the reservoir is
filled and drawn through it.

The fault of the compressor the scenery can set no longer adds 100000001 to its
pressures from TDynamicObject::Damage(): AirCompressor::SetFault() does the same
arithmetic, so a fault behaves exactly as it did.

No change in behaviour: the golden traces recorded on dfb43c4f match bit for bit.
This commit is contained in:
2026-11-29 10:14:37 +01:00
parent 160ffe2147
commit bc2af26dd5
60 changed files with 731 additions and 603 deletions
+2 -2
View File
@@ -894,7 +894,7 @@ bool physics::Vehicle::MotorConnectorsCheck()
// hunter-111211: wylacznik cisnieniowy
// (on some vehicles it watches the brake pipe alone)
protection.UpdatePressureSwitch(brakes.cylinderPressure, brakePipe.pressure);
protection.UpdatePressureSwitch(brakes.cylinderPressure, brakePipe.Pressure());
if (true == protection.PressureSwitchTripped())
{
@@ -1253,7 +1253,7 @@ void physics::Vehicle::CheckSpeedCtrl(double dt)
{
SpeedCtrlUnit.Standby = false;
}
if (!SpeedCtrlUnit.BrakeIntervention && (brakes.distributor->GetEDBCP() > 0.4 || brakePipe.pressure < brakes.pipeHighPressure - 0.2))
if (!SpeedCtrlUnit.BrakeIntervention && (brakes.distributor->GetEDBCP() > 0.4 || brakePipe.Pressure() < brakes.pipeHighPressure - 0.2))
SpeedCtrlUnit.Standby = true;
if (EIMCtrlType >= 3 && UniCtrlList[MainCtrlPos].SpeedUp <= 0)
{