18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-21 14:24:58 +01:00

fix(ai): end brake charging on control reservoir overcharge, charge on blocked departures

- end the charging position when the control reservoir of any vehicle, the
  locomotive included, rises 0.05 bar above the nominal pipe pressure
- standing and unable to depart for 10 s: allow the charging position
  regardless of the equivalent pipe pressure and the train type
This commit is contained in:
maj00r
2026-10-07 18:17:59 +02:00
parent affa7cdaa9
commit 4e406fdd86
2 changed files with 35 additions and 2 deletions

View File

@@ -350,6 +350,8 @@ private:
void control_main_pipe();
void update_brake_charging();
bool is_brake_charging_done() const;
double consist_max_crp() const;
bool is_departure_blocked( double const Delay ) const;
void control_relays();
void control_motor_connectors();
void control_tractive_force();
@@ -454,6 +456,7 @@ private:
double BrakeChargingCooldown{}; // prevents the ai from trying to charge the train brake too frequently
double BrakeChargingStart = -1.0;
std::unordered_map<TDynamicObject const *, double> BrakeChargingPipeOverchargeStart;
double DepartBlockedStart = -1.0;
TBrakeSystem BrakeSystem = TBrakeSystem::Individual; //type of main brake
bool ForcePNBrake = false; //is it necessary to use PN brake instead of EP brake
int DynamicBrakeTest = 0; //is it necessary to make brake test while driving