mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 19:49:19 +02:00
reformat: set variables to constexpr where possible
This commit is contained in:
206
McZapkie/MOVER.h
206
McZapkie/MOVER.h
@@ -82,75 +82,75 @@ zwiekszenie nacisku przy duzych predkosciach w hamulcach Oerlikona
|
||||
extern int ConversionError;
|
||||
|
||||
/// <summary>Static friction coefficient for steel-on-steel contact (used for adhesion at standstill).</summary>
|
||||
const double Steel2Steel_friction = 0.15; // tarcie statyczne
|
||||
constexpr double Steel2Steel_friction = 0.15; // tarcie statyczne
|
||||
/// <summary>Earth gravitational acceleration [m/s^2].</summary>
|
||||
const double g = 9.81; // przyspieszenie ziemskie
|
||||
constexpr double g = 9.81; // przyspieszenie ziemskie
|
||||
/// <summary>Sand consumption rate when sanding is active [kg/s].</summary>
|
||||
const double SandSpeed = 0.1; // ile kg/s}
|
||||
constexpr double SandSpeed = 0.1; // ile kg/s}
|
||||
/// <summary>2*pi shortcut.</summary>
|
||||
const double Pirazy2 = 6.2831853071794f;
|
||||
constexpr double Pirazy2 = 6.2831853071794f;
|
||||
|
||||
//-- var, const, procedure ---------------------------------------------------
|
||||
/// <summary>Truthy alias used by CheckLocomotiveParameters() to ignore a check failure.</summary>
|
||||
static bool const Go = true;
|
||||
static constexpr bool Go = true;
|
||||
/// <summary>Falsy alias used by CheckLocomotiveParameters() to abort on a check failure.</summary>
|
||||
static bool const Hold = false; /*dla CheckLocomotiveParameters*/
|
||||
static constexpr bool Hold = false; /*dla CheckLocomotiveParameters*/
|
||||
/// <summary>Maximum number of resistor / scheme entries for electric motor traction.</summary>
|
||||
static int const ResArraySize = 64; /*dla silnikow elektrycznych*/
|
||||
static constexpr int ResArraySize = 64; /*dla silnikow elektrycznych*/
|
||||
/// <summary>Maximum number of motor-parameter table entries (gear stages).</summary>
|
||||
static int const MotorParametersArraySize = 10;
|
||||
static constexpr int MotorParametersArraySize = 10;
|
||||
/// <summary>Maximum number of pantograph current collectors per vehicle.</summary>
|
||||
static int const maxcc = 4; /*max. ilosc odbierakow pradu*/
|
||||
static constexpr int maxcc = 4; /*max. ilosc odbierakow pradu*/
|
||||
// static int const LocalBrakePosNo = 10; /*ilosc nastaw hamulca pomocniczego*/
|
||||
// static int const MainBrakeMaxPos = 10; /*max. ilosc nastaw hamulca zasadniczego*/
|
||||
/// <summary>Number of positions on the manual (parking) brake handle.</summary>
|
||||
static int const ManualBrakePosNo = 20; /*ilosc nastaw hamulca recznego*/
|
||||
static constexpr int ManualBrakePosNo = 20; /*ilosc nastaw hamulca recznego*/
|
||||
/// <summary>Number of positions on the lights selector switch.</summary>
|
||||
static int const LightsSwitchPosNo = 16;
|
||||
static constexpr int LightsSwitchPosNo = 16;
|
||||
/// <summary>Maximum number of positions of the universal (auxiliary) controller.</summary>
|
||||
static int const UniversalCtrlArraySize = 32; /*max liczba pozycji uniwersalnego nastawnika*/
|
||||
static constexpr int UniversalCtrlArraySize = 32; /*max liczba pozycji uniwersalnego nastawnika*/
|
||||
|
||||
/*uszkodzenia toru*/
|
||||
/// <summary>Track damage flag: rail wear.</summary>
|
||||
static int const dtrack_railwear = 2;
|
||||
static constexpr int dtrack_railwear = 2;
|
||||
/// <summary>Track damage flag: free / loose rail.</summary>
|
||||
static int const dtrack_freerail = 4;
|
||||
static constexpr int dtrack_freerail = 4;
|
||||
/// <summary>Track damage flag: thin (worn-out) rail.</summary>
|
||||
static int const dtrack_thinrail = 8;
|
||||
static constexpr int dtrack_thinrail = 8;
|
||||
/// <summary>Track damage flag: bent rail.</summary>
|
||||
static int const dtrack_railbend = 16;
|
||||
static constexpr int dtrack_railbend = 16;
|
||||
/// <summary>Track damage flag: vegetation overgrowth.</summary>
|
||||
static int const dtrack_plants = 32;
|
||||
static constexpr int dtrack_plants = 32;
|
||||
/// <summary>Track damage flag: track impassable for movement.</summary>
|
||||
static int const dtrack_nomove = 64;
|
||||
static constexpr int dtrack_nomove = 64;
|
||||
/// <summary>Track damage flag: rails missing entirely.</summary>
|
||||
static int const dtrack_norail = 128;
|
||||
static constexpr int dtrack_norail = 128;
|
||||
|
||||
/*uszkodzenia taboru*/
|
||||
/// <summary>Vehicle damage flag: thin wheel (locomotives).</summary>
|
||||
static int const dtrain_thinwheel = 1; /*dla lokomotyw*/
|
||||
static constexpr int dtrain_thinwheel = 1; /*dla lokomotyw*/
|
||||
/// <summary>Vehicle damage flag: shifted load (wagons).</summary>
|
||||
static int const dtrain_loadshift = 1; /*dla wagonow*/
|
||||
static constexpr int dtrain_loadshift = 1; /*dla wagonow*/
|
||||
/// <summary>Vehicle damage flag: wheel wear.</summary>
|
||||
static int const dtrain_wheelwear = 2;
|
||||
static constexpr int dtrain_wheelwear = 2;
|
||||
/// <summary>Vehicle damage flag: bearing failure.</summary>
|
||||
static int const dtrain_bearing = 4;
|
||||
static constexpr int dtrain_bearing = 4;
|
||||
/// <summary>Vehicle damage flag: coupling damage.</summary>
|
||||
static int const dtrain_coupling = 8;
|
||||
static constexpr int dtrain_coupling = 8;
|
||||
/// <summary>Vehicle damage flag: ventilator failure (electric locomotive).</summary>
|
||||
static int const dtrain_ventilator = 16; /*dla lokomotywy el.*/
|
||||
static constexpr int dtrain_ventilator = 16; /*dla lokomotywy el.*/
|
||||
/// <summary>Vehicle damage flag: load damage (wagons).</summary>
|
||||
static int const dtrain_loaddamage = 16; /*dla wagonow*/
|
||||
static constexpr int dtrain_loaddamage = 16; /*dla wagonow*/
|
||||
/// <summary>Vehicle damage flag: engine failure (locomotives).</summary>
|
||||
static int const dtrain_engine = 32; /*dla lokomotyw*/
|
||||
static constexpr int dtrain_engine = 32; /*dla lokomotyw*/
|
||||
/// <summary>Vehicle damage flag: load destroyed (wagons).</summary>
|
||||
static int const dtrain_loaddestroyed = 32; /*dla wagonow*/
|
||||
static constexpr int dtrain_loaddestroyed = 32; /*dla wagonow*/
|
||||
/// <summary>Vehicle damage flag: axle damage.</summary>
|
||||
static int const dtrain_axle = 64;
|
||||
static constexpr int dtrain_axle = 64;
|
||||
/// <summary>Vehicle damage flag: derailment.</summary>
|
||||
static int const dtrain_out = 128; /*wykolejenie*/
|
||||
static constexpr int dtrain_out = 128; /*wykolejenie*/
|
||||
/// <summary>Vehicle damage flag: broken pantograph.</summary>
|
||||
static int const dtrain_pantograph = 256; /*polamanie pantografu*/
|
||||
static constexpr int dtrain_pantograph = 256; /*polamanie pantografu*/
|
||||
|
||||
/// <summary>Reason for a derailment event.</summary>
|
||||
enum DerailReason
|
||||
@@ -185,23 +185,23 @@ enum DerailReason
|
||||
|
||||
/*typ sprzegu*/
|
||||
/// <summary>Coupling type: virtual — vehicles share a track and are aware of each other.</summary>
|
||||
static int const ctrain_virtual = 0; // gdy pojazdy na tym samym torze się widzą wzajemnie
|
||||
static constexpr int ctrain_virtual = 0; // gdy pojazdy na tym samym torze się widzą wzajemnie
|
||||
/// <summary>Coupling type: physical coupler.</summary>
|
||||
static int const ctrain_coupler = 1; // sprzeg fizyczny
|
||||
static constexpr int ctrain_coupler = 1; // sprzeg fizyczny
|
||||
/// <summary>Coupling type: pneumatic brake hose.</summary>
|
||||
static int const ctrain_pneumatic = 2; // przewody hamulcowe
|
||||
static constexpr int ctrain_pneumatic = 2; // przewody hamulcowe
|
||||
/// <summary>Coupling type: control cable (multiple-unit).</summary>
|
||||
static int const ctrain_controll = 4; // przewody sterujące (ukrotnienie)
|
||||
static constexpr int ctrain_controll = 4; // przewody sterujące (ukrotnienie)
|
||||
/// <summary>Coupling type: high-voltage power cable.</summary>
|
||||
static int const ctrain_power = 8; // przewody zasilające (WN)
|
||||
static constexpr int ctrain_power = 8; // przewody zasilające (WN)
|
||||
/// <summary>Coupling type: passenger gangway.</summary>
|
||||
static int const ctrain_passenger = 16; // mostek przejściowy
|
||||
static constexpr int ctrain_passenger = 16; // mostek przejściowy
|
||||
/// <summary>Coupling type: secondary 8 atm pneumatic line (yellow, main air).</summary>
|
||||
static int const ctrain_scndpneumatic = 32; // przewody 8 atm (żółte; zasilanie powietrzem)
|
||||
static constexpr int ctrain_scndpneumatic = 32; // przewody 8 atm (żółte; zasilanie powietrzem)
|
||||
/// <summary>Coupling type: high-voltage train heating cable.</summary>
|
||||
static int const ctrain_heating = 64; // przewody ogrzewania WN
|
||||
static constexpr int ctrain_heating = 64; // przewody ogrzewania WN
|
||||
/// <summary>Coupling type: permanent (inter-section) — not separable during ordinary shunting; encoded as negative in config files.</summary>
|
||||
static int const ctrain_depot = 128; // nie rozłączalny podczas zwykłych manewrów (międzyczłonowy), we wpisie wartość ujemna
|
||||
static constexpr int ctrain_depot = 128; // nie rozłączalny podczas zwykłych manewrów (międzyczłonowy), we wpisie wartość ujemna
|
||||
/// <summary>Vehicle ends — front or rear (mutually exclusive).</summary>
|
||||
enum end
|
||||
{
|
||||
@@ -338,15 +338,15 @@ enum control_t
|
||||
};
|
||||
/*typ hamulca elektrodynamicznego*/
|
||||
/// <summary>Electrodynamic-brake type: no ED brake.</summary>
|
||||
static int const dbrake_none = 0;
|
||||
static constexpr int dbrake_none = 0;
|
||||
/// <summary>Electrodynamic-brake type: passive (always on while moving).</summary>
|
||||
static int const dbrake_passive = 1;
|
||||
static constexpr int dbrake_passive = 1;
|
||||
/// <summary>Electrodynamic-brake type: switchable (driver toggles).</summary>
|
||||
static int const dbrake_switch = 2;
|
||||
static constexpr int dbrake_switch = 2;
|
||||
/// <summary>Electrodynamic-brake type: reversal (engaged via reverser).</summary>
|
||||
static int const dbrake_reversal = 4;
|
||||
static constexpr int dbrake_reversal = 4;
|
||||
/// <summary>Electrodynamic-brake type: automatic (engages from main brake).</summary>
|
||||
static int const dbrake_automatic = 8;
|
||||
static constexpr int dbrake_automatic = 8;
|
||||
|
||||
/*dzwieki*/
|
||||
/// <summary>Bit flags identifying sound events emitted by a vehicle. Combinable.</summary>
|
||||
@@ -436,126 +436,126 @@ enum activation
|
||||
// zamienione na flagi bitowe, aby szybko wybierać grupę (np. EZT+SZT)
|
||||
// TODO: convert to enums, they're used as specific checks anyway
|
||||
/// <summary>Vehicle type flag: default (no special handling).</summary>
|
||||
static int const dt_Default = 0;
|
||||
static constexpr int dt_Default = 0;
|
||||
/// <summary>Vehicle type flag: EZT (electric multiple unit).</summary>
|
||||
static int const dt_EZT = 1;
|
||||
static constexpr int dt_EZT = 1;
|
||||
/// <summary>Vehicle type flag: ET41 locomotive.</summary>
|
||||
static int const dt_ET41 = 2;
|
||||
static constexpr int dt_ET41 = 2;
|
||||
/// <summary>Vehicle type flag: ET42 locomotive.</summary>
|
||||
static int const dt_ET42 = 4;
|
||||
static constexpr int dt_ET42 = 4;
|
||||
/// <summary>Vehicle type flag: pseudo-diesel (electric drivetrain with diesel input model).</summary>
|
||||
static int const dt_PseudoDiesel = 8;
|
||||
static constexpr int dt_PseudoDiesel = 8;
|
||||
/// <summary>Vehicle type flag: ET22 locomotive (added in Megapack).</summary>
|
||||
static int const dt_ET22 = 0x10; // używane od Megapacka
|
||||
static constexpr int dt_ET22 = 0x10; // używane od Megapacka
|
||||
/// <summary>Vehicle type flag: SN61 (set from CHK only, not used in conditions).</summary>
|
||||
static int const dt_SN61 = 0x20; // nie używane w warunkach, ale ustawiane z CHK
|
||||
static constexpr int dt_SN61 = 0x20; // nie używane w warunkach, ale ustawiane z CHK
|
||||
/// <summary>Vehicle type flag: EP05 locomotive.</summary>
|
||||
static int const dt_EP05 = 0x40;
|
||||
static constexpr int dt_EP05 = 0x40;
|
||||
/// <summary>Vehicle type flag: ET40 locomotive.</summary>
|
||||
static int const dt_ET40 = 0x80;
|
||||
static constexpr int dt_ET40 = 0x80;
|
||||
/// <summary>Vehicle type flag: ŠKODA 181 locomotive.</summary>
|
||||
static int const dt_181 = 0x100;
|
||||
static constexpr int dt_181 = 0x100;
|
||||
/// <summary>Vehicle type flag: DMU (diesel multiple unit).</summary>
|
||||
static int const dt_DMU = 0x200;
|
||||
static constexpr int dt_DMU = 0x200;
|
||||
|
||||
// stałe dla asynchronów
|
||||
/// <summary>EIM config index: dfic — frequency rise rate at start.</summary>
|
||||
static int const eimc_s_dfic = 0;
|
||||
static constexpr int eimc_s_dfic = 0;
|
||||
/// <summary>EIM config index: dfmax — maximum frequency rate of change.</summary>
|
||||
static int const eimc_s_dfmax = 1;
|
||||
static constexpr int eimc_s_dfmax = 1;
|
||||
/// <summary>EIM config index: p — number of pole pairs.</summary>
|
||||
static int const eimc_s_p = 2;
|
||||
static constexpr int eimc_s_p = 2;
|
||||
/// <summary>EIM config index: cfu — voltage / frequency conversion coefficient.</summary>
|
||||
static int const eimc_s_cfu = 3;
|
||||
static constexpr int eimc_s_cfu = 3;
|
||||
/// <summary>EIM config index: cim — current / current conversion coefficient.</summary>
|
||||
static int const eimc_s_cim = 4;
|
||||
static constexpr int eimc_s_cim = 4;
|
||||
/// <summary>EIM config index: icif — magnetisation current ratio.</summary>
|
||||
static int const eimc_s_icif = 5;
|
||||
static constexpr int eimc_s_icif = 5;
|
||||
/// <summary>EIM config index: Uzmax — maximum DC link voltage.</summary>
|
||||
static int const eimc_f_Uzmax = 7;
|
||||
static constexpr int eimc_f_Uzmax = 7;
|
||||
/// <summary>EIM config index: Uzh — DC link voltage at field-weakening transition.</summary>
|
||||
static int const eimc_f_Uzh = 8;
|
||||
static constexpr int eimc_f_Uzh = 8;
|
||||
/// <summary>EIM config index: DU — voltage drop at the converter.</summary>
|
||||
static int const eimc_f_DU = 9;
|
||||
static constexpr int eimc_f_DU = 9;
|
||||
/// <summary>EIM config index: I0 — no-load magnetising current.</summary>
|
||||
static int const eimc_f_I0 = 10;
|
||||
static constexpr int eimc_f_I0 = 10;
|
||||
/// <summary>EIM config index: cfu — V/f gain in normal mode.</summary>
|
||||
static int const eimc_f_cfu = 11;
|
||||
static constexpr int eimc_f_cfu = 11;
|
||||
/// <summary>EIM config index: cfuH — V/f gain in field-weakening region.</summary>
|
||||
static int const eimc_f_cfuH = 12;
|
||||
static constexpr int eimc_f_cfuH = 12;
|
||||
/// <summary>EIM config index: F0 — starting force at zero speed.</summary>
|
||||
static int const eimc_p_F0 = 13;
|
||||
static constexpr int eimc_p_F0 = 13;
|
||||
/// <summary>EIM config index: a1 — force-frequency slope coefficient.</summary>
|
||||
static int const eimc_p_a1 = 14;
|
||||
static constexpr int eimc_p_a1 = 14;
|
||||
/// <summary>EIM config index: Pmax — maximum power.</summary>
|
||||
static int const eimc_p_Pmax = 15;
|
||||
static constexpr int eimc_p_Pmax = 15;
|
||||
/// <summary>EIM config index: Fh — force at field-weakening point.</summary>
|
||||
static int const eimc_p_Fh = 16;
|
||||
static constexpr int eimc_p_Fh = 16;
|
||||
/// <summary>EIM config index: Ph — power at field-weakening point.</summary>
|
||||
static int const eimc_p_Ph = 17;
|
||||
static constexpr int eimc_p_Ph = 17;
|
||||
/// <summary>EIM config index: Vh0 — speed where field weakening begins.</summary>
|
||||
static int const eimc_p_Vh0 = 18;
|
||||
static constexpr int eimc_p_Vh0 = 18;
|
||||
/// <summary>EIM config index: Vh1 — speed of full field weakening.</summary>
|
||||
static int const eimc_p_Vh1 = 19;
|
||||
static constexpr int eimc_p_Vh1 = 19;
|
||||
/// <summary>EIM config index: Imax — maximum motor current.</summary>
|
||||
static int const eimc_p_Imax = 20;
|
||||
static constexpr int eimc_p_Imax = 20;
|
||||
/// <summary>EIM config index: abed — anti-skid set point.</summary>
|
||||
static int const eimc_p_abed = 21;
|
||||
static constexpr int eimc_p_abed = 21;
|
||||
/// <summary>EIM config index: eped — EP brake intensity bias.</summary>
|
||||
static int const eimc_p_eped = 22;
|
||||
static constexpr int eimc_p_eped = 22;
|
||||
|
||||
// zmienne dla asynchronów
|
||||
/// <summary>EIM variable index: FMAXMAX — absolute maximum allowable force.</summary>
|
||||
static int const eimv_FMAXMAX = 0;
|
||||
static constexpr int eimv_FMAXMAX = 0;
|
||||
/// <summary>EIM variable index: Fmax — current force limit.</summary>
|
||||
static int const eimv_Fmax = 1;
|
||||
static constexpr int eimv_Fmax = 1;
|
||||
/// <summary>EIM variable index: ks — slip coefficient.</summary>
|
||||
static int const eimv_ks = 2;
|
||||
static constexpr int eimv_ks = 2;
|
||||
/// <summary>EIM variable index: df — frequency offset.</summary>
|
||||
static int const eimv_df = 3;
|
||||
static constexpr int eimv_df = 3;
|
||||
/// <summary>EIM variable index: fp — base frequency.</summary>
|
||||
static int const eimv_fp = 4;
|
||||
static constexpr int eimv_fp = 4;
|
||||
/// <summary>EIM variable index: U — applied voltage.</summary>
|
||||
static int const eimv_U = 5;
|
||||
static constexpr int eimv_U = 5;
|
||||
/// <summary>EIM variable index: pole — pole-pair indicator.</summary>
|
||||
static int const eimv_pole = 6;
|
||||
static constexpr int eimv_pole = 6;
|
||||
/// <summary>EIM variable index: Ic — control current.</summary>
|
||||
static int const eimv_Ic = 7;
|
||||
static constexpr int eimv_Ic = 7;
|
||||
/// <summary>EIM variable index: If — field current.</summary>
|
||||
static int const eimv_If = 8;
|
||||
static constexpr int eimv_If = 8;
|
||||
/// <summary>EIM variable index: M — torque.</summary>
|
||||
static int const eimv_M = 9;
|
||||
static constexpr int eimv_M = 9;
|
||||
/// <summary>EIM variable index: Fr — actual force.</summary>
|
||||
static int const eimv_Fr = 10;
|
||||
static constexpr int eimv_Fr = 10;
|
||||
/// <summary>EIM variable index: Ipoj — line current.</summary>
|
||||
static int const eimv_Ipoj = 11;
|
||||
static constexpr int eimv_Ipoj = 11;
|
||||
/// <summary>EIM variable index: Pm — mechanical power.</summary>
|
||||
static int const eimv_Pm = 12;
|
||||
static constexpr int eimv_Pm = 12;
|
||||
/// <summary>EIM variable index: Pe — electrical power.</summary>
|
||||
static int const eimv_Pe = 13;
|
||||
static constexpr int eimv_Pe = 13;
|
||||
/// <summary>EIM variable index: eta — efficiency.</summary>
|
||||
static int const eimv_eta = 14;
|
||||
static constexpr int eimv_eta = 14;
|
||||
/// <summary>EIM variable index: fkr — critical frequency.</summary>
|
||||
static int const eimv_fkr = 15;
|
||||
static constexpr int eimv_fkr = 15;
|
||||
/// <summary>EIM variable index: Uzsmax — maximum measured DC link voltage.</summary>
|
||||
static int const eimv_Uzsmax = 16;
|
||||
static constexpr int eimv_Uzsmax = 16;
|
||||
/// <summary>EIM variable index: Pmax — instantaneous power limit.</summary>
|
||||
static int const eimv_Pmax = 17;
|
||||
static constexpr int eimv_Pmax = 17;
|
||||
/// <summary>EIM variable index: Fzad — set-point force.</summary>
|
||||
static int const eimv_Fzad = 18;
|
||||
static constexpr int eimv_Fzad = 18;
|
||||
/// <summary>EIM variable index: Imax — maximum allowed current.</summary>
|
||||
static int const eimv_Imax = 19;
|
||||
static constexpr int eimv_Imax = 19;
|
||||
/// <summary>EIM variable index: Fful — full force.</summary>
|
||||
static int const eimv_Fful = 20;
|
||||
static constexpr int eimv_Fful = 20;
|
||||
|
||||
/// <summary>Brake-of-mode flag: PS (pneumatic, primary).</summary>
|
||||
static int const bom_PS = 1;
|
||||
static constexpr int bom_PS = 1;
|
||||
/// <summary>Brake-of-mode flag: PN (pneumatic, no electrodynamic).</summary>
|
||||
static int const bom_PN = 2;
|
||||
static constexpr int bom_PN = 2;
|
||||
/// <summary>Brake-of-mode flag: EP (electro-pneumatic).</summary>
|
||||
static int const bom_EP = 4;
|
||||
static constexpr int bom_EP = 4;
|
||||
/// <summary>Brake-of-mode flag: MED (mixed pneumatic+ED).</summary>
|
||||
static int const bom_MED = 8;
|
||||
static constexpr int bom_MED = 8;
|
||||
|
||||
/// <summary>Bit flags reporting vehicle problems that prevent driving.</summary>
|
||||
enum TProblem // lista problemów taboru, które uniemożliwiają jazdę
|
||||
|
||||
@@ -22,8 +22,8 @@ http://mozilla.org/MPL/2.0/.
|
||||
// Jeśli jakieś zmienne nie są używane w mover.pas, też można je przenosić.
|
||||
// Przeniesienie wszystkiego na raz zrobiło by zbyt wielki chaos do ogarnięcia.
|
||||
|
||||
const double dEpsilon = 0.01; // 1cm (zależy od typu sprzęgu...)
|
||||
const double CouplerTune = 0.1; // skalowanie tlumiennosci
|
||||
constexpr double dEpsilon = 0.01; // 1cm (zależy od typu sprzęgu...)
|
||||
constexpr double CouplerTune = 0.1; // skalowanie tlumiennosci
|
||||
|
||||
int ConversionError = 0;
|
||||
|
||||
@@ -1228,7 +1228,7 @@ void TMoverParameters::CollisionDetect(int const End, double const dt)
|
||||
|
||||
if (coupler.CouplingFlag == faux || true == TestFlag(othervehicle->DamageFlag, dtrain_out))
|
||||
{ // HACK: limit excessive speed derailment checks to vehicles which aren't part of the same consist
|
||||
auto const safevelocitylimit{15.0};
|
||||
constexpr auto safevelocitylimit{15.0};
|
||||
auto const velocitydifference{glm::length(glm::angleAxis(Rot.Rz, glm::dvec3{0, 1, 0}) * V - glm::angleAxis(othervehicle->Rot.Rz, glm::dvec3{0, 1, 0}) * othervehicle->V) *
|
||||
3.6}; // m/s -> km/h
|
||||
|
||||
@@ -1356,8 +1356,8 @@ void TMoverParameters::Derail(DerailReason const Reason)
|
||||
// *************************************************************************************************
|
||||
double TMoverParameters::ComputeMovement(double dt, double dt1, const TTrackShape &Shape, TTrackParam &Track, TTractionParam &ElectricTraction, TLocation const &NewLoc, TRotation const &NewRot)
|
||||
{
|
||||
const double Vepsilon = 1e-5;
|
||||
const double Aepsilon = 1e-3; // ASBSpeed=0.8;
|
||||
constexpr double Vepsilon = 1e-5;
|
||||
constexpr double Aepsilon = 1e-3; // ASBSpeed=0.8;
|
||||
|
||||
if (!TestFlag(DamageFlag, dtrain_out))
|
||||
{ // Ra: to przepisywanie tu jest bez sensu
|
||||
@@ -2117,7 +2117,7 @@ void TMoverParameters::HeatingCheck(double const Timestep)
|
||||
return;
|
||||
}
|
||||
// ...detailed check if we're still here
|
||||
auto const heatingpowerthreshold{0.1};
|
||||
constexpr auto heatingpowerthreshold{0.1};
|
||||
// start with blank slate
|
||||
auto voltage{0.0};
|
||||
// then try specified power source
|
||||
@@ -4122,7 +4122,7 @@ bool TMoverParameters::BrakeReleaser(int state)
|
||||
// *************************************************************************************************
|
||||
bool TMoverParameters::UniversalBrakeButton(int button, int state)
|
||||
{
|
||||
const bool OK = true; // false tylko jeśli nie uda się wysłać, GF 20161124
|
||||
constexpr bool OK = true; // false tylko jeśli nie uda się wysłać, GF 20161124
|
||||
UniversalBrakeButtonActive[button] = state > 0;
|
||||
int flag = 0;
|
||||
if (Power24vIsAvailable || Power110vIsAvailable)
|
||||
@@ -4481,8 +4481,8 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
||||
Pipe->Act();
|
||||
}
|
||||
|
||||
const double LBDelay = 100;
|
||||
const double kL = 0.5;
|
||||
constexpr double LBDelay = 100;
|
||||
constexpr double kL = 0.5;
|
||||
// double dV;
|
||||
// TMoverParameters *c; // T_MoverParameters
|
||||
double temp;
|
||||
@@ -4768,7 +4768,7 @@ void TMoverParameters::UpdateScndPipePressure(double dt)
|
||||
Pipe2->Act();
|
||||
}
|
||||
|
||||
const double Spz = 0.5067;
|
||||
constexpr double Spz = 0.5067;
|
||||
TMoverParameters *c;
|
||||
double dv1, dv2, dV;
|
||||
|
||||
@@ -5267,9 +5267,9 @@ double TMoverParameters::FrictionForce() const
|
||||
double TMoverParameters::Adhesive(double staticfriction) const
|
||||
{
|
||||
double adhesion = 0.0;
|
||||
const double adh_factor = 0.25; // współczynnik określający, jak bardzo spada tarcie przy poślizgu
|
||||
const double slipfactor = 0.33; // współczynnik określający, jak szybko spada tarcie przy poślizgu
|
||||
const double sandfactor = 1.25; // współczynnik określający, jak mocno pomaga piasek
|
||||
constexpr double adh_factor = 0.25; // współczynnik określający, jak bardzo spada tarcie przy poślizgu
|
||||
constexpr double slipfactor = 0.33; // współczynnik określający, jak szybko spada tarcie przy poślizgu
|
||||
constexpr double sandfactor = 1.25; // współczynnik określający, jak mocno pomaga piasek
|
||||
/*
|
||||
// ABu: male przerobki, tylko czy to da jakikolwiek skutek w FPS?
|
||||
// w kazdym razie zaciemni kod na pewno :)
|
||||
@@ -6715,7 +6715,7 @@ bool TMoverParameters::RelayReset(int const Relays, range_t const Notify)
|
||||
double TMoverParameters::v2n(void)
|
||||
{
|
||||
// przelicza predkosc liniowa na obrotowa
|
||||
const double dmgn = 0.5;
|
||||
constexpr double dmgn = 0.5;
|
||||
double n, deltan = 0;
|
||||
|
||||
n = V / (M_PI * WheelDiameter); // predkosc obrotowa wynikajaca z liniowej [obr/s]
|
||||
@@ -7912,7 +7912,7 @@ bool TMoverParameters::dizel_Update(double dt)
|
||||
{
|
||||
dizel_EngageChange(dt);
|
||||
DU = dizel_AutoGearCheck();
|
||||
double const fillspeed{2};
|
||||
constexpr double fillspeed{2};
|
||||
dizel_fill = dizel_fill + fillspeed * dt * (dizel_fillcheck(MainCtrlPos, dt) - dizel_fill);
|
||||
}
|
||||
|
||||
@@ -8262,14 +8262,14 @@ void TMoverParameters::dizel_HeatSet(float const Value)
|
||||
void TMoverParameters::dizel_Heat(double const dt)
|
||||
{
|
||||
|
||||
auto const qs{44700.0};
|
||||
auto const Cs{11000.0};
|
||||
auto const Cw{4.189};
|
||||
auto const Co{1.885};
|
||||
auto const gwmin{400.0};
|
||||
auto const gwmax{4000.0};
|
||||
auto const gwmin2{400.0};
|
||||
auto const gwmax2{4000.0};
|
||||
constexpr auto qs{44700.0};
|
||||
constexpr auto Cs{11000.0};
|
||||
constexpr auto Cw{4.189};
|
||||
constexpr auto Co{1.885};
|
||||
constexpr auto gwmin{400.0};
|
||||
constexpr auto gwmax{4000.0};
|
||||
constexpr auto gwmin2{400.0};
|
||||
constexpr auto gwmax2{4000.0};
|
||||
|
||||
dizel_heat.Te = Global.AirTemperature;
|
||||
|
||||
@@ -8323,7 +8323,7 @@ void TMoverParameters::dizel_Heat(double const dt)
|
||||
*/
|
||||
auto const Qp = (true == WaterHeater.is_active && true == WaterPump.is_active && dizel_heat.Twy < 60 && dizel_heat.Twy2 < 60 ? 1 : 0) * 1000;
|
||||
|
||||
auto const kurek07{1}; // unknown/unimplemented device TBD, TODO: identify and implement?
|
||||
constexpr auto kurek07{1}; // unknown/unimplemented device TBD, TODO: identify and implement?
|
||||
|
||||
if (true == dizel_heat.auxiliary_water_circuit)
|
||||
{
|
||||
@@ -9041,7 +9041,7 @@ bool issection(std::string const &Name, std::string const &Input)
|
||||
|
||||
int s2NPW(std::string s)
|
||||
{ // wylicza ilosc osi napednych z opisu ukladu osi
|
||||
const char A = 64;
|
||||
constexpr char A = 64;
|
||||
int NPW = 0;
|
||||
for (std::size_t k = 0; k < s.size(); ++k)
|
||||
{
|
||||
@@ -9053,7 +9053,7 @@ int s2NPW(std::string s)
|
||||
|
||||
int s2NNW(std::string s)
|
||||
{ // wylicza ilosc osi nienapedzanych z opisu ukladu osi
|
||||
const char Zero = 48;
|
||||
constexpr char Zero = 48;
|
||||
int NNW = 0;
|
||||
for (std::size_t k = 0; k < s.size(); ++k)
|
||||
{
|
||||
@@ -9606,9 +9606,9 @@ void TMoverParameters::BrakeSubsystemDecode()
|
||||
bool TMoverParameters::LoadFIZ(std::string chkpath)
|
||||
{
|
||||
chkPath = chkpath; // assign class path for reloading
|
||||
const int param_ok = 1;
|
||||
const int wheels_ok = 2;
|
||||
const int dimensions_ok = 4;
|
||||
constexpr int param_ok = 1;
|
||||
constexpr int wheels_ok = 2;
|
||||
constexpr int dimensions_ok = 4;
|
||||
|
||||
ConversionError = 666;
|
||||
LISTLINE = 0;
|
||||
@@ -10388,7 +10388,7 @@ void TMoverParameters::LoadFIZ_Wheels(std::string const &line)
|
||||
AxleInertialMoment = 1.0;
|
||||
*/
|
||||
// approximation formula by youby
|
||||
auto const k = 472.0; // arbitrary constant
|
||||
constexpr auto k = 472.0; // arbitrary constant
|
||||
AxleInertialMoment = k / 4.0 * std::pow(WheelDiameter, 4.0) * NAxles;
|
||||
Mred = k * std::pow(WheelDiameter, 2.0) * NAxles;
|
||||
}
|
||||
@@ -11504,7 +11504,7 @@ void TMoverParameters::LoadFIZ_DList(std::string const &Input)
|
||||
// Calculation of fuel consumption coefficient for futher calculation
|
||||
const double dizel_max_power = dizel_nmax * (dizel_Mnmax - dizel_Mstand) * M_PI * 2 * 0.001; // power in kW
|
||||
const double dizel_max_energy = dizel_max_power; // energy per one hour in kWh is equal to power in kW times 1 h
|
||||
const double fuel_density = 850; // g/l
|
||||
constexpr double fuel_density = 850; // g/l
|
||||
dizel_FuelConsumption = dizel_NominalFuelConsumptionRate * dizel_max_energy / fuel_density / dizel_nmax;
|
||||
}
|
||||
|
||||
|
||||
@@ -458,10 +458,10 @@ void TNESt3::SetLBP(double const P)
|
||||
|
||||
void TNESt3::SetSize( int const size, std::string const ¶ms ) // ustawianie dysz (rozmiaru ZR)
|
||||
{
|
||||
static double const dNO1l = 1.250;
|
||||
static double const dNT1l = 0.510;
|
||||
static double const dOO1l = 0.907;
|
||||
static double const dOT1l = 0.524;
|
||||
static constexpr double dNO1l = 1.250;
|
||||
static constexpr double dNT1l = 0.510;
|
||||
static constexpr double dOO1l = 0.907;
|
||||
static constexpr double dOT1l = 0.524;
|
||||
|
||||
if (contains( params, "ESt3" ) )
|
||||
{
|
||||
|
||||
@@ -45,26 +45,26 @@ Co brakuje:
|
||||
- PZZ dla dodatkowego
|
||||
*/
|
||||
|
||||
static int const dMAX = 11; // dysze
|
||||
static int const dON = 0; // osobowy napelnianie (+ZP)
|
||||
static int const dOO = 1; // osobowy oproznianie
|
||||
static int const dTN = 2; // towarowy napelnianie (+ZP)
|
||||
static int const dTO = 3; // towarowy oproznianie
|
||||
static int const dP = 4; // zbiornik pomocniczy
|
||||
static int const dSd = 5; // zbiornik sterujacy
|
||||
static int const dSm = 6; // zbiornik sterujacy
|
||||
static int const dPd = 7; // duzy przelot zamykajcego
|
||||
static int const dPm = 8; // maly przelot zamykajacego
|
||||
static int const dPO = 9; // zasilanie pomocniczego O
|
||||
static int const dPT = 10; // zasilanie pomocniczego T
|
||||
static constexpr int dMAX = 11; // dysze
|
||||
static constexpr int dON = 0; // osobowy napelnianie (+ZP)
|
||||
static constexpr int dOO = 1; // osobowy oproznianie
|
||||
static constexpr int dTN = 2; // towarowy napelnianie (+ZP)
|
||||
static constexpr int dTO = 3; // towarowy oproznianie
|
||||
static constexpr int dP = 4; // zbiornik pomocniczy
|
||||
static constexpr int dSd = 5; // zbiornik sterujacy
|
||||
static constexpr int dSm = 6; // zbiornik sterujacy
|
||||
static constexpr int dPd = 7; // duzy przelot zamykajcego
|
||||
static constexpr int dPm = 8; // maly przelot zamykajacego
|
||||
static constexpr int dPO = 9; // zasilanie pomocniczego O
|
||||
static constexpr int dPT = 10; // zasilanie pomocniczego T
|
||||
|
||||
// przekladniki
|
||||
static int const p_none = 0;
|
||||
static int const p_rapid = 1;
|
||||
static int const p_pp = 2;
|
||||
static int const p_al2 = 3;
|
||||
static int const p_ppz = 4;
|
||||
static int const P_ed = 5;
|
||||
static constexpr int p_none = 0;
|
||||
static constexpr int p_rapid = 1;
|
||||
static constexpr int p_pp = 2;
|
||||
static constexpr int p_al2 = 3;
|
||||
static constexpr int p_ppz = 4;
|
||||
static constexpr int P_ed = 5;
|
||||
|
||||
class TPrzekladnik : public TReservoir // przekladnik (powtarzacz)
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ Copyright (C) 2007-2014 Maciej Cierniak
|
||||
|
||||
//---FUNKCJE OGOLNE---
|
||||
|
||||
static double const DPL = 0.25;
|
||||
static constexpr double DPL = 0.25;
|
||||
double const TFV4aM::pos_table[11] = {-2, 6, -1, 0, -2, 1, 4, 6, 0, 0, 0};
|
||||
double const TMHZ_EN57::pos_table[11] = {-1, 10, -1, 0, 0, 2, 9, 10, 0, 0, 0};
|
||||
double const TMHZ_K5P::pos_table[11] = {-1, 3, -1, 0, 1, 1, 2, 3, 0, 0, 0};
|
||||
@@ -108,7 +108,7 @@ double PF(double const P1, double const P2, double const S, double const DP)
|
||||
/// <returns>Volumetric flow rate (signed).</returns>
|
||||
double PF1(double const P1, double const P2, double const S)
|
||||
{
|
||||
static double const DPS = 0.001;
|
||||
static constexpr double DPS = 0.001;
|
||||
|
||||
double const PH = std::max(P1, P2) + 1.0; // wyzsze cisnienie absolutne
|
||||
double const PL = P1 + P2 - PH + 2.0; // nizsze cisnienie absolutne
|
||||
@@ -303,10 +303,10 @@ end; */
|
||||
/// <returns>Cylinder pressure in bar.</returns>
|
||||
double TBrakeCyl::P()
|
||||
{
|
||||
static double const VS = 0.005;
|
||||
static double const pS = 0.05;
|
||||
static double const VD = 1.10;
|
||||
static double const cD = 1;
|
||||
static constexpr double VS = 0.005;
|
||||
static constexpr double pS = 0.05;
|
||||
static constexpr double VD = 1.10;
|
||||
static constexpr double cD = 1;
|
||||
static double const pD = VD - cD;
|
||||
|
||||
const double VtoC = Cap > 0.0 ? Vol / Cap : 0.0; // stosunek cisnienia do objetosci.
|
||||
@@ -2968,7 +2968,7 @@ void TDriverHandle::SetUniversalFlag(int flag)
|
||||
/// <returns>Brake pipe volume change for this step.</returns>
|
||||
double TFV4a::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
|
||||
{
|
||||
static int const LBDelay = 100;
|
||||
static constexpr int LBDelay = 100;
|
||||
|
||||
ep = PP; // SPKS!!
|
||||
double LimPP = std::min(BPT[std::lround(i_bcp) + 2][1], HP);
|
||||
@@ -3057,8 +3057,8 @@ void TFV4a::Init(double Press)
|
||||
/// <returns>Brake pipe volume change for this step.</returns>
|
||||
double TFV4aM::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
|
||||
{
|
||||
int const LBDelay{100};
|
||||
double const xpM{0.3}; // mnoznik membrany komory pod
|
||||
constexpr int LBDelay{100};
|
||||
constexpr double xpM{0.3}; // mnoznik membrany komory pod
|
||||
|
||||
ep = PP / 2.0 * 1.5 + ep / 2.0 * 0.5; // SPKS!!
|
||||
|
||||
@@ -3293,7 +3293,7 @@ bool TFV4aM::EQ(double pos, double i_pos)
|
||||
/// <returns>Brake pipe volume change for this step.</returns>
|
||||
double TMHZ_EN57::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
|
||||
{
|
||||
static int const LBDelay = 100;
|
||||
static constexpr int LBDelay = 100;
|
||||
|
||||
double LimPP;
|
||||
double dpPipe;
|
||||
@@ -3502,7 +3502,7 @@ bool TMHZ_EN57::EQ(double pos, double i_pos)
|
||||
/// <returns>Brake pipe volume change for this step.</returns>
|
||||
double TMHZ_K5P::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
|
||||
{
|
||||
static int const LBDelay = 100;
|
||||
static constexpr int LBDelay = 100;
|
||||
|
||||
double LimCP;
|
||||
double dpPipe;
|
||||
@@ -3685,7 +3685,7 @@ bool TMHZ_K5P::EQ(double pos, double i_pos)
|
||||
/// <returns>Brake pipe volume change for this step.</returns>
|
||||
double TMHZ_6P::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
|
||||
{
|
||||
static int const LBDelay = 100;
|
||||
static constexpr int LBDelay = 100;
|
||||
|
||||
double LimCP;
|
||||
double dpPipe;
|
||||
@@ -3869,7 +3869,7 @@ bool TMHZ_6P::EQ(double pos, double i_pos)
|
||||
/// <returns>Brake pipe volume change for this step.</returns>
|
||||
double TM394::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
|
||||
{
|
||||
static int const LBDelay = 65;
|
||||
static constexpr int LBDelay = 65;
|
||||
|
||||
double LimPP;
|
||||
double dpPipe;
|
||||
@@ -3965,10 +3965,10 @@ double TM394::GetPos(int i)
|
||||
/// <returns>Brake pipe volume change for this step.</returns>
|
||||
double TH14K1::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
|
||||
{
|
||||
int const LBDelay = 100; // szybkosc + zasilanie sterujacego
|
||||
constexpr int LBDelay = 100; // szybkosc + zasilanie sterujacego
|
||||
// static double const BPT_K[/*?*/ /*-1..4*/ (4) - (-1) + 1][2] =
|
||||
//{ (10, 0), (4, 1), (0, 1), (4, 0), (4, -1), (15, -1) };
|
||||
double const NomPress = 5.0;
|
||||
constexpr double NomPress = 5.0;
|
||||
|
||||
int BCP = std::lround(i_bcp);
|
||||
if (i_bcp < -1)
|
||||
@@ -4057,8 +4057,8 @@ double TH14K1::GetPos(int i)
|
||||
/// <returns>Brake pipe volume change for this step.</returns>
|
||||
double TSt113::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
|
||||
{
|
||||
static int const LBDelay = 100; // szybkosc + zasilanie sterujacego
|
||||
static double const NomPress = 5.0;
|
||||
static constexpr int LBDelay = 100; // szybkosc + zasilanie sterujacego
|
||||
static constexpr double NomPress = 5.0;
|
||||
|
||||
double LimPP;
|
||||
double dpMainValve;
|
||||
@@ -4149,7 +4149,7 @@ void TSt113::Init(double Press)
|
||||
/// <returns>Brake pipe volume change for this step.</returns>
|
||||
double Ttest::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
|
||||
{
|
||||
static int const LBDelay = 100;
|
||||
static constexpr int LBDelay = 100;
|
||||
|
||||
double LimPP;
|
||||
double dpPipe;
|
||||
@@ -4302,7 +4302,7 @@ double TH1405::GetCP()
|
||||
/// <returns>Brake pipe volume change for this step.</returns>
|
||||
double TFVel6::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
|
||||
{
|
||||
static int const LBDelay = 100;
|
||||
static constexpr int LBDelay = 100;
|
||||
|
||||
double LimPP;
|
||||
double dpMainValve;
|
||||
@@ -4399,7 +4399,7 @@ void TFVel6::Init(double Press)
|
||||
/// <returns>Brake pipe volume change for this step.</returns>
|
||||
double TFVE408::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
|
||||
{
|
||||
static int const LBDelay = 100;
|
||||
static constexpr int LBDelay = 100;
|
||||
|
||||
double LimPP;
|
||||
double dpMainValve;
|
||||
|
||||
@@ -36,150 +36,150 @@ Knorr/West EP - żeby był
|
||||
#include "friction.h" // Pascal unit
|
||||
|
||||
/// <summary>Number of positions of the local (auxiliary/manual) brake handle.</summary>
|
||||
static int const LocalBrakePosNo = 10; /*ilosc nastaw hamulca recznego lub pomocniczego*/
|
||||
static constexpr int LocalBrakePosNo = 10; /*ilosc nastaw hamulca recznego lub pomocniczego*/
|
||||
/// <summary>Maximum number of positions of the main (train) brake handle.</summary>
|
||||
static int const MainBrakeMaxPos = 10; /*max. ilosc nastaw hamulca zasadniczego*/
|
||||
static constexpr int MainBrakeMaxPos = 10; /*max. ilosc nastaw hamulca zasadniczego*/
|
||||
|
||||
/*nastawy hamulca*/
|
||||
/// <summary>Brake delay setting flag: G (goods/freight slow).</summary>
|
||||
static int const bdelay_G = 1; // G
|
||||
static constexpr int bdelay_G = 1; // G
|
||||
/// <summary>Brake delay setting flag: P (passenger fast).</summary>
|
||||
static int const bdelay_P = 2; // P
|
||||
static constexpr int bdelay_P = 2; // P
|
||||
/// <summary>Brake delay setting flag: R (rapid - high braking force).</summary>
|
||||
static int const bdelay_R = 4; // R
|
||||
static constexpr int bdelay_R = 4; // R
|
||||
/// <summary>Brake delay setting flag: Mg (magnetic rail brake enabled).</summary>
|
||||
static int const bdelay_M = 8; // Mg
|
||||
static constexpr int bdelay_M = 8; // Mg
|
||||
|
||||
/*stan hamulca*/
|
||||
/// <summary>Brake state flag: brake released (no action).</summary>
|
||||
static int const b_off = 0; // luzowanie
|
||||
static constexpr int b_off = 0; // luzowanie
|
||||
/// <summary>Brake state flag: hold (lap) - keep current cylinder pressure.</summary>
|
||||
static int const b_hld = 1; // trzymanie
|
||||
static constexpr int b_hld = 1; // trzymanie
|
||||
/// <summary>Brake state flag: applying - filling brake cylinder.</summary>
|
||||
static int const b_on = 2; // napelnianie
|
||||
static constexpr int b_on = 2; // napelnianie
|
||||
/// <summary>Brake state flag: replenishing the auxiliary reservoir.</summary>
|
||||
static int const b_rfl = 4; // uzupelnianie
|
||||
static constexpr int b_rfl = 4; // uzupelnianie
|
||||
/// <summary>Brake state flag: releaser engaged (vents the control reservoir to release brakes).</summary>
|
||||
static int const b_rls = 8; // odluzniacz
|
||||
static constexpr int b_rls = 8; // odluzniacz
|
||||
/// <summary>Brake state flag: electro-pneumatic action active.</summary>
|
||||
static int const b_ep = 16; // elektropneumatyczny
|
||||
static constexpr int b_ep = 16; // elektropneumatyczny
|
||||
/// <summary>Brake state flag: anti-slip protection holding the brake (preventing further filling).</summary>
|
||||
static int const b_asb = 32; // przeciwposlizg-wstrzymanie
|
||||
static constexpr int b_asb = 32; // przeciwposlizg-wstrzymanie
|
||||
/// <summary>Brake state flag: anti-slip protection releasing the brake.</summary>
|
||||
static int const b_asb_unbrake = 64; // przeciwposlizg-luzowanie
|
||||
static constexpr int b_asb_unbrake = 64; // przeciwposlizg-luzowanie
|
||||
/// <summary>Brake state flag: brake disabled / damaged.</summary>
|
||||
static int const b_dmg = 128; // wylaczony z dzialania
|
||||
static constexpr int b_dmg = 128; // wylaczony z dzialania
|
||||
|
||||
/*uszkodzenia hamulca*/
|
||||
/// <summary>Brake damage flag: faulty filling phase.</summary>
|
||||
static int const df_on = 1; // napelnianie
|
||||
static constexpr int df_on = 1; // napelnianie
|
||||
/// <summary>Brake damage flag: faulty release phase.</summary>
|
||||
static int const df_off = 2; // luzowanie
|
||||
static constexpr int df_off = 2; // luzowanie
|
||||
/// <summary>Brake damage flag: leak in auxiliary reservoir (ZP).</summary>
|
||||
static int const df_br = 4; // wyplyw z ZP
|
||||
static constexpr int df_br = 4; // wyplyw z ZP
|
||||
/// <summary>Brake damage flag: leak in valve pre-chamber.</summary>
|
||||
static int const df_vv = 8; // wyplyw z komory wstepnej
|
||||
static constexpr int df_vv = 8; // wyplyw z komory wstepnej
|
||||
/// <summary>Brake damage flag: leak in brake cylinder.</summary>
|
||||
static int const df_bc = 16; // wyplyw z silownika
|
||||
static constexpr int df_bc = 16; // wyplyw z silownika
|
||||
/// <summary>Brake damage flag: leak in control reservoir (ZS).</summary>
|
||||
static int const df_cv = 32; // wyplyw z ZS
|
||||
static constexpr int df_cv = 32; // wyplyw z ZS
|
||||
/// <summary>Brake damage flag: stuck at low load step.</summary>
|
||||
static int const df_PP = 64; // zawsze niski stopien
|
||||
static constexpr int df_PP = 64; // zawsze niski stopien
|
||||
/// <summary>Brake damage flag: stuck at high load step.</summary>
|
||||
static int const df_RR = 128; // zawsze wysoki stopien
|
||||
static constexpr int df_RR = 128; // zawsze wysoki stopien
|
||||
|
||||
/*indeksy dzwiekow FV4a*/
|
||||
/// <summary>FV4a sound index: braking flow.</summary>
|
||||
static int const s_fv4a_b = 0; // hamowanie
|
||||
static constexpr int s_fv4a_b = 0; // hamowanie
|
||||
/// <summary>FV4a sound index: release flow.</summary>
|
||||
static int const s_fv4a_u = 1; // luzowanie
|
||||
static constexpr int s_fv4a_u = 1; // luzowanie
|
||||
/// <summary>FV4a sound index: emergency braking flow.</summary>
|
||||
static int const s_fv4a_e = 2; // hamowanie nagle
|
||||
static constexpr int s_fv4a_e = 2; // hamowanie nagle
|
||||
/// <summary>FV4a sound index: control wave outflow.</summary>
|
||||
static int const s_fv4a_x = 3; // wyplyw sterujacego fala
|
||||
static constexpr int s_fv4a_x = 3; // wyplyw sterujacego fala
|
||||
/// <summary>FV4a sound index: timing chamber outflow.</summary>
|
||||
static int const s_fv4a_t = 4; // wyplyw z czasowego
|
||||
static constexpr int s_fv4a_t = 4; // wyplyw z czasowego
|
||||
|
||||
/*pary cierne*/
|
||||
/// <summary>Friction pair: P10 (default cast iron).</summary>
|
||||
static int const bp_P10 = 0;
|
||||
static constexpr int bp_P10 = 0;
|
||||
/// <summary>Friction pair: P10 phosphoric cast iron with Bg block.</summary>
|
||||
static int const bp_P10Bg = 2; // żeliwo fosforowe P10
|
||||
static constexpr int bp_P10Bg = 2; // żeliwo fosforowe P10
|
||||
/// <summary>Friction pair: P10 phosphoric cast iron with Bgu block.</summary>
|
||||
static int const bp_P10Bgu = 1;
|
||||
static constexpr int bp_P10Bgu = 1;
|
||||
/// <summary>Friction pair: low-friction composite (b.n.t.) with Bg block.</summary>
|
||||
static int const bp_LLBg = 4; // komp. b.n.t.
|
||||
static constexpr int bp_LLBg = 4; // komp. b.n.t.
|
||||
/// <summary>Friction pair: low-friction composite (b.n.t.) with Bgu block.</summary>
|
||||
static int const bp_LLBgu = 3;
|
||||
static constexpr int bp_LLBgu = 3;
|
||||
/// <summary>Friction pair: low-friction composite (n.t.) with Bg block.</summary>
|
||||
static int const bp_LBg = 6; // komp. n.t.
|
||||
static constexpr int bp_LBg = 6; // komp. n.t.
|
||||
/// <summary>Friction pair: low-friction composite (n.t.) with Bgu block.</summary>
|
||||
static int const bp_LBgu = 5;
|
||||
static constexpr int bp_LBgu = 5;
|
||||
/// <summary>Friction pair: high-friction composite (w.t.) with Bg block.</summary>
|
||||
static int const bp_KBg = 8; // komp. w.t.
|
||||
static constexpr int bp_KBg = 8; // komp. w.t.
|
||||
/// <summary>Friction pair: high-friction composite (w.t.) with Bgu block.</summary>
|
||||
static int const bp_KBgu = 7;
|
||||
static constexpr int bp_KBgu = 7;
|
||||
/// <summary>Friction pair: disc brake type 1.</summary>
|
||||
static int const bp_D1 = 9; // tarcze
|
||||
static constexpr int bp_D1 = 9; // tarcze
|
||||
/// <summary>Friction pair: disc brake type 2.</summary>
|
||||
static int const bp_D2 = 10;
|
||||
static constexpr int bp_D2 = 10;
|
||||
/// <summary>Friction pair: Frenoplast FR513 composite.</summary>
|
||||
static int const bp_FR513 = 11; // Frenoplast FR513
|
||||
static constexpr int bp_FR513 = 11; // Frenoplast FR513
|
||||
/// <summary>Friction pair: Cosid composite.</summary>
|
||||
static int const bp_Cosid = 12; // jakistam kompozyt :D
|
||||
static constexpr int bp_Cosid = 12; // jakistam kompozyt :D
|
||||
/// <summary>Friction pair: PKP cast iron with Bg block.</summary>
|
||||
static int const bp_PKPBg = 13; // żeliwo PKP
|
||||
static constexpr int bp_PKPBg = 13; // żeliwo PKP
|
||||
/// <summary>Friction pair: PKP cast iron with Bgu block.</summary>
|
||||
static int const bp_PKPBgu = 14;
|
||||
static constexpr int bp_PKPBgu = 14;
|
||||
/// <summary>Friction pair flag: magnetic rail brake (added bitwise to other types).</summary>
|
||||
static int const bp_MHS = 128; // magnetyczny hamulec szynowy
|
||||
static constexpr int bp_MHS = 128; // magnetyczny hamulec szynowy
|
||||
/// <summary>Friction pair: P10y phosphoric cast iron with Bg block.</summary>
|
||||
static int const bp_P10yBg = 15; // żeliwo fosforowe P10
|
||||
static constexpr int bp_P10yBg = 15; // żeliwo fosforowe P10
|
||||
/// <summary>Friction pair: P10y phosphoric cast iron with Bgu block.</summary>
|
||||
static int const bp_P10yBgu = 16;
|
||||
static constexpr int bp_P10yBgu = 16;
|
||||
/// <summary>Friction pair: Frenoplast FR510 composite.</summary>
|
||||
static int const bp_FR510 = 17; // Frenoplast FR510
|
||||
static constexpr int bp_FR510 = 17; // Frenoplast FR510
|
||||
|
||||
/// <summary>Sound flag: accelerator (rapid pressure drop in valve pre-chamber).</summary>
|
||||
static int const sf_Acc = 1; // przyspieszacz
|
||||
static constexpr int sf_Acc = 1; // przyspieszacz
|
||||
/// <summary>Sound flag: brake transmission/load relay actuating.</summary>
|
||||
static int const sf_BR = 2; // przekladnia
|
||||
static constexpr int sf_BR = 2; // przekladnia
|
||||
/// <summary>Sound flag: brake cylinder filling.</summary>
|
||||
static int const sf_CylB = 4; // cylinder - napelnianie
|
||||
static constexpr int sf_CylB = 4; // cylinder - napelnianie
|
||||
/// <summary>Sound flag: brake cylinder venting.</summary>
|
||||
static int const sf_CylU = 8; // cylinder - oproznianie
|
||||
static constexpr int sf_CylU = 8; // cylinder - oproznianie
|
||||
/// <summary>Sound flag: releaser actuated.</summary>
|
||||
static int const sf_rel = 16; // odluzniacz
|
||||
static constexpr int sf_rel = 16; // odluzniacz
|
||||
/// <summary>Sound flag: electro-pneumatic valves switching.</summary>
|
||||
static int const sf_ep = 32; // zawory ep
|
||||
static constexpr int sf_ep = 32; // zawory ep
|
||||
|
||||
/// <summary>Brake handle position index: minimum position.</summary>
|
||||
static int const bh_MIN = 0; // minimalna pozycja
|
||||
static constexpr int bh_MIN = 0; // minimalna pozycja
|
||||
/// <summary>Brake handle position index: maximum position.</summary>
|
||||
static int const bh_MAX = 1; // maksymalna pozycja
|
||||
static constexpr int bh_MAX = 1; // maksymalna pozycja
|
||||
/// <summary>Brake handle position index: filling stroke (high-pressure overcharge); if not present, equivalent to running.</summary>
|
||||
static int const bh_FS = 2; // napelnianie uderzeniowe //jesli nie ma, to jazda
|
||||
static constexpr int bh_FS = 2; // napelnianie uderzeniowe //jesli nie ma, to jazda
|
||||
/// <summary>Brake handle position index: running (driving) position.</summary>
|
||||
static int const bh_RP = 3; // jazda
|
||||
static constexpr int bh_RP = 3; // jazda
|
||||
/// <summary>Brake handle position index: cut-off (double traction / neutral).</summary>
|
||||
static int const bh_NP = 4; // odciecie - podwojna trakcja
|
||||
static constexpr int bh_NP = 4; // odciecie - podwojna trakcja
|
||||
/// <summary>Brake handle position index: minimum braking step (lap or first step).</summary>
|
||||
static int const bh_MB = 5; // odciecie - utrzymanie stopnia hamowania/pierwszy 1 stopien hamowania
|
||||
static constexpr int bh_MB = 5; // odciecie - utrzymanie stopnia hamowania/pierwszy 1 stopien hamowania
|
||||
/// <summary>Brake handle position index: full service brake.</summary>
|
||||
static int const bh_FB = 6; // pelne
|
||||
static constexpr int bh_FB = 6; // pelne
|
||||
/// <summary>Brake handle position index: emergency brake.</summary>
|
||||
static int const bh_EB = 7; // nagle
|
||||
static constexpr int bh_EB = 7; // nagle
|
||||
/// <summary>Brake handle position index: EP release (full release for angular EP).</summary>
|
||||
static int const bh_EPR = 8; // ep - luzowanie //pelny luz dla ep kątowego
|
||||
static constexpr int bh_EPR = 8; // ep - luzowanie //pelny luz dla ep kątowego
|
||||
/// <summary>Brake handle position index: EP hold/lap; if equal to release, button-only EP control.</summary>
|
||||
static int const bh_EPN = 9; // ep - utrzymanie //jesli rowne luzowaniu, wtedy sterowanie przyciskiem
|
||||
static constexpr int bh_EPN = 9; // ep - utrzymanie //jesli rowne luzowaniu, wtedy sterowanie przyciskiem
|
||||
/// <summary>Brake handle position index: EP brake (full braking for angular EP).</summary>
|
||||
static int const bh_EPB = 10; // ep - hamowanie //pelne hamowanie dla ep kątowego
|
||||
static constexpr int bh_EPB = 10; // ep - hamowanie //pelne hamowanie dla ep kątowego
|
||||
|
||||
/// <summary>Diameter of the brake pipe (1") used in flow calculations.</summary>
|
||||
static double const SpgD = 0.7917;
|
||||
static constexpr double SpgD = 0.7917;
|
||||
/// <summary>Cross-section of a 1" brake pipe expressed in l/m (used to keep volumes in liters and lengths in meters).</summary>
|
||||
static double const SpO = 0.5067; // przekroj przewodu 1" w l/m
|
||||
static constexpr double SpO = 0.5067; // przekroj przewodu 1" w l/m
|
||||
// wyj: jednostka dosyc dziwna, ale wszystkie obliczenia
|
||||
// i pojemnosci sa podane w litrach (rozsadne wielkosci)
|
||||
// zas dlugosc pojazdow jest podana w metrach
|
||||
|
||||
Reference in New Issue
Block a user