17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 05:09:20 +02:00

refactor(sonar): add braces around nested if-else (cpp:S5261)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jerrrrycho
2026-10-10 16:25:40 +02:00
parent 24425d222f
commit 0bf013fef9
3 changed files with 12 additions and 0 deletions

View File

@@ -4544,6 +4544,7 @@ void TMoverParameters::UpdatePipePressure(double dt)
}
if (dpMainValve < 0) // && (PipePressureVal > 0.01) //50
{
if (Compressor > ScndPipePress)
{
CompressedVolume = CompressedVolume + dpMainValve / 1500.0;
@@ -4551,6 +4552,7 @@ void TMoverParameters::UpdatePipePressure(double dt)
}
else
Pipe2->Flow(dpMainValve);
}
}
// ulepszony hamulec bezp.
@@ -4625,10 +4627,12 @@ void TMoverParameters::UpdatePipePressure(double dt)
//(Hamulec as TLSt).SetLBP(LocBrakePress);
Hamulec->SetLBP(LocBrakePress);
if (BrakeValve == TBrakeValve::EStED)
{
if (MBPM < 2)
Hamulec->PLC(MaxBrakePress[LoadFlag]);
else
Hamulec->PLC(TotalMass - Mred);
}
break;
}

View File

@@ -833,12 +833,14 @@ void TESt::CheckReleaser(double const dt)
// odluzniacz
if ((BrakeStatus & b_rls) == b_rls)
{
if (CVP - VVP < 0)
BrakeStatus &= ~b_rls;
else
{
CntrlRes->Flow(+PF(CVP, 0, 0.1) * dt);
}
}
}
/// <summary>
@@ -2468,10 +2470,12 @@ void TKE::CheckReleaser(double const dt)
// odluzniacz
if (true == ((BrakeStatus & b_rls) == b_rls))
{
if (CVP - VVP < 0)
BrakeStatus &= ~b_rls;
else
CntrlRes->Flow(+PF(CVP, 0, 0.1) * dt);
}
}
/// <summary>
@@ -3821,6 +3825,7 @@ double TM394::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
if (BCP == 0)
LimPP = LimPP + RedAdj;
if (BCP != 2)
{
if (CP < LimPP)
CP = CP + 4 * std::min(abs(LimPP - CP), 0.05) * PR(CP, LimPP) * dt; // zbiornik sterujacy
// cp:=cp+6*(2+int(bcp<0))*std::min(abs(Limpp-cp),0.05)*PR(cp,Limpp)*dt //zbiornik
@@ -3829,6 +3834,7 @@ double TM394::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
CP = CP - 0.2 * dt / 100;
else
CP = CP + 4 * (1 + int(BCP != 3) + int(BCP > 4)) * std::min(abs(LimPP - CP), 0.05) * PR(CP, LimPP) * dt; // zbiornik sterujacy
}
LimPP = CP;
dpPipe = std::min(HP, LimPP);