mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-12-02 09:36:48 +01:00
refactor(physics): TMoverParameters becomes physics::Vehicle, the mover is gone
The physics of a vehicle loses the name it had from the Pascal of 2001. Done by
tools/rename/mover_to_physics.py, committed with it:
physics/mover.h physics/vehicle.h
TMoverParameters physics::Vehicle (in namespace physics)
TDynamicObject::MoverParameters physics
mvOccupied, mvControlled occupied, controlled (TTrain, TController)
mvSecond, mvThird secondUnit, thirdUnit
mvPantographUnit pantographUnit
mover, Mover, movers physics, Physics, vehicles (locals, params)
m_mover, othermover, currentMover, from_movers, renderMoverEventSounds
m_physics, otherPhysics, currentPhysics,
from_vehicles, renderPhysicsEventSounds
The code and the comments are renamed, the string literals are not: no text
the game shows, logs or looks up has changed (none had the names). The movers
of the editor, the tracks a slide moves, keep their name.
By hand: two member functions of TDynamicObject (gather_off_track_terrain,
begin_off_track) had a local mover aliasing their own MoverParameters, which
the rename made physics { *physics }; the alias is gone, they use physics->.
No other function has a renamed local meeting a renamed member (checked over
all the functions of the code before the rename).
For the branches made before it: run the script on the branch (python
tools/rename/mover_to_physics.py, from the root of the repository) before
merging it with this one, and the names don't conflict. It can be run again;
the second time it changes nothing.
The class is the same as it was; breaking it into its parts (braking,
electrics, controls, load) and making its data private are the next stages.
No change in behaviour: 1149/1149 tests, golden traces exact against staging
62f7a29b.
This commit is contained in:
@@ -10,7 +10,7 @@ http://mozilla.org/MPL/2.0/.
|
||||
// the traction motors and their forces for each kind of drive, the relays, the fuses, the dynamic brake
|
||||
|
||||
#include "stdafx.h"
|
||||
#include "physics/mover.h"
|
||||
#include "physics/vehicle.h"
|
||||
#include "vehicle/DynObj.h"
|
||||
#include "physics/oerlikonest.h"
|
||||
#include "utilities/Globals.h"
|
||||
@@ -59,7 +59,7 @@ double TableInterpolation(std::map<double, double> &Map, double Parameter)
|
||||
// Q: 20160716
|
||||
// Obliczanie natężenie prądu w silnikach
|
||||
// *************************************************************************************************
|
||||
double TMoverParameters::Current(double n, double U)
|
||||
double physics::Vehicle::Current(double n, double U)
|
||||
{
|
||||
// wazna funkcja - liczy prad plynacy przez silniki polaczone szeregowo lub rownolegle
|
||||
// w zaleznosci od polozenia nastawnikow MainCtrl i ScndCtrl oraz predkosci obrotowej n
|
||||
@@ -130,7 +130,7 @@ double TMoverParameters::Current(double n, double U)
|
||||
}
|
||||
|
||||
// the automatic dynamic brake of the series motors (EP09, the units) on or off, and the distributor told of it
|
||||
void TMoverParameters::UpdateSeriesMotorDynamicBrakeFlag()
|
||||
void physics::Vehicle::UpdateSeriesMotorDynamicBrakeFlag()
|
||||
{
|
||||
// i dzialanie hamulca ED w EP09
|
||||
if (DynamicBrakeType == dbrake_automatic && TrainType != train_type::emu)
|
||||
@@ -165,7 +165,7 @@ void TMoverParameters::UpdateSeriesMotorDynamicBrakeFlag()
|
||||
|
||||
// the current of the series motors connected, at the revolutions n and the voltage U, through the resistance R of
|
||||
// Mn motors in series
|
||||
double TMoverParameters::SeriesMotorCurrent(double const n, double const U, double const R, double const Mn) const
|
||||
double physics::Vehicle::SeriesMotorCurrent(double const n, double const U, double const R, double const Mn) const
|
||||
{
|
||||
double MotorCurrent{0.0};
|
||||
double Rz;
|
||||
@@ -210,7 +210,7 @@ double TMoverParameters::SeriesMotorCurrent(double const n, double const U, doub
|
||||
|
||||
// the current of the series motors driving, at the revolutions n, the voltage U and the resistance Rz of Mn motors in
|
||||
// series, by the motor parameters of the shunt field SP
|
||||
double TMoverParameters::SeriesMotorDrivingCurrent(double const n, double const U, double const Rz, double const Mn, int const SP) const
|
||||
double physics::Vehicle::SeriesMotorDrivingCurrent(double const n, double const U, double const Rz, double const Mn, int const SP) const
|
||||
{
|
||||
double MotorCurrent;
|
||||
double Delta;
|
||||
@@ -240,7 +240,7 @@ double TMoverParameters::SeriesMotorDrivingCurrent(double const n, double const
|
||||
}
|
||||
|
||||
// the line breaker opened, and the motors damaged, by too high revolutions or current
|
||||
void TMoverParameters::MotorFailuresCheck(double const n)
|
||||
void physics::Vehicle::MotorFailuresCheck(double const n)
|
||||
{
|
||||
double MotorCurrent;
|
||||
// awarie
|
||||
@@ -260,7 +260,7 @@ void TMoverParameters::MotorFailuresCheck(double const n)
|
||||
}
|
||||
|
||||
// rozruch wysoki (true) albo niski (false)
|
||||
bool TMoverParameters::CurrentSwitch(bool const State)
|
||||
bool physics::Vehicle::CurrentSwitch(bool const State)
|
||||
{
|
||||
// TBD, TODO: split off shunt mode toggle into a separate command? It doesn't make much sense to have these two together like that
|
||||
// the diesels with a shunt mode have no motor overload relay threshold to switch, the switch sets their shunt mode alone.
|
||||
@@ -288,13 +288,13 @@ bool TMoverParameters::CurrentSwitch(bool const State)
|
||||
return false;
|
||||
};
|
||||
|
||||
bool TMoverParameters::IsMotorOverloadRelayHighThresholdOn() const
|
||||
bool physics::Vehicle::IsMotorOverloadRelayHighThresholdOn() const
|
||||
{
|
||||
|
||||
return ImaxHi > ImaxLo && Imax > ImaxLo;
|
||||
}
|
||||
|
||||
double TMoverParameters::ShowEngineRotation(int VehN) const
|
||||
double physics::Vehicle::ShowEngineRotation(int VehN) const
|
||||
{ // Zwraca wartość prędkości obrotowej silnika wybranego pojazdu. Do 3 pojazdów (3×SN61).
|
||||
int b;
|
||||
switch (VehN)
|
||||
@@ -317,7 +317,7 @@ double TMoverParameters::ShowEngineRotation(int VehN) const
|
||||
return 0.0;
|
||||
};
|
||||
|
||||
void TMoverParameters::MotorBlowersCheck(double const Timestep)
|
||||
void physics::Vehicle::MotorBlowersCheck(double const Timestep)
|
||||
{
|
||||
// activation check
|
||||
for (auto &blower : MotorBlowers)
|
||||
@@ -376,7 +376,7 @@ void TMoverParameters::MotorBlowersCheck(double const Timestep)
|
||||
}
|
||||
}
|
||||
|
||||
bool TMoverParameters::MotorBlowerPowerIsAvailable(cooling_fan const &Blower) const
|
||||
bool physics::Vehicle::MotorBlowerPowerIsAvailable(cooling_fan const &Blower) const
|
||||
{
|
||||
switch (Blower.start_type)
|
||||
{
|
||||
@@ -389,12 +389,12 @@ bool TMoverParameters::MotorBlowerPowerIsAvailable(cooling_fan const &Blower) co
|
||||
}
|
||||
}
|
||||
|
||||
double TMoverParameters::ShowCurrent(int AmpN) const
|
||||
double physics::Vehicle::ShowCurrent(int AmpN) const
|
||||
{ // Odczyt poboru prądu na podanym amperomierzu
|
||||
return Drive().ShowCurrent(*this, AmpN);
|
||||
};
|
||||
|
||||
bool TMoverParameters::MotorBlowersSwitch(bool State, VehicleEnd const Side, range_t const Notify)
|
||||
bool physics::Vehicle::MotorBlowersSwitch(bool State, VehicleEnd const Side, range_t const Notify)
|
||||
{
|
||||
|
||||
auto &fan{MotorBlowers[Side]};
|
||||
@@ -418,7 +418,7 @@ bool TMoverParameters::MotorBlowersSwitch(bool State, VehicleEnd const Side, ran
|
||||
return fan.is_enabled != initialstate;
|
||||
}
|
||||
|
||||
bool TMoverParameters::MotorBlowersSwitchOff(bool State, VehicleEnd const Side, range_t const Notify)
|
||||
bool physics::Vehicle::MotorBlowersSwitchOff(bool State, VehicleEnd const Side, range_t const Notify)
|
||||
{
|
||||
|
||||
auto &fan{MotorBlowers[Side]};
|
||||
@@ -443,7 +443,7 @@ bool TMoverParameters::MotorBlowersSwitchOff(bool State, VehicleEnd const Side,
|
||||
}
|
||||
|
||||
// the traction selector of a dual-mode vehicle: moves only with the line breaker open, and only where a genset is
|
||||
bool TMoverParameters::TractionModeSwitch(traction_mode const Mode, range_t const Notify)
|
||||
bool physics::Vehicle::TractionModeSwitch(traction_mode const Mode, range_t const Notify)
|
||||
{
|
||||
auto const initialstate{TractionMode};
|
||||
// refused with the line breaker closed, and then not passed on either, so the train stays on one source
|
||||
@@ -466,7 +466,7 @@ bool TMoverParameters::TractionModeSwitch(traction_mode const Mode, range_t cons
|
||||
// zwiększenie nastawy nastawnika hamulca elektrodynamicznego (DynamicBrakeCtrl)
|
||||
// uzywane gdy SplitEDPneumaticBrake = true
|
||||
// *************************************************************************************************
|
||||
bool TMoverParameters::IncDynamicBrakeLevel(float const CtrlSpeed)
|
||||
bool physics::Vehicle::IncDynamicBrakeLevel(float const CtrlSpeed)
|
||||
{
|
||||
if (false == SplitEDPneumaticBrake)
|
||||
return false;
|
||||
@@ -483,7 +483,7 @@ bool TMoverParameters::IncDynamicBrakeLevel(float const CtrlSpeed)
|
||||
// *************************************************************************************************
|
||||
// zmniejszenie nastawy nastawnika hamulca elektrodynamicznego (DynamicBrakeCtrl)
|
||||
// *************************************************************************************************
|
||||
bool TMoverParameters::DecDynamicBrakeLevel(float const CtrlSpeed)
|
||||
bool physics::Vehicle::DecDynamicBrakeLevel(float const CtrlSpeed)
|
||||
{
|
||||
if (false == SplitEDPneumaticBrake)
|
||||
return false;
|
||||
@@ -500,7 +500,7 @@ bool TMoverParameters::DecDynamicBrakeLevel(float const CtrlSpeed)
|
||||
// *************************************************************************************************
|
||||
// bezposrednie ustawienie nastawnika hamulca elektrodynamicznego (DynamicBrakeCtrl)
|
||||
// *************************************************************************************************
|
||||
bool TMoverParameters::DynamicBrakeLevelSet(double Position)
|
||||
bool physics::Vehicle::DynamicBrakeLevelSet(double Position)
|
||||
{
|
||||
if (false == SplitEDPneumaticBrake)
|
||||
return false;
|
||||
@@ -512,7 +512,7 @@ bool TMoverParameters::DynamicBrakeLevelSet(double Position)
|
||||
// odczyt nastawy nastawnika hamulca elektrodynamicznego (DynamicBrakeCtrl)
|
||||
// zwraca 0 jezeli SplitEDPneumaticBrake nie jest aktywne (dla zachowania starej logiki)
|
||||
// *************************************************************************************************
|
||||
double TMoverParameters::DynamicBrakeRatio(void) const
|
||||
double physics::Vehicle::DynamicBrakeRatio(void) const
|
||||
{
|
||||
if (false == SplitEDPneumaticBrake)
|
||||
return 0.0;
|
||||
@@ -522,7 +522,7 @@ double TMoverParameters::DynamicBrakeRatio(void) const
|
||||
// *************************************************************************************************
|
||||
// czy hamulec ED jest aktualnie dostepny w oknie predkosci Vh0..Vh1
|
||||
// *************************************************************************************************
|
||||
bool TMoverParameters::DynamicBrakeAvailable(void) const
|
||||
bool physics::Vehicle::DynamicBrakeAvailable(void) const
|
||||
{
|
||||
double const vh0{inductionMotor.braking.offSpeed};
|
||||
if (double const vh1{inductionMotor.braking.fullSpeed}; vh1 <= 0.001)
|
||||
@@ -538,7 +538,7 @@ bool TMoverParameters::DynamicBrakeAvailable(void) const
|
||||
// Q: 20160713
|
||||
// reczne przelaczanie hamulca elektrodynamicznego
|
||||
// *************************************************************************************************
|
||||
bool TMoverParameters::DynamicBrakeSwitch(bool Switch)
|
||||
bool physics::Vehicle::DynamicBrakeSwitch(bool Switch)
|
||||
{
|
||||
bool DBS;
|
||||
|
||||
@@ -566,7 +566,7 @@ bool TMoverParameters::DynamicBrakeSwitch(bool Switch)
|
||||
// Q: 20160714
|
||||
// oblicza sile trakcyjna lokomotywy (dla elektrowozu tez calkowity prad)
|
||||
// *************************************************************************************************
|
||||
double TMoverParameters::TractionForce(double dt)
|
||||
double physics::Vehicle::TractionForce(double dt)
|
||||
{
|
||||
Ft = 0;
|
||||
double dtrans{0.0};
|
||||
@@ -600,13 +600,13 @@ double TMoverParameters::TractionForce(double dt)
|
||||
}
|
||||
|
||||
// the starting resistors' blowers, and the diesels' radiator fans
|
||||
void TMoverParameters::UpdateVentilators(double dt)
|
||||
void physics::Vehicle::UpdateVentilators(double dt)
|
||||
{
|
||||
Drive().UpdateVentilators(*this, dt);
|
||||
}
|
||||
|
||||
// the starting resistors' blowers of the series motors with the line breaker closed, worked by hand or by the current
|
||||
void TMoverParameters::UpdateResistorBlowers(double dt)
|
||||
void physics::Vehicle::UpdateResistorBlowers(double dt)
|
||||
{
|
||||
switch (RVentType)
|
||||
{
|
||||
@@ -655,18 +655,18 @@ void TMoverParameters::UpdateResistorBlowers(double dt)
|
||||
}
|
||||
|
||||
// the power of a dumb or diesel engine; returns the ratio of the power a dumb engine is set to
|
||||
double TMoverParameters::UpdateEnginePower()
|
||||
double physics::Vehicle::UpdateEnginePower()
|
||||
{
|
||||
return Drive().UpdateEnginePower(*this);
|
||||
}
|
||||
|
||||
// the line breaker opened by a voltage out of the motors' range, and the line contactors of a diesel-electric
|
||||
void TMoverParameters::VoltageRelaysCheck()
|
||||
void physics::Vehicle::VoltageRelaysCheck()
|
||||
{
|
||||
Drive().CheckVoltageRelays(*this);
|
||||
}
|
||||
|
||||
void TMoverParameters::DumbTractionForce(double const PosRatio)
|
||||
void physics::Vehicle::DumbTractionForce(double const PosRatio)
|
||||
{
|
||||
if (Mains && CabActive != 0)
|
||||
{
|
||||
@@ -686,7 +686,7 @@ void TMoverParameters::DumbTractionForce(double const PosRatio)
|
||||
}
|
||||
}
|
||||
|
||||
void TMoverParameters::WheelsDrivenTractionForce(double dt)
|
||||
void physics::Vehicle::WheelsDrivenTractionForce(double dt)
|
||||
{
|
||||
if (EnginePowerSource.SourceType == TPowerSource::InternalSource && EnginePowerSource.PowerType == TPowerType::BioPower)
|
||||
Ft = Sign(sin(eAngle)) * PulseForce * Transmision.Ratio;
|
||||
@@ -700,7 +700,7 @@ void TMoverParameters::WheelsDrivenTractionForce(double dt)
|
||||
EnginePower = Ft * (1.0 + Vel);
|
||||
}
|
||||
|
||||
void TMoverParameters::SeriesMotorTractionForce(double dt)
|
||||
void physics::Vehicle::SeriesMotorTractionForce(double dt)
|
||||
{
|
||||
// enrot:=Transmision.Ratio*nrot;
|
||||
// yB: szereg dwoch sekcji w ET42
|
||||
@@ -712,7 +712,7 @@ void TMoverParameters::SeriesMotorTractionForce(double dt)
|
||||
{
|
||||
if (Imax == ImaxHi)
|
||||
EngineVoltage = EngineVoltage * 2;
|
||||
if (DynamicBrakeFlag && abs(Im) > 300) // przeiesione do mover.cpp
|
||||
if (DynamicBrakeFlag && abs(Im) > 300) // przeiesione do physics.cpp
|
||||
FuseOff();
|
||||
}
|
||||
if (DynamicBrakeType == dbrake_automatic && DynamicBrakeFlag)
|
||||
@@ -742,7 +742,7 @@ void TMoverParameters::SeriesMotorTractionForce(double dt)
|
||||
}
|
||||
|
||||
// the automatic dynamic brake of the series motors: the excitation current, by the stages of the ep brake (TUHEX)
|
||||
void TMoverParameters::SeriesMotorDynamicBrake(double dt)
|
||||
void physics::Vehicle::SeriesMotorDynamicBrake(double dt)
|
||||
{
|
||||
if (TUHEX_Stages > 0) // hamowanie wielostopniowe, nadpisuje wartości domyślne
|
||||
{
|
||||
@@ -794,7 +794,7 @@ void TMoverParameters::SeriesMotorDynamicBrake(double dt)
|
||||
|
||||
// the shunt field relays of a diesel-electric, each kind its own conditions on the current, the speed or the
|
||||
// power (tmp, the power the engine gives)
|
||||
void TMoverParameters::ShuntFieldRelaysCheck(double const tmpV, double const PosRatio, double const tmp)
|
||||
void physics::Vehicle::ShuntFieldRelaysCheck(double const tmpV, double const PosRatio, double const tmp)
|
||||
{
|
||||
auto const shuntfieldstate{ScndCtrlPos};
|
||||
|
||||
@@ -861,7 +861,7 @@ void TMoverParameters::ShuntFieldRelaysCheck(double const tmpV, double const Pos
|
||||
}
|
||||
|
||||
// the relays of type 2: up by the speed while the engine has power to spare (tmp, the power it gives), down by the current
|
||||
void TMoverParameters::ShuntFieldRelaysType2(double const tmp)
|
||||
void physics::Vehicle::ShuntFieldRelaysType2(double const tmp)
|
||||
{
|
||||
if (ScndCtrlPos < ScndCtrlPosNo && MPTRelay[ScndCtrlPos].Iup < Vel && EnginePower < tmp * 0.99)
|
||||
{
|
||||
@@ -874,7 +874,7 @@ void TMoverParameters::ShuntFieldRelaysType2(double const tmp)
|
||||
}
|
||||
|
||||
// the relays of type 41: up by the speed tmpV at full power, the engine slowed down, down by the current
|
||||
void TMoverParameters::ShuntFieldRelaysType41(double const tmpV)
|
||||
void physics::Vehicle::ShuntFieldRelaysType41(double const tmpV)
|
||||
{
|
||||
if (ScndCtrlPos < ScndCtrlPosNo && MainCtrlPos == MainCtrlPosNo && tmpV * 3.6 > MPTRelay[ScndCtrlPos].Iup)
|
||||
{
|
||||
@@ -888,7 +888,7 @@ void TMoverParameters::ShuntFieldRelaysType41(double const tmpV)
|
||||
}
|
||||
|
||||
// the relays of type 45, by the current and the speed: up from the 11th position, at most two under it, none under the 8th
|
||||
void TMoverParameters::ShuntFieldRelaysType45()
|
||||
void physics::Vehicle::ShuntFieldRelaysType45()
|
||||
{
|
||||
if (ScndCtrlPos < ScndCtrlPosNo && MainCtrlPos >= 11)
|
||||
{
|
||||
@@ -943,7 +943,7 @@ void TMoverParameters::ShuntFieldRelaysType45()
|
||||
|
||||
// the relays of type 46, by the current and the speed: up from the 12th position, down under it below 50 km/h, at most two
|
||||
// under the 11th, none under the 8th
|
||||
void TMoverParameters::ShuntFieldRelaysType46()
|
||||
void physics::Vehicle::ShuntFieldRelaysType46()
|
||||
{
|
||||
// wzrastanie
|
||||
if (MainCtrlPos >= 12 && ScndCtrlPos < ScndCtrlPosNo)
|
||||
@@ -966,7 +966,7 @@ void TMoverParameters::ShuntFieldRelaysType46()
|
||||
}
|
||||
|
||||
// a relay of type 46 down: an even one by the current, an odd one by the current and the speed
|
||||
void TMoverParameters::ShuntFieldRelaysType46Down()
|
||||
void physics::Vehicle::ShuntFieldRelaysType46Down()
|
||||
{
|
||||
// above 50 km/h already active shunt field can be maintained until lower controller setting
|
||||
if (ScndCtrlPos % 2 == 0)
|
||||
@@ -986,7 +986,7 @@ void TMoverParameters::ShuntFieldRelaysType46Down()
|
||||
}
|
||||
|
||||
// a relay of type 46 up: an even one by the current, an odd one by the current and the speed
|
||||
void TMoverParameters::ShuntFieldRelaysType46Up()
|
||||
void physics::Vehicle::ShuntFieldRelaysType46Up()
|
||||
{
|
||||
if (ScndCtrlPos % 2 == 0)
|
||||
{
|
||||
@@ -1004,7 +1004,7 @@ void TMoverParameters::ShuntFieldRelaysType46Up()
|
||||
}
|
||||
}
|
||||
|
||||
void TMoverParameters::InductionMotorTractionForce(double dt)
|
||||
void physics::Vehicle::InductionMotorTractionForce(double dt)
|
||||
{
|
||||
if (MainCircuitPowered() && !SecuritySystem.is_engine_blocked())
|
||||
{
|
||||
@@ -1053,7 +1053,7 @@ void TMoverParameters::InductionMotorTractionForce(double dt)
|
||||
}
|
||||
|
||||
// the speed control (tempomat) of an induction motor drive, set by its second controller
|
||||
void TMoverParameters::InductionMotorSpeedControl(double dt)
|
||||
void physics::Vehicle::InductionMotorSpeedControl(double dt)
|
||||
{
|
||||
// tempomat
|
||||
if (ScndCtrlPosNo == 4 && SpeedCtrlTypeTime)
|
||||
@@ -1067,7 +1067,7 @@ void TMoverParameters::InductionMotorSpeedControl(double dt)
|
||||
}
|
||||
|
||||
// the speed control set by the position of the second controller, after it's been held for its delay
|
||||
void TMoverParameters::SpeedControlByPosition(double dt)
|
||||
void physics::Vehicle::SpeedControlByPosition(double dt)
|
||||
{
|
||||
if (ScndCtrlPos != NewSpeed)
|
||||
{
|
||||
@@ -1093,7 +1093,7 @@ void TMoverParameters::SpeedControlByPosition(double dt)
|
||||
|
||||
// the speed control of a four position second controller, by time: the speed set down or up by 10 km/h a step, held,
|
||||
// or off and at the top
|
||||
void TMoverParameters::SpeedControlByTime(double dt)
|
||||
void physics::Vehicle::SpeedControlByTime(double dt)
|
||||
{
|
||||
SpeedCtrlUnit.IsActive = SpeedCtrlValue > 0;
|
||||
switch (ScndCtrlPos)
|
||||
@@ -1141,7 +1141,7 @@ void TMoverParameters::SpeedControlByTime(double dt)
|
||||
|
||||
// whether the induction motors brake, and the share of the electrodynamic and the pneumatic brake; sets the
|
||||
// force asked of the motors (PosRatio) and how fast the drive follows it (tmp)
|
||||
void TMoverParameters::InductionMotorBrakeBlending(double const ActiveInverters, double &PosRatio, double &tmp)
|
||||
void physics::Vehicle::InductionMotorBrakeBlending(double const ActiveInverters, double &PosRatio, double &tmp)
|
||||
{
|
||||
InductionMotorDynamicBrakeFlag();
|
||||
auto const edBCP{Hamulec->GetEDBCP() * inductionMotor.braking.cylinderPressureGain}; // stala napedu
|
||||
@@ -1171,7 +1171,7 @@ void TMoverParameters::InductionMotorBrakeBlending(double const ActiveInverters,
|
||||
|
||||
// the electrodynamic brake of the induction motors on: with the doors open or permitted, by the train brake, the local
|
||||
// brake or its own controller; off without them
|
||||
void TMoverParameters::InductionMotorDynamicBrakeFlag()
|
||||
void physics::Vehicle::InductionMotorDynamicBrakeFlag()
|
||||
{
|
||||
double const edBCP = Hamulec->GetEDBCP();
|
||||
auto const localbrakeactive{CabOccupied != 0 && LocHandle->GetCP() > 0.25};
|
||||
@@ -1193,7 +1193,7 @@ void TMoverParameters::InductionMotorDynamicBrakeFlag()
|
||||
|
||||
// the share of the electrodynamic brake (negative), and the distributor told how much of the air to let out; none
|
||||
// when the air brake cuts the electrodynamic one off, or an inverter is out
|
||||
double TMoverParameters::InductionMotorBrakeRatio(double const ActiveInverters, double const edBCP)
|
||||
double physics::Vehicle::InductionMotorBrakeRatio(double const ActiveInverters, double const edBCP)
|
||||
{
|
||||
double PosRatio;
|
||||
// ustalanie współczynnika blendingu do luzowania hamulca PN
|
||||
@@ -1238,7 +1238,7 @@ double TMoverParameters::InductionMotorBrakeRatio(double const ActiveInverters,
|
||||
}
|
||||
|
||||
// the model of the induction motors and their inverters: voltage, frequency, currents, moment and force
|
||||
void TMoverParameters::InductionMotorDrive(double dt)
|
||||
void physics::Vehicle::InductionMotorDrive(double dt)
|
||||
{
|
||||
double tmp;
|
||||
if (DynamicBrakeFlag)
|
||||
@@ -1315,7 +1315,7 @@ void TMoverParameters::InductionMotorDrive(double dt)
|
||||
|
||||
// the force the motors give at full and at the setting (inductionMotor.forceShare), braking within the power and the force of the
|
||||
// electrodynamic brake, driving within the power and the starting force
|
||||
void TMoverParameters::InductionMotorForceLimits()
|
||||
void physics::Vehicle::InductionMotorForceLimits()
|
||||
{
|
||||
if (inductionMotor.forceShare < 0)
|
||||
{
|
||||
@@ -1344,7 +1344,7 @@ void TMoverParameters::InductionMotorForceLimits()
|
||||
}
|
||||
|
||||
// the frequency of the inverters at the motors' slip frequency, from the list of the drive or of its brake
|
||||
void TMoverParameters::UpdateInverterFrequency()
|
||||
void physics::Vehicle::UpdateInverterFrequency()
|
||||
{
|
||||
auto const tmpV{std::abs(inductionMotor.state.supplyFrequency)};
|
||||
auto const useFFEDList = FFEDListSize > 0 && DynamicBrakeFlag;
|
||||
@@ -1367,7 +1367,7 @@ void TMoverParameters::UpdateInverterFrequency()
|
||||
}
|
||||
|
||||
// the induction motor drive without power, or blocked by the security system
|
||||
void TMoverParameters::InductionMotorOff()
|
||||
void physics::Vehicle::InductionMotorOff()
|
||||
{
|
||||
for (auto &inv : inductionMotor.inverters)
|
||||
{
|
||||
@@ -1393,7 +1393,7 @@ void TMoverParameters::InductionMotorOff()
|
||||
// Q: 20160713
|
||||
// Sprawdzenie bezpiecznika nadmiarowego
|
||||
// *************************************************************************************************
|
||||
bool TMoverParameters::FuseFlagCheck(void) const
|
||||
bool physics::Vehicle::FuseFlagCheck(void) const
|
||||
{
|
||||
bool FFC;
|
||||
|
||||
@@ -1412,7 +1412,7 @@ bool TMoverParameters::FuseFlagCheck(void) const
|
||||
// Q: 20160713
|
||||
// Załączenie bezpiecznika nadmiarowego
|
||||
// *************************************************************************************************
|
||||
bool TMoverParameters::FuseOn(range_t const Notify)
|
||||
bool physics::Vehicle::FuseOn(range_t const Notify)
|
||||
{
|
||||
auto const result{RelayReset(relay_t::maincircuitground | relay_t::tractionnmotoroverload, Notify)};
|
||||
|
||||
@@ -1423,7 +1423,7 @@ bool TMoverParameters::FuseOn(range_t const Notify)
|
||||
// Q: 20160713
|
||||
// Wyłączenie bezpiecznika nadmiarowego
|
||||
// *************************************************************************************************
|
||||
void TMoverParameters::FuseOff(void)
|
||||
void physics::Vehicle::FuseOff(void)
|
||||
{
|
||||
if (!FuseFlag)
|
||||
{
|
||||
@@ -1434,7 +1434,7 @@ void TMoverParameters::FuseOff(void)
|
||||
}
|
||||
|
||||
// resets relays assigned to specified customizable reset button
|
||||
bool TMoverParameters::UniversalResetButton(int const Button, range_t const Notify)
|
||||
bool physics::Vehicle::UniversalResetButton(int const Button, range_t const Notify)
|
||||
{
|
||||
|
||||
if (auto const lowvoltagepower{Power24vIsAvailable || Power110vIsAvailable}; false == lowvoltagepower)
|
||||
@@ -1454,7 +1454,7 @@ bool TMoverParameters::UniversalResetButton(int const Button, range_t const Noti
|
||||
}
|
||||
|
||||
// resets state of specified relays
|
||||
bool TMoverParameters::RelayReset(int const Relays, range_t const Notify)
|
||||
bool physics::Vehicle::RelayReset(int const Relays, range_t const Notify)
|
||||
{
|
||||
|
||||
auto const lowvoltagepower{Power24vIsAvailable || Power110vIsAvailable};
|
||||
@@ -1507,7 +1507,7 @@ bool TMoverParameters::RelayReset(int const Relays, range_t const Notify)
|
||||
// Q: 20160713
|
||||
// Przeliczenie prędkości liniowej na obrotową
|
||||
// *************************************************************************************************
|
||||
double TMoverParameters::v2n(void)
|
||||
double physics::Vehicle::v2n(void)
|
||||
{
|
||||
// przelicza predkosc liniowa na obrotowa
|
||||
const double dmgn = 0.5;
|
||||
@@ -1534,7 +1534,7 @@ double TMoverParameters::v2n(void)
|
||||
// Q: 20160714
|
||||
// Oblicza moment siły wytwarzany przez silnik
|
||||
// *************************************************************************************************
|
||||
double TMoverParameters::Momentum(double I) const
|
||||
double physics::Vehicle::Momentum(double I) const
|
||||
{
|
||||
// liczy moment sily wytwarzany przez silnik elektryczny}
|
||||
int SP;
|
||||
@@ -1551,7 +1551,7 @@ double TMoverParameters::Momentum(double I) const
|
||||
// Q: 20160714
|
||||
// Oblicza moment siły do sterowania wzbudzeniem
|
||||
// *************************************************************************************************
|
||||
double TMoverParameters::MomentumF(double I, double Iw, int SCP) const
|
||||
double physics::Vehicle::MomentumF(double I, double Iw, int SCP) const
|
||||
{
|
||||
// umozliwia dokladne sterowanie wzbudzeniem
|
||||
|
||||
@@ -1562,7 +1562,7 @@ double TMoverParameters::MomentumF(double I, double Iw, int SCP) const
|
||||
// Q: 20160713
|
||||
// Odłączenie uszkodzonych silników
|
||||
// *************************************************************************************************
|
||||
bool TMoverParameters::CutOffEngine(void)
|
||||
bool physics::Vehicle::CutOffEngine(void)
|
||||
{
|
||||
bool COE = false; // Ra: wartość domyślna, sprawdzić to trzeba
|
||||
if (NPoweredAxles > 0 && CabActive == 0 && EngineType == TEngineType::ElectricSeriesMotor && DamageFlag.Clear(VehicleDamage::engine))
|
||||
@@ -1577,7 +1577,7 @@ bool TMoverParameters::CutOffEngine(void)
|
||||
// Q: 20160713
|
||||
// Przełączenie wysoki / niski prąd rozruchu
|
||||
// *************************************************************************************************
|
||||
bool TMoverParameters::MaxCurrentSwitch(bool State, range_t const Notify)
|
||||
bool physics::Vehicle::MaxCurrentSwitch(bool State, range_t const Notify)
|
||||
{
|
||||
auto const initialstate{MotorOverloadRelayHighThreshold};
|
||||
|
||||
@@ -1595,7 +1595,7 @@ bool TMoverParameters::MaxCurrentSwitch(bool State, range_t const Notify)
|
||||
// Q: 20160713
|
||||
// Przełączenie wysoki / niski prąd rozruchu automatycznego
|
||||
// *************************************************************************************************
|
||||
bool TMoverParameters::MinCurrentSwitch(bool State)
|
||||
bool physics::Vehicle::MinCurrentSwitch(bool State)
|
||||
{
|
||||
bool MCS = false;
|
||||
if ((EngineType == TEngineType::ElectricSeriesMotor && IminHi > IminLo) || (TrainType == train_type::emu && EngineType != TEngineType::ElectricInductionMotor))
|
||||
@@ -1623,7 +1623,7 @@ bool TMoverParameters::MinCurrentSwitch(bool State)
|
||||
// Q: 20160713
|
||||
// Sprawdzenie wskaźnika jazdy na oporach
|
||||
// *************************************************************************************************
|
||||
bool TMoverParameters::ResistorsFlagCheck(void) const
|
||||
bool physics::Vehicle::ResistorsFlagCheck(void) const
|
||||
{
|
||||
bool RFC = false;
|
||||
|
||||
@@ -1642,7 +1642,7 @@ bool TMoverParameters::ResistorsFlagCheck(void) const
|
||||
// Q: 20160714
|
||||
// Zwraca wartość natężenia prądu na wybranym amperomierzu. Podfunkcja do ShowCurrent.
|
||||
// *************************************************************************************************
|
||||
double TMoverParameters::ShowCurrentP(int AmpN) const
|
||||
double physics::Vehicle::ShowCurrentP(int AmpN) const
|
||||
{
|
||||
int Bn;
|
||||
bool Grupowy;
|
||||
@@ -1677,7 +1677,7 @@ double TMoverParameters::ShowCurrentP(int AmpN) const
|
||||
}
|
||||
|
||||
// the drive of the kind of engine of the vehicle
|
||||
TractionDrive const &TMoverParameters::Drive() const
|
||||
TractionDrive const &physics::Vehicle::Drive() const
|
||||
{
|
||||
return DriveOf(EngineType);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user