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

AI braking, ESt3: take care of the Sonar remarks on the braking PRs

No change in what the AI or the distributor does:

- S134: the step of the train brake sized from the consist brake table
  moves out of IncBrake() into increase_train_brake(), with early returns.
- S134, S1066: while starting uphill, the check of the released brakes
  leaves Ready as it was by assigning the flag instead of nesting an if.
- S6004: the uphill condition of control_uphill_start(), and the target
  cylinder pressure of TNESt3::CheckState(), are declared in the
  init-statement of their if.
- S5350: the loop summing the tractive force walks the consist through a
  pointer to const.
- S3776: the cylinder nozzle calibration for the AL2 relay moves out of
  TNESt3::SetSize() into ScaleNozzlesForAL2().
This commit is contained in:
pwarszawski
2026-11-07 22:00:30 +01:00
parent 292092a7aa
commit 99cf46866a
4 changed files with 94 additions and 83 deletions

View File

@@ -379,8 +379,7 @@ void TNESt3::CheckState(double const BCP, double & /*dV1*/) // glowny przyrzad r
Przys_blok = false;
// sprawdzanie stanu
double const cel{ CelBCP( CVP, VVP ) };
if (BCP < cel - 0.01 * BVM && Przys_blok)
if (double const cel{ CelBCP( CVP, VVP ) }; BCP < cel - 0.01 * BVM && Przys_blok)
BrakeStatus |= b_on | b_hld; // hamowanie stopniowe;
else if (BCP - 0.1 > cel + 0.01 * BVM)
BrakeStatus &= ~( b_on | b_hld ); // luzowanie;
@@ -486,6 +485,18 @@ void TNESt3::SetLBP(double const P)
LBP = P;
}
void TNESt3::ScaleNozzlesForAL2() // dysze cylindra przy przekladniku AL2
{
if( PrzekCiagly == nullptr ) {
return;
}
// dysze cylindra skalibrowane na komore impulsowa przekladnika AL2 (1 l) wg czasow z tablicy 3-9
Nozzles[dON] *= 0.914;
Nozzles[dTN] *= 0.885;
Nozzles[dOO] *= 0.82;
Nozzles[dTO] *= 0.8;
}
void TNESt3::SetSize( int const size, std::string const &params ) // ustawianie dysz (rozmiaru ZR)
{
static double const dNO1l = 1.250;
@@ -673,13 +684,7 @@ void TNESt3::SetSize( int const size, std::string const &params ) // ustawianie
Nozzles[dSd] = 1.1;
Nozzles[dSm] = 0.9;
if( PrzekCiagly != nullptr ) {
// dysze cylindra skalibrowane na komore impulsowa przekladnika AL2 (1 l) wg czasow z tablicy 3-9
Nozzles[dON] *= 0.914;
Nozzles[dTN] *= 0.885;
Nozzles[dOO] *= 0.82;
Nozzles[dTO] *= 0.8;
}
ScaleNozzlesForAL2();
// przeliczanie z mm^2 na l/m
for (auto &nozzle : Nozzles)

View File

@@ -201,6 +201,7 @@ class TNESt3 : public TBrake {
void CheckState(double const BCP, double &dV1); // glowny przyrzad rozrzadczy
void CheckReleaser(double const dt); // odluzniacz
double CVs(double const BP) const; // napelniacz sterujacego
void ScaleNozzlesForAL2(); // dysze cylindra przy przekladniku AL2
double BVs(double const BCP) const; // napelniacz pomocniczego
void SetSize( int const size, std::string const &params ); // ustawianie dysz (rozmiaru ZR), przekladniki
void PLC(double const mass) override; // wspolczynnik cisnienia przystawki wazacej