mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-01 05:57:08 +01:00
refactor(physics): the definition of the brakes apart from their state
What the .fiz gives about the brakes of a vehicle (the kinds of the brake
system, the valves and the handles, the cylinders and the rigging, the pipe
pressures, the delays and the modes it can be set to: 35 fields) moves into
physics::Braking::Config, held as brakes.config, set as the vehicle loads and
not changed after. Six fields that sat with the definition but change in the
run (the weighted pressures of the handle position, the universal buttons
pressed, the load setting, the control reservoir, the emergency valve, the
lock of the pipe) go with the state.
No change in behaviour: the golden traces recorded on dfb43c4f match bit for bit.
This commit is contained in:
@@ -1025,7 +1025,7 @@ void physics::Vehicle::CheckEIMIC(double dt)
|
||||
EIMICFromUniversalController(dt, brakeDemand);
|
||||
break;
|
||||
}
|
||||
if (brakes.independentTraxx)
|
||||
if (brakes.config.independentTraxx)
|
||||
{
|
||||
EIMICTraxxLocalBrake(dt);
|
||||
}
|
||||
@@ -1041,7 +1041,7 @@ void physics::Vehicle::EIMICFromController(double const brakeDemand, double cons
|
||||
{
|
||||
if (eimic > 0.001)
|
||||
eimic = std::max(0.002, eimic * (double)MainCtrlPosNo / ((double)MainCtrlPosNo - offset) - offset / ((double)MainCtrlPosNo - offset));
|
||||
if (eimic < -0.001 && brakes.driverValveType != TBrakeHandle::MHZ_EN57)
|
||||
if (eimic < -0.001 && brakes.config.driverValveType != TBrakeHandle::MHZ_EN57)
|
||||
eimic = std::min(-0.002, eimic * (double)LocalBrakePosNo / ((double)LocalBrakePosNo - multiplier) + offset / ((double)LocalBrakePosNo - multiplier));
|
||||
}
|
||||
if (eimic > 0.001 && SpeedCtrlUnit.IsActive)
|
||||
@@ -1197,11 +1197,11 @@ void physics::Vehicle::EIMICTraxxLocalBrake(double dt)
|
||||
if (LocalBrakeRatio() > 0.6) // pozycja 2, zahamowywanie
|
||||
{
|
||||
eim_localbrake += dt * 0.17;
|
||||
eim_localbrake = std::max(eim_localbrake, brakes.cylinderPressure / brakes.maxCylinderPressure[0]);
|
||||
eim_localbrake = std::max(eim_localbrake, brakes.cylinderPressure / brakes.config.maxCylinderPressure[0]);
|
||||
}
|
||||
else // pozycja 1, utrzymanie cisnienia
|
||||
{
|
||||
if (eim_localbrake < brakes.distributor->GetEDBCP() / brakes.maxCylinderPressure[0])
|
||||
if (eim_localbrake < brakes.distributor->GetEDBCP() / brakes.config.maxCylinderPressure[0])
|
||||
eim_localbrake = 0;
|
||||
}
|
||||
eim_localbrake = std::clamp(eim_localbrake, 0.0, 1.0);
|
||||
@@ -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.config.pipeHighPressure - 0.2))
|
||||
SpeedCtrlUnit.Standby = true;
|
||||
if (EIMCtrlType >= 3 && UniCtrlList[MainCtrlPos].SpeedUp <= 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user