16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 22:09: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

@@ -300,26 +300,26 @@ enum light
{
/// <summary>Headlight, left.</summary>
headlight_left = (1 << 0),
headlight_left = 1 << 0,
/// <summary>Red marker, left.</summary>
redmarker_left = (1 << 1),
redmarker_left = 1 << 1,
/// <summary>Headlight, upper centre.</summary>
headlight_upper = (1 << 2),
headlight_upper = 1 << 2,
// TBD, TODO: redmarker_upper support?
/// <summary>Headlight, right.</summary>
headlight_right = (1 << 4),
headlight_right = 1 << 4,
/// <summary>Red marker, right.</summary>
redmarker_right = (1 << 5),
redmarker_right = 1 << 5,
/// <summary>Rear-end markers (combined).</summary>
rearendsignals = (1 << 6),
rearendsignals = 1 << 6,
/// <summary>Auxiliary light, left (e.g. ditch light).</summary>
auxiliary_left = (1 << 7),
auxiliary_left = 1 << 7,
/// <summary>Auxiliary light, right.</summary>
auxiliary_right = (1 << 8),
auxiliary_right = 1 << 8,
/// <summary>High-beam headlight, left.</summary>
highbeamlight_left = (1 << 9),
highbeamlight_left = 1 << 9,
/// <summary>High-beam headlight, right.</summary>
highbeamlight_right = (1 << 10)
highbeamlight_right = 1 << 10
};
/// <summary>Door operation method (who controls them and how) — mutually exclusive.</summary>
@@ -1211,8 +1211,8 @@ struct TCoupling
double beta = 0.0;
TCouplerType CouplerType = TCouplerType::NoCoupler; /*typ sprzegu*/
int AutomaticCouplingFlag = coupling::coupler;
int AllowedFlag = (coupling::coupler | coupling::brakehose); // Ra: maska dostępnych
int PowerFlag = (coupling::power110v | coupling::power24v);
int AllowedFlag = coupling::coupler | coupling::brakehose; // Ra: maska dostępnych
int PowerFlag = coupling::power110v | coupling::power24v;
int PowerCoupling = coupling::permanent; // type of coupling required for power transfer
/*zmienne*/
bool AutomaticCouplingAllowed{true}; // whether automatic coupling can be currently performed
@@ -1238,11 +1238,11 @@ struct TCoupling
inline bool has_adapter() const
{
return (adapter_type != TCouplerType::NoCoupler);
return adapter_type != TCouplerType::NoCoupler;
}
inline TCouplerType const type() const
{
return (adapter_type == TCouplerType::NoCoupler ? CouplerType : adapter_type);
return adapter_type == TCouplerType::NoCoupler ? CouplerType : adapter_type;
}
};
@@ -2092,7 +2092,7 @@ class TMoverParameters
bool CabMaster = false; // czy pojazd jest nadrzędny w składzie
inline bool IsCabMaster()
{
return ((CabActive == CabOccupied) && CabMaster);
return CabActive == CabOccupied && CabMaster;
} // czy aktualna kabina jest na pewno tą, z której można sterować
bool AutomaticCabActivation = true; // czy zmostkowany rozrzad przelacza sie sam przy zmianie kabiny
int InactiveCabFlag = 0; // co sie dzieje przy dezaktywacji kabiny
@@ -2300,7 +2300,7 @@ class TMoverParameters
bool EIMDirectionChangeAllow(void) const;
inline double IsVehicleEIMBrakingFactor()
{
return ((DynamicBrakeFlag && ResistorsFlag) ? 0.0 : eimv[eimv_Ipoj] < 0 ? -1.0 : 1.0);
return DynamicBrakeFlag && ResistorsFlag ? 0.0 : eimv[eimv_Ipoj] < 0 ? -1.0 : 1.0;
}
void BrakeLevelSet(double b);
bool BrakeLevelAdd(double b);
@@ -2317,7 +2317,7 @@ class TMoverParameters
double ShowEngineRotation(int VehN);
// Q *******************************************************************************************
double GetTrainsetVoltage(int const Coupling = (coupling::heating | coupling::highvoltage)) const;
double GetTrainsetVoltage(int const Coupling = coupling::heating | coupling::highvoltage) const;
double GetTrainsetHighVoltage() const;
bool switch_physics(bool const State);
double LocalBrakeRatio(void);

File diff suppressed because it is too large Load Diff

View File

@@ -18,7 +18,7 @@ Copyright (C) 2007-2014 Maciej Cierniak
double d2A( double const d )
{
return (d * d) * 0.7854 / 1000.0;
return d * d * 0.7854 / 1000.0;
}
// ------ RURA ------
@@ -115,9 +115,9 @@ void TRapid::Update(double dt)
ActMult = 1.0;
}
if ((BCP * RapidMult) > (P() * ActMult))
if (BCP * RapidMult > P() * ActMult)
dV = -PFVd(BCP, 0, DL, P() * ActMult / RapidMult) * dt;
else if ((BCP * RapidMult) < (P() * ActMult))
else if (BCP * RapidMult < P() * ActMult)
dV = PFVa(BVP, BCP, DN, P() * ActMult / RapidMult) * dt;
else
dV = 0.0;
@@ -140,9 +140,9 @@ void TPrzekCiagly::Update(double dt)
double const BCP{ Next->P() };
double dV;
if ( BCP > (P() * Mult))
if ( BCP > P() * Mult)
dV = -PFVd(BCP, 0, d2A(8.0), P() * Mult) * dt;
else if (BCP < (P() * Mult))
else if (BCP < P() * Mult)
dV = PFVa(BVP, BCP, d2A(8.0), P() * Mult) * dt;
else
dV = 0.0;
@@ -226,7 +226,7 @@ double TNESt3::GetPF( double const PP, double const dt, double const Vel ) // pr
dV = 0.0;
// BrakeCyl.Flow(-dV);
Przekladniki[1]->Flow(-dV);
if ( ((BrakeStatus & b_on) == b_on) && (Przekladniki[1]->P() * HBG300 < MaxBP) )
if ( (BrakeStatus & b_on) == b_on && Przekladniki[1]->P() * HBG300 < MaxBP )
dV =
PF( BVP, BCP, Nozzles[dTN] * (nastG + 2.0 * (BCP < Podskok ? 1.0 : 0.0)) + Nozzles[dON] * (1.0 - nastG) )
* dt * (0.1 + 4.9 * std::min( 0.2, (CVP - 0.05 - VVP) * BVM - BCP ) );
@@ -241,10 +241,7 @@ double TNESt3::GetPF( double const PP, double const dt, double const Vel ) // pr
Przekladniki[i]->Update(dt);
if (typeid(*Przekladniki[i]) == typeid(TRapid))
{
RapidStatus = ( ( ( BrakeDelayFlag & bdelay_R ) == bdelay_R )
&& ( ( std::abs( Vel ) > 70.0 )
|| ( ( std::abs( Vel ) > 50.0 ) && ( RapidStatus ) )
|| ( RapidStaly ) ) );
RapidStatus = (BrakeDelayFlag & bdelay_R) == bdelay_R && (std::abs(Vel) > 70.0 || (std::abs(Vel) > 50.0 && RapidStatus) || RapidStaly);
Przekladniki[i]->SetRapidStatus(RapidStatus);
}
else if( typeid( *Przekladniki[i] ) == typeid( TPrzeciwposlizg ) )
@@ -263,7 +260,7 @@ double TNESt3::GetPF( double const PP, double const dt, double const Vel ) // pr
// przeplyw testowy miedzypojemnosci
dV = PF(MPP, VVP, BVs(BCP)) + PF(MPP, CVP, CVs(BCP));
if ((MPP - 0.05) > BVP)
if (MPP - 0.05 > BVP)
dV += PF(MPP - 0.05, BVP, Nozzles[dPT] * nastG + (1.0 - nastG) * Nozzles[dPO]);
if (MPP > VVP)
dV += PF(MPP, VVP, d2A(5.0));
@@ -277,7 +274,7 @@ double TNESt3::GetPF( double const PP, double const dt, double const Vel ) // pr
dV1 += 0.98 * dV;
// przeplyw ZP <-> MPJ
if ((MPP - 0.05) > BVP)
if (MPP - 0.05 > BVP)
dV = PF(BVP, MPP - 0.05, Nozzles[dPT] * nastG + (1.0 - nastG) * Nozzles[dPO]) * dt;
else
dV = 0.0;
@@ -312,7 +309,7 @@ void TNESt3::Init( double const PP, double const HPP, double const LPP, double c
CntrlRes = std::make_shared<TReservoir>();
CntrlRes->CreateCap(15.0);
CntrlRes->CreatePress(HPP);
BrakeStatus = (BP > 1.0 ? 1 : 0);
BrakeStatus = BP > 1.0 ? 1 : 0;
Miedzypoj = std::make_shared<TReservoir>();
Miedzypoj->CreateCap(5.0);
Miedzypoj->CreatePress(PP);
@@ -323,7 +320,7 @@ void TNESt3::Init( double const PP, double const HPP, double const LPP, double c
Zamykajacy = false;
if ( (typeid(*FM) == typeid(TDisk1)) || (typeid(*FM) == typeid(TDisk2)) ) // jesli zeliwo to schodz
if ( typeid(*FM) == typeid(TDisk1) || typeid(*FM) == typeid(TDisk2) ) // jesli zeliwo to schodz
RapidStaly = true;
else
RapidStaly = false;
@@ -343,24 +340,24 @@ void TNESt3::CheckState(double const BCP, double &dV1) // glowny przyrzad rozrza
double const CVP{ CntrlRes->P() };
double const MPP{ Miedzypoj->P() };
if ((BCP < 0.25) && (VVP + 0.08 > CVP))
if (BCP < 0.25 && VVP + 0.08 > CVP)
Przys_blok = false;
// sprawdzanie stanu
// if ((BrakeStatus and 1)=1)and(BCP>0.25)then
if (((VVP + 0.01 + BCP / BVM) < (CVP - 0.05)) && (Przys_blok))
BrakeStatus |= ( b_on | b_hld ); // hamowanie stopniowe;
else if ((VVP - 0.01 + (BCP - 0.1) / BVM) > (CVP - 0.05))
if (VVP + 0.01 + BCP / BVM < CVP - 0.05 && Przys_blok)
BrakeStatus |= b_on | b_hld; // hamowanie stopniowe;
else if (VVP - 0.01 + (BCP - 0.1) / BVM > CVP - 0.05)
BrakeStatus &= ~( b_on | b_hld ); // luzowanie;
else if ((VVP + BCP / BVM) > (CVP - 0.05))
else if (VVP + BCP / BVM > CVP - 0.05)
BrakeStatus &= ~b_on; // zatrzymanie napelaniania;
else if (((VVP + (BCP - 0.1) / BVM) < (CVP - 0.05)) && (BCP > 0.25)) // zatrzymanie luzowania
else if (VVP + (BCP - 0.1) / BVM < CVP - 0.05 && BCP > 0.25) // zatrzymanie luzowania
BrakeStatus |= b_hld;
if( ( BrakeStatus & b_hld ) == 0 )
SoundFlag |= sf_CylU;
if (((VVP + 0.10) < CVP) && (BCP < 0.25)) // poczatek hamowania
if (VVP + 0.10 < CVP && BCP < 0.25) // poczatek hamowania
if (false == Przys_blok)
{
ValveRes->CreatePress(0.1 * VVP);
@@ -371,7 +368,7 @@ void TNESt3::CheckState(double const BCP, double &dV1) // glowny przyrzad rozrza
if (BCP > 0.5)
Zamykajacy = true;
else if ((VVP - 0.6) < MPP)
else if (VVP - 0.6 < MPP)
Zamykajacy = false;
}
@@ -384,7 +381,7 @@ void TNESt3::CheckReleaser(double const dt) // odluzniacz
if ((BrakeStatus & b_rls) == b_rls)
{
CntrlRes->Flow(PF(CVP, 0, 0.02) * dt);
if ((CVP < (VVP + 0.3)) || (false == autom))
if (CVP < VVP + 0.3 || false == autom)
BrakeStatus &= ~b_rls;
}
}
@@ -395,9 +392,9 @@ double TNESt3::CVs(double const BP) // napelniacz sterujacego
double const MPP{ Miedzypoj->P() };
// przeplyw ZS <-> PG
if (MPP < (CVP - 0.17))
if (MPP < CVP - 0.17)
return 0.0;
else if (MPP > (CVP - 0.08))
else if (MPP > CVP - 0.08)
return Nozzles[dSd];
else
return Nozzles[dSm];
@@ -409,7 +406,7 @@ double TNESt3::BVs(double const BCP) // napelniacz pomocniczego
double const MPP{ Miedzypoj->P() };
// przeplyw ZP <-> rozdzielacz
if (MPP < (CVP - 0.3))
if (MPP < CVP - 0.3)
return Nozzles[dP];
else if( BCP < 0.5 ) {
if( true == Zamykajacy )
@@ -425,7 +422,7 @@ void TNESt3::PLC(double const mass)
{
LoadC = 1.0 +
( mass < LoadM ?
( (TareBP + (MaxBP - TareBP) * (mass - TareM) / (LoadM - TareM) ) / MaxBP - 1.0 ) :
(TareBP + (MaxBP - TareBP) * (mass - TareM) / (LoadM - TareM)) / MaxBP - 1.0 :
0.0 );
}
@@ -490,13 +487,13 @@ void TNESt3::SetSize( int const size, std::string const &params ) // ustawianie
else
Przekladniki[2] = std::make_shared<TRura>();
if( ( contains( params, "3d" ) )
|| ( contains( params, "4d" ) ) ) {
if( contains(params, "3d")
|| contains(params, "4d") ) {
autom = false;
}
else
autom = true;
if ((contains( params,"HBG300")))
if (contains(params, "HBG300"))
HBG300 = 1.0;
else
HBG300 = 0.0;

View File

@@ -60,7 +60,7 @@ double TP10yBg::GetFC(double N, double Vel)
C = 0.353 - A * 0.029;
u0 = 0.41 - C;
V0 = 25.7 + 20 * A;
return (u0 + C * exp(-Vel * 1.0 / V0));
return u0 + C * exp(-Vel * 1.0 / V0);
}
double TP10yBgu::GetFC(double N, double Vel)
@@ -74,7 +74,7 @@ double TP10yBgu::GetFC(double N, double Vel)
C = 0.353 - A * 0.044;
u0 = 0.41 - C;
V0 = 25.7 + 21 * A;
return (u0 + C * exp(-Vel * 1.0 / V0));
return u0 + C * exp(-Vel * 1.0 / V0);
}
double TP10::GetFC(double N, double Vel)

File diff suppressed because it is too large Load Diff

View File

@@ -1399,7 +1399,7 @@ class TH14K1 : public TDriverHandle
private:
/// <summary>Position table for the H14K1 (range -1..4): {flow speed, target multiplier}.</summary>
static double const BPT_K[/*?*/ /*-1..4*/ (4) - (-1) + 1][2];
static double const BPT_K[/*?*/ /*-1..4*/ 4 - -1 + 1][2];
/// <summary>Lookup of bh_* function codes to handle position values.</summary>
static double const pos_table[11]; // = {-1, 4, -1, 0, 1, 2, 3, 4, 0, 0, 0};
@@ -1440,9 +1440,9 @@ class TSt113 : public TH14K1
/// <summary>Current EP intensity reported by the handle.</summary>
double EPS = 0.0;
/// <summary>Position table (override of H14K1's, with adjusted parameters).</summary>
static double const BPT_K[/*?*/ /*-1..4*/ (4) - (-1) + 1][2];
static double const BPT_K[/*?*/ /*-1..4*/ 4 - -1 + 1][2];
/// <summary>EP table — EP intensity per handle position (range -1..5).</summary>
static double const BEP_K[/*?*/ /*-1..5*/ (5) - (-1) + 1];
static double const BEP_K[/*?*/ /*-1..5*/ 5 - -1 + 1];
/// <summary>Lookup of bh_* function codes to handle position values.</summary>
static double const pos_table[11]; // = {-1, 5, -1, 0, 2, 3, 4, 5, 0, 0, 1};
/// <summary>Local control pressure (mirrors PP).</summary>