16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 01:59:19 +02:00

reformat: remove redundant parentheses

This commit is contained in:
jerrrrycho
2026-06-30 21:19:46 +02:00
parent 7c88907f6b
commit d85096f64d
108 changed files with 4098 additions and 4662 deletions

View File

@@ -56,8 +56,8 @@ bool TTractionPowerSource::Load(cParser *parser) {
bSection = true;
}
// skip rest of the section
while( ( false == token.empty() )
&& ( token != "end" ) ) {
while( false == token.empty()
&& token != "end" ) {
token = parser->getToken<std::string>();
}
@@ -123,10 +123,10 @@ double TTractionPowerSource::CurrentGet(double res)
FuseTimer = 0;
return 0;
}
if ((res > 0) || ((res < 0) && (Recuperation || true)))
if (res > 0 || (res < 0 && (Recuperation || true)))
TotalAdmitance += 1.0 / res; // połączenie równoległe rezystancji jest równoważne sumie admitancji
float NomVolt = (TotalPreviousAdmitance < 0 ? NominalVoltage * 1.083 : NominalVoltage);
TotalCurrent = (TotalPreviousAdmitance != 0.0) ?
float NomVolt = TotalPreviousAdmitance < 0 ? NominalVoltage * 1.083 : NominalVoltage;
TotalCurrent = TotalPreviousAdmitance != 0.0 ?
NomVolt / (InternalRes + 1.0 / TotalPreviousAdmitance) :
0.0; // napięcie dzielone przez sumę rezystancji wewnętrznej i obciążenia
OutputVoltage = NomVolt - InternalRes * TotalCurrent; // napięcie na obciążeniu