mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-23 00:29:19 +02:00
Merge branch 'tmj-dev' into milek-dev
This commit is contained in:
@@ -96,6 +96,7 @@ static int const maxcc = 4; /*max. ilosc odbierakow pradu*/
|
||||
//static int const MainBrakeMaxPos = 10; /*max. ilosc nastaw hamulca zasadniczego*/
|
||||
static int const ManualBrakePosNo = 20; /*ilosc nastaw hamulca recznego*/
|
||||
static int const LightsSwitchPosNo = 16;
|
||||
static int const UniversalCtrlArraySize = 32; /*max liczba pozycji uniwersalnego nastawnika*/
|
||||
|
||||
/*uszkodzenia toru*/
|
||||
static int const dtrack_railwear = 2;
|
||||
@@ -572,6 +573,20 @@ struct TMotorParameters
|
||||
}
|
||||
};
|
||||
|
||||
struct TUniversalCtrl
|
||||
{
|
||||
int mode = 0; /*tryb pracy zadajnika - pomocnicze*/
|
||||
double MinCtrlVal = 0.0; /*minimalna wartosc nastawy*/
|
||||
double MaxCtrlVal = 0.0; /*maksymalna wartosc nastawy*/
|
||||
double SetCtrlVal = 0.0; /*docelowa wartosc nastawy*/
|
||||
double SpeedUp = 0.0; /*szybkosc zwiekszania nastawy*/
|
||||
double SpeedDown = 0.0; /*szybkosc zmniejszania nastawy*/
|
||||
int ReturnPosition = 0; /*pozycja na ktora odskakuje zadajnik*/
|
||||
int NextPosFastInc = 0; /*nastepna duza pozycja przy przechodzeniu szybkim*/
|
||||
int PrevPosFastDec = 0; /*poprzednia duza pozycja przy przechodzeniu szybkim*/
|
||||
};
|
||||
typedef TUniversalCtrl TUniversalCtrlTable[UniversalCtrlArraySize + 1]; /*tablica sterowania uniwersalnego nastawnika*/
|
||||
|
||||
struct TSecuritySystem
|
||||
{
|
||||
int SystemType { 0 }; /*0: brak, 1: czuwak aktywny, 2: SHP/sygnalizacja kabinowa*/
|
||||
@@ -941,6 +956,8 @@ public:
|
||||
bool MBrake = false; /*Czy jest hamulec reczny*/
|
||||
double StopBrakeDecc = 0.0;
|
||||
TSecuritySystem SecuritySystem;
|
||||
TUniversalCtrlTable UniCtrlList; /*lista pozycji uniwersalnego nastawnika*/
|
||||
int UniCtrlListSize = 0; /*wielkosc listy pozycji uniwersalnego nastawnika*/
|
||||
|
||||
/*-sekcja parametrow dla lokomotywy elektrycznej*/
|
||||
TSchemeTable RList; /*lista rezystorow rozruchowych i polaczen silnikow, dla dizla: napelnienia*/
|
||||
@@ -1209,6 +1226,7 @@ public:
|
||||
int LightsPos = 0;
|
||||
int ActiveDir = 0; //czy lok. jest wlaczona i w ktorym kierunku:
|
||||
//względem wybranej kabiny: -1 - do tylu, +1 - do przodu, 0 - wylaczona
|
||||
int MaxMainCtrlPosNoDirChange { 0 }; // can't change reverser state with master controller set above this position
|
||||
int CabNo = 0; //numer kabiny, z której jest sterowanie: 1 lub -1; w przeciwnym razie brak sterowania - rozrzad
|
||||
int DirAbsolute = 0; //zadany kierunek jazdy względem sprzęgów (1=w strone 0,-1=w stronę 1)
|
||||
int ActiveCab = 0; //numer kabiny, w ktorej jest obsada (zwykle jedna na skład)
|
||||
@@ -1357,6 +1375,7 @@ public:
|
||||
int DettachStatus(int ConnectNo);
|
||||
bool Dettach(int ConnectNo);
|
||||
bool DirectionForward();
|
||||
bool DirectionBackward( void );/*! kierunek ruchu*/
|
||||
void BrakeLevelSet(double b);
|
||||
bool BrakeLevelAdd(double b);
|
||||
bool IncBrakeLevel(); // wersja na użytek AI
|
||||
@@ -1393,6 +1412,9 @@ public:
|
||||
/*! glowny nastawnik:*/
|
||||
bool IncMainCtrl(int CtrlSpeed);
|
||||
bool DecMainCtrl(int CtrlSpeed);
|
||||
bool IsMainCtrlNoPowerPos() const; // whether the master controller is set to position which won't generate any extra power
|
||||
int MainCtrlNoPowerPos() const; // highest setting of master controller which won't cause engine to generate extra power
|
||||
int MainCtrlPowerPos() const; // current setting of master controller, relative to the highest setting not generating extra power
|
||||
/*! pomocniczy nastawnik:*/
|
||||
bool IncScndCtrl(int CtrlSpeed);
|
||||
bool DecScndCtrl(int CtrlSpeed);
|
||||
@@ -1456,7 +1478,6 @@ public:
|
||||
double ComputeRotatingWheel(double WForce, double dt, double n) const;
|
||||
|
||||
/*--funkcje dla lokomotyw*/
|
||||
bool DirectionBackward(void);/*! kierunek ruchu*/
|
||||
bool WaterPumpBreakerSwitch( bool State, range_t const Notify = range_t::consist ); // water pump breaker state toggle
|
||||
bool WaterPumpSwitch( bool State, range_t const Notify = range_t::consist ); // water pump state toggle
|
||||
bool WaterPumpSwitchOff( bool State, range_t const Notify = range_t::consist ); // water pump state toggle
|
||||
@@ -1560,6 +1581,7 @@ private:
|
||||
void LoadFIZ_MotorParamTable( std::string const &Input );
|
||||
void LoadFIZ_Circuit( std::string const &Input );
|
||||
void LoadFIZ_RList( std::string const &Input );
|
||||
void LoadFIZ_UCList(std::string const &Input);
|
||||
void LoadFIZ_DList( std::string const &Input );
|
||||
void LoadFIZ_FFList( std::string const &Input );
|
||||
void LoadFIZ_LightsList( std::string const &Input );
|
||||
@@ -1574,12 +1596,14 @@ private:
|
||||
bool readMPTDieselEngine( std::string const &line );
|
||||
bool readBPT(/*int const ln,*/ std::string const &line); //Q 20160721
|
||||
bool readRList( std::string const &Input );
|
||||
bool readUCList(std::string const &Input);
|
||||
bool readDList( std::string const &line );
|
||||
bool readFFList( std::string const &line );
|
||||
bool readWWList( std::string const &line );
|
||||
bool readLightsList( std::string const &Input );
|
||||
void BrakeValveDecode( std::string const &s ); //Q 20160719
|
||||
void BrakeSubsystemDecode(); //Q 20160719
|
||||
bool EIMDirectionChangeAllow( void );
|
||||
};
|
||||
|
||||
//double Distance(TLocation Loc1, TLocation Loc2, TDimension Dim1, TDimension Dim2);
|
||||
|
||||
@@ -502,7 +502,7 @@ bool TMoverParameters::Dettach(int ConnectNo)
|
||||
|
||||
bool TMoverParameters::DirectionForward()
|
||||
{
|
||||
if ((MainCtrlPosNo > 0) && (ActiveDir < 1) && (MainCtrlPos == 0))
|
||||
if ((MainCtrlPosNo > 0) && (ActiveDir < 1) && (MainCtrlPos <= MaxMainCtrlPosNoDirChange) && (EIMDirectionChangeAllow()))
|
||||
{
|
||||
++ActiveDir;
|
||||
DirAbsolute = ActiveDir * CabNo;
|
||||
@@ -512,7 +512,7 @@ bool TMoverParameters::DirectionForward()
|
||||
SendCtrlToNext("Direction", ActiveDir, CabNo);
|
||||
return true;
|
||||
}
|
||||
else if ((ActiveDir == 1) && (MainCtrlPos == 0) && (TrainType == dt_EZT) && (EngineType != TEngineType::ElectricInductionMotor))
|
||||
else if ((ActiveDir == 1) && (IsMainCtrlNoPowerPos()) && (TrainType == dt_EZT) && (EngineType != TEngineType::ElectricInductionMotor))
|
||||
return MinCurrentSwitch(true); //"wysoki rozruch" EN57
|
||||
return false;
|
||||
};
|
||||
@@ -641,7 +641,7 @@ TMoverParameters::CurrentSwitch(bool const State) {
|
||||
// for SM42/SP42
|
||||
if( ( EngineType == TEngineType::DieselElectric )
|
||||
&& ( true == ShuntModeAllow )
|
||||
&& ( MainCtrlPos == 0 ) ) {
|
||||
&& ( IsMainCtrlNoPowerPos() ) ) {
|
||||
ShuntMode = State;
|
||||
return true;
|
||||
}
|
||||
@@ -1732,17 +1732,17 @@ bool TMoverParameters::IncMainCtrl(int CtrlSpeed)
|
||||
|
||||
case TEngineType::DieselEngine:
|
||||
{
|
||||
if( CtrlSpeed > 1 ) {
|
||||
while( MainCtrlPos < MainCtrlPosNo ) {
|
||||
IncMainCtrl( 1 );
|
||||
if( CtrlSpeed > 1 ) {
|
||||
while( ( MainCtrlPos < MainCtrlPosNo )
|
||||
&& ( IncMainCtrl( 1 ) ) ) {
|
||||
;
|
||||
}
|
||||
}
|
||||
else {
|
||||
++MainCtrlPos;
|
||||
}
|
||||
else {
|
||||
++MainCtrlPos;
|
||||
if( MainCtrlPos > 0 ) { CompressorAllow = true; }
|
||||
else { CompressorAllow = false; }
|
||||
}
|
||||
OK = true;
|
||||
CompressorAllow = ( MainCtrlPowerPos() > 0 );
|
||||
OK = true;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1805,6 +1805,7 @@ bool TMoverParameters::DecMainCtrl(int CtrlSpeed)
|
||||
}
|
||||
else
|
||||
{
|
||||
// TBD, TODO: replace with mainctrlpowerpos() check?
|
||||
if (MainCtrlPos > 0)
|
||||
{
|
||||
if ((TrainType != dt_ET22) ||
|
||||
@@ -1903,6 +1904,25 @@ bool TMoverParameters::DecMainCtrl(int CtrlSpeed)
|
||||
return OK;
|
||||
}
|
||||
|
||||
bool TMoverParameters::IsMainCtrlNoPowerPos() const {
|
||||
// TODO: wrap controller pieces into a class for potential specializations, similar to brake subsystems
|
||||
return MainCtrlPos <= MainCtrlNoPowerPos();
|
||||
}
|
||||
|
||||
int TMoverParameters::MainCtrlNoPowerPos() const {
|
||||
|
||||
switch( EIMCtrlType ) {
|
||||
case 1: { return 3; }
|
||||
case 2: { return 3; }
|
||||
default: { return 0; }
|
||||
}
|
||||
}
|
||||
|
||||
int TMoverParameters::MainCtrlPowerPos() const {
|
||||
|
||||
return MainCtrlPos - MainCtrlNoPowerPos();
|
||||
}
|
||||
|
||||
// *************************************************************************************************
|
||||
// Q: 20160710
|
||||
// zwiększenie bocznika
|
||||
@@ -1911,14 +1931,13 @@ bool TMoverParameters::IncScndCtrl(int CtrlSpeed)
|
||||
{
|
||||
bool OK = false;
|
||||
|
||||
if ((MainCtrlPos == 0) && (CabNo != 0) && (TrainType == dt_ET42) && (ScndCtrlPos == 0) &&
|
||||
(DynamicBrakeFlag))
|
||||
if ((IsMainCtrlNoPowerPos()) && (CabNo != 0) && (TrainType == dt_ET42) && (ScndCtrlPos == 0) && (DynamicBrakeFlag))
|
||||
{
|
||||
OK = DynamicBrakeSwitch(false);
|
||||
}
|
||||
else if ((ScndCtrlPosNo > 0) && (CabNo != 0) &&
|
||||
!((TrainType == dt_ET42) &&
|
||||
((Imax == ImaxHi) || ((DynamicBrakeFlag) && (MainCtrlPos > 0)))))
|
||||
((Imax == ImaxHi) || ((DynamicBrakeFlag) && (MainCtrlPowerPos() > 0)))))
|
||||
{
|
||||
// if (RList[MainCtrlPos].R=0) and (MainCtrlPos>0) and (ScndCtrlPos<ScndCtrlPosNo) and
|
||||
// (not CoupledCtrl) then
|
||||
@@ -1973,7 +1992,7 @@ bool TMoverParameters::DecScndCtrl(int CtrlSpeed)
|
||||
{
|
||||
bool OK = false;
|
||||
|
||||
if ((MainCtrlPos == 0) && (CabNo != 0) && (TrainType == dt_ET42) && (ScndCtrlPos == 0) &&
|
||||
if ((IsMainCtrlNoPowerPos()) && (CabNo != 0) && (TrainType == dt_ET42) && (ScndCtrlPos == 0) &&
|
||||
!(DynamicBrakeFlag) && (CtrlSpeed == 1))
|
||||
{
|
||||
// Ra: AI wywołuje z CtrlSpeed=2 albo gdy ScndCtrlPos>0
|
||||
@@ -2336,7 +2355,7 @@ bool TMoverParameters::DirectionBackward(void)
|
||||
DB = true; //
|
||||
return DB; // exit; TODO: czy dobrze przetlumaczone?
|
||||
}
|
||||
if ((MainCtrlPosNo > 0) && (ActiveDir > -1) && (MainCtrlPos == 0))
|
||||
if ((MainCtrlPosNo > 0) && (ActiveDir > -1) && (MainCtrlPos <= MaxMainCtrlPosNoDirChange) && (EIMDirectionChangeAllow()))
|
||||
{
|
||||
if (EngineType == TEngineType::WheelsDriven)
|
||||
CabNo--;
|
||||
@@ -2354,6 +2373,13 @@ bool TMoverParameters::DirectionBackward(void)
|
||||
return DB;
|
||||
}
|
||||
|
||||
bool TMoverParameters::EIMDirectionChangeAllow(void)
|
||||
{
|
||||
bool OK = false;
|
||||
OK = (EngineType != TEngineType::ElectricInductionMotor || ((eimic <= 0) && (eimic_real <= 0) && (Vel < 0.1)));
|
||||
return OK;
|
||||
}
|
||||
|
||||
// *************************************************************************************************
|
||||
// Q: 20160710
|
||||
// załączenie przycisku przeciwpoślizgowego
|
||||
@@ -2956,7 +2982,7 @@ bool TMoverParameters::DynamicBrakeSwitch(bool Switch)
|
||||
{
|
||||
bool DBS;
|
||||
|
||||
if ((DynamicBrakeType == dbrake_switch) && (MainCtrlPos == 0))
|
||||
if ((DynamicBrakeType == dbrake_switch) && (IsMainCtrlNoPowerPos()))
|
||||
{
|
||||
DynamicBrakeFlag = Switch;
|
||||
DBS = true;
|
||||
@@ -3250,7 +3276,7 @@ void TMoverParameters::CompressorCheck(double dt)
|
||||
if( ( true == CompressorAllow )
|
||||
&& ( true == CompressorAllowLocal )
|
||||
&& ( true == Mains )
|
||||
&& ( MainCtrlPos > 0 ) ) {
|
||||
&& ( MainCtrlPowerPos() > 0 ) ) {
|
||||
if( Compressor < MaxCompressor ) {
|
||||
if( ( EngineType == TEngineType::DieselElectric )
|
||||
&& ( CompressorPower > 0 ) ) {
|
||||
@@ -3985,12 +4011,18 @@ void TMoverParameters::ComputeTotalForce(double dt) {
|
||||
&& ( std::abs(Fwheels) > TotalMassxg * Adhesive( RunningTrack.friction ) ) ) {
|
||||
SlippingWheels = true;
|
||||
}
|
||||
if( true == SlippingWheels ) {
|
||||
double temp_nrot = nrot;
|
||||
if (true == SlippingWheels) {
|
||||
|
||||
double temp_nrot = ComputeRotatingWheel(Fwheels -
|
||||
Sign(nrot * M_PI * WheelDiameter - V) *
|
||||
Adhesive(RunningTrack.friction) * TotalMassxg,
|
||||
dt, nrot);
|
||||
temp_nrot = ComputeRotatingWheel(Fwheels - Sign(nrot * M_PI * WheelDiameter - V) *
|
||||
Adhesive(RunningTrack.friction) * TotalMassxg, dt, nrot);
|
||||
if (Sign(nrot * M_PI * WheelDiameter - V)*Sign(temp_nrot * M_PI * WheelDiameter - V) < 0)
|
||||
{
|
||||
SlippingWheels = false;
|
||||
temp_nrot = V / M_PI / WheelDiameter;
|
||||
}
|
||||
}
|
||||
if (true == SlippingWheels) {
|
||||
Fwheels = Sign(temp_nrot * M_PI * WheelDiameter - V) * TotalMassxg * Adhesive(RunningTrack.friction);
|
||||
if (Fwheels*Sign(V)>0)
|
||||
{
|
||||
@@ -4009,12 +4041,6 @@ void TMoverParameters::ComputeTotalForce(double dt) {
|
||||
{
|
||||
WheelFlat = sqrt(square(WheelFlat) + abs(Fwheels) / NAxles*Vel*0.000002);
|
||||
}
|
||||
if (Sign(nrot * M_PI * WheelDiameter - V)*Sign(temp_nrot * M_PI * WheelDiameter - V) < 0)
|
||||
{
|
||||
SlippingWheels = false;
|
||||
temp_nrot = V / M_PI / WheelDiameter;
|
||||
}
|
||||
|
||||
|
||||
nrot = temp_nrot;
|
||||
}
|
||||
@@ -4499,7 +4525,7 @@ double TMoverParameters::TractionForce( double dt ) {
|
||||
}
|
||||
case TEngineType::DieselEngine: {
|
||||
EnginePower = ( 2 * dizel_Mstand + dmoment ) * enrot * ( 2.0 * M_PI / 1000.0 );
|
||||
if( MainCtrlPos > 1 ) {
|
||||
if( MainCtrlPowerPos() > 1 ) {
|
||||
// dodatkowe opory z powodu sprezarki}
|
||||
dmoment -= dizel_Mstand * ( 0.2 * enrot / dizel_nmax );
|
||||
}
|
||||
@@ -4696,7 +4722,7 @@ double TMoverParameters::TractionForce( double dt ) {
|
||||
auto const tmpV { nrot * Pirazy2 * 0.5 * WheelDiameter * DirAbsolute }; //*CabNo*ActiveDir;
|
||||
// jazda manewrowa
|
||||
if( true == ShuntMode ) {
|
||||
if( ( true == Mains ) && ( MainCtrlPos > 0 ) ) {
|
||||
if( ( true == Mains ) && ( MainCtrlPowerPos() > 0 ) ) {
|
||||
Voltage = ( SST[ MainCtrlPos ].Umax * AnPos ) + ( SST[ MainCtrlPos ].Umin * ( 1.0 - AnPos ) );
|
||||
// NOTE: very crude way to approximate power generated at current rpm instead of instant top output
|
||||
// NOTE, TODO: doesn't take into account potentially increased revolutions if heating is on, fix it
|
||||
@@ -4727,7 +4753,7 @@ double TMoverParameters::TractionForce( double dt ) {
|
||||
PosRatio = currentgenpower / DElist[MainCtrlPosNo].GenPower;
|
||||
// stosunek mocy teraz do mocy max
|
||||
// NOTE: Mains in this context is working diesel engine
|
||||
if( ( true == Mains ) && ( MainCtrlPos > 0 ) ) {
|
||||
if( ( true == Mains ) && ( MainCtrlPowerPos() > 0 ) ) {
|
||||
|
||||
if( tmpV < ( Vhyp * power / DElist[ MainCtrlPosNo ].GenPower ) ) {
|
||||
// czy na czesci prostej, czy na hiperboli
|
||||
@@ -4829,7 +4855,7 @@ double TMoverParameters::TractionForce( double dt ) {
|
||||
Voltage = 0;
|
||||
|
||||
// przekazniki bocznikowania, kazdy inny dla kazdej pozycji
|
||||
if ((MainCtrlPos == 0) || (ShuntMode) || (false==Mains))
|
||||
if ((IsMainCtrlNoPowerPos()) || (ShuntMode) || (false==Mains))
|
||||
ScndCtrlPos = 0;
|
||||
|
||||
else {
|
||||
@@ -5312,7 +5338,7 @@ bool TMoverParameters::FuseFlagCheck(void) const
|
||||
bool TMoverParameters::FuseOn(void)
|
||||
{
|
||||
bool FO = false;
|
||||
if ((MainCtrlPos == 0) && (ScndCtrlPos == 0) && (TrainType != dt_ET40) &&
|
||||
if ((IsMainCtrlNoPowerPos()) && (ScndCtrlPos == 0) && (TrainType != dt_ET40) &&
|
||||
((Mains) || (TrainType != dt_EZT)) && (!TestFlag(EngDmgFlag, 1)))
|
||||
{ // w ET40 jest blokada nastawnika, ale czy działa dobrze?
|
||||
SendCtrlToNext("FuseSwitch", 1, CabNo);
|
||||
@@ -5352,9 +5378,9 @@ double TMoverParameters::v2n(void)
|
||||
|
||||
n = V / (M_PI * WheelDiameter); // predkosc obrotowa wynikajaca z liniowej [obr/s]
|
||||
deltan = n - nrot; //"pochodna" prędkości obrotowej
|
||||
if (SlippingWheels)
|
||||
/* if (SlippingWheels)
|
||||
if (std::abs(deltan) < 0.001)
|
||||
SlippingWheels = false; // wygaszenie poslizgu
|
||||
SlippingWheels = false; // wygaszenie poslizgu */ //poslizg jest w innym miejscu wygaszany też
|
||||
if (SlippingWheels) // nie ma zwiazku z predkoscia liniowa V
|
||||
{ // McZapkie-221103: uszkodzenia kol podczas poslizgu
|
||||
if (deltan > dmgn)
|
||||
@@ -5800,7 +5826,7 @@ bool TMoverParameters::MotorConnectorsCheck() {
|
||||
( false == Mains )
|
||||
|| ( true == FuseFlag )
|
||||
|| ( true == StLinSwitchOff )
|
||||
|| ( MainCtrlPos == 0 )
|
||||
|| ( IsMainCtrlNoPowerPos() )
|
||||
|| ( ActiveDir == 0 ) };
|
||||
|
||||
if( connectorsoff ) { return false; }
|
||||
@@ -5808,8 +5834,9 @@ bool TMoverParameters::MotorConnectorsCheck() {
|
||||
auto const connectorson {
|
||||
( true == StLinFlag )
|
||||
|| ( ( MainCtrlActualPos == 0 )
|
||||
&& ( ( MainCtrlPos == 1 )
|
||||
|| ( ( TrainType == dt_EZT ) && ( MainCtrlPos > 0 ) ) ) ) };
|
||||
&& ( ( TrainType != dt_EZT ?
|
||||
MainCtrlPowerPos() == 1 :
|
||||
MainCtrlPowerPos() > 0 ) ) ) };
|
||||
|
||||
return connectorson;
|
||||
}
|
||||
@@ -5977,6 +6004,10 @@ void TMoverParameters::CheckEIMIC(double dt)
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
eimic -= clamp(-UniCtrlList[MainCtrlPos].SetCtrlVal + eimic, 0.0, dt * UniCtrlList[MainCtrlPos].SpeedDown); //odejmuj do X
|
||||
eimic += clamp(UniCtrlList[MainCtrlPos].SetCtrlVal - eimic, 0.0, dt * UniCtrlList[MainCtrlPos].SpeedUp); //dodawaj do X
|
||||
eimic = clamp(eimic, UniCtrlList[MainCtrlPos].MinCtrlVal, UniCtrlList[MainCtrlPos].MaxCtrlVal);
|
||||
}
|
||||
eimic = clamp(eimic, -1.0, 1.0);
|
||||
}
|
||||
@@ -6057,7 +6088,7 @@ bool TMoverParameters::dizel_AutoGearCheck(void)
|
||||
{
|
||||
if (dizel_engagestate > 0)
|
||||
dizel_EngageSwitch(0);
|
||||
if ((MainCtrlPos == 0) && (ScndCtrlActualPos > 0))
|
||||
if ((IsMainCtrlNoPowerPos()) && (ScndCtrlActualPos > 0))
|
||||
dizel_automaticgearstatus = -1;
|
||||
}
|
||||
else
|
||||
@@ -6145,12 +6176,13 @@ bool TMoverParameters::dizel_StartupCheck() {
|
||||
|
||||
// test the fuel pump
|
||||
// TODO: add fuel pressure check
|
||||
if( false == FuelPump.is_active ) {
|
||||
if( ( false == FuelPump.is_active )
|
||||
|| ( ( EngineType == TEngineType::DieselEngine ) && ( RList[ MainCtrlPos ].R == 0.0 ) ) ) {
|
||||
engineisready = false;
|
||||
if( FuelPump.start_type == start_t::manual ) {
|
||||
// if( FuelPump.start_type == start_t::manual ) {
|
||||
// with manual pump control startup procedure is done only once per starter switch press
|
||||
dizel_startup = false;
|
||||
}
|
||||
// }
|
||||
}
|
||||
// test the oil pump
|
||||
if( ( false == OilPump.is_active )
|
||||
@@ -6340,10 +6372,10 @@ double TMoverParameters::dizel_Momentum(double dizel_fill, double n, double dt)
|
||||
if (hydro_TC) //jesli przetwornik momentu
|
||||
{
|
||||
//napelnianie przetwornika
|
||||
if ((MainCtrlPos > 0) && (Mains) && (enrot>dizel_nmin*0.9))
|
||||
if ((MainCtrlPowerPos() > 0) && (Mains) && (enrot>dizel_nmin*0.9))
|
||||
hydro_TC_Fill += hydro_TC_FillRateInc * dt;
|
||||
//oproznianie przetwornika
|
||||
if (((MainCtrlPos == 0) && (Vel<3))
|
||||
if (((IsMainCtrlNoPowerPos()) && (Vel<3))
|
||||
|| (!Mains)
|
||||
|| (enrot<dizel_nmin*0.8))
|
||||
hydro_TC_Fill -= hydro_TC_FillRateDec * dt;
|
||||
@@ -6351,10 +6383,10 @@ double TMoverParameters::dizel_Momentum(double dizel_fill, double n, double dt)
|
||||
hydro_TC_Fill = clamp(hydro_TC_Fill, 0.0, 1.0);
|
||||
|
||||
//blokowanie sprzegla blokującego
|
||||
if ((Vel > hydro_TC_LockupSpeed) && (Mains) && (enrot > 0.9 * dizel_nmin) && (MainCtrlPos>0))
|
||||
if ((Vel > hydro_TC_LockupSpeed) && (Mains) && (enrot > 0.9 * dizel_nmin) && (MainCtrlPowerPos() > 0))
|
||||
hydro_TC_LockupRate += hydro_TC_FillRateInc*dt;
|
||||
//luzowanie sprzegla blokujacego
|
||||
if ((Vel < (MainCtrlPos>0 ? hydro_TC_LockupSpeed : hydro_TC_UnlockSpeed)) || (!Mains) || (enrot < 0.8 * dizel_nmin))
|
||||
if ((Vel < (MainCtrlPowerPos() > 0 ? hydro_TC_LockupSpeed : hydro_TC_UnlockSpeed)) || (!Mains) || (enrot < 0.8 * dizel_nmin))
|
||||
hydro_TC_LockupRate -= hydro_TC_FillRateDec*dt;
|
||||
//obcinanie zakresu
|
||||
hydro_TC_LockupRate = clamp(hydro_TC_LockupRate, 0.0, 1.0);
|
||||
@@ -7224,7 +7256,7 @@ bool TMoverParameters::switch_physics(bool const State) // DO PRZETLUMACZENIA NA
|
||||
// *************************************************************************************************
|
||||
bool startBPT;
|
||||
bool startMPT, startMPT0;
|
||||
bool startRLIST;
|
||||
bool startRLIST, startUCLIST;
|
||||
bool startDLIST, startFFLIST, startWWLIST;
|
||||
bool startLIGHTSLIST;
|
||||
int LISTLINE;
|
||||
@@ -7419,6 +7451,31 @@ bool TMoverParameters::readRList( std::string const &Input ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TMoverParameters::readUCList(std::string const &line) {
|
||||
|
||||
cParser parser(line);
|
||||
parser.getTokens(10, false);
|
||||
auto idx = LISTLINE++;
|
||||
if (idx >= sizeof(UniCtrlList) / sizeof(TUniversalCtrl)) {
|
||||
WriteLog("Read UCList: number of entries exceeded capacity of the data table");
|
||||
return false;
|
||||
}
|
||||
int i = 0;
|
||||
parser
|
||||
>> i
|
||||
>> UniCtrlList[idx].mode
|
||||
>> UniCtrlList[idx].MinCtrlVal
|
||||
>> UniCtrlList[idx].MaxCtrlVal
|
||||
>> UniCtrlList[idx].SetCtrlVal
|
||||
>> UniCtrlList[idx].SpeedUp
|
||||
>> UniCtrlList[idx].SpeedDown
|
||||
>> UniCtrlList[idx].ReturnPosition
|
||||
>> UniCtrlList[idx].NextPosFastInc
|
||||
>> UniCtrlList[idx].PrevPosFastDec;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TMoverParameters::readDList( std::string const &line ) {
|
||||
|
||||
cParser parser( line );
|
||||
@@ -7608,6 +7665,7 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
|
||||
startMPT = false;
|
||||
startMPT0 = false;
|
||||
startRLIST = false;
|
||||
startUCLIST = false;
|
||||
startDLIST = false;
|
||||
startFFLIST = false;
|
||||
startWWLIST = false;
|
||||
@@ -7664,6 +7722,11 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
|
||||
startRLIST = false;
|
||||
continue;
|
||||
}
|
||||
if (issection("END-RL", inputline)) {
|
||||
startBPT = false;
|
||||
startUCLIST = false;
|
||||
continue;
|
||||
}
|
||||
if( issection( "END-DL", inputline ) ) {
|
||||
startBPT = false;
|
||||
startDLIST = false;
|
||||
@@ -7867,6 +7930,15 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
|
||||
continue;
|
||||
}
|
||||
|
||||
if (issection("UCList:", inputline))
|
||||
{
|
||||
startBPT = false;
|
||||
fizlines.emplace("UCList", inputline);
|
||||
startUCLIST = true; LISTLINE = 0;
|
||||
LoadFIZ_RList(inputline);
|
||||
continue;
|
||||
}
|
||||
|
||||
if( issection( "DList:", inputline ) )
|
||||
{
|
||||
startBPT = false;
|
||||
@@ -7916,6 +7988,10 @@ bool TMoverParameters::LoadFIZ(std::string chkpath)
|
||||
readRList( inputline );
|
||||
continue;
|
||||
}
|
||||
if (true == startUCLIST) {
|
||||
readRList(inputline);
|
||||
continue;
|
||||
}
|
||||
if( true == startDLIST ) {
|
||||
readDList( inputline );
|
||||
continue;
|
||||
@@ -8514,6 +8590,7 @@ void TMoverParameters::LoadFIZ_Cntrl( std::string const &line ) {
|
||||
extract_value( MainCtrlPosNo, "MCPN", line, "" );
|
||||
extract_value( ScndCtrlPosNo, "SCPN", line, "" );
|
||||
extract_value( ScndInMain, "SCIM", line, "" );
|
||||
extract_value( MaxMainCtrlPosNoDirChange, "DirChangeMaxPos", line, "" );
|
||||
|
||||
std::string autorelay;
|
||||
extract_value( autorelay, "AutoRelay", line, "" );
|
||||
@@ -8523,7 +8600,7 @@ void TMoverParameters::LoadFIZ_Cntrl( std::string const &line ) {
|
||||
|
||||
extract_value( CoupledCtrl, "CoupledCtrl", line, "" );
|
||||
extract_value( EIMCtrlType, "EIMCtrlType", line, "" );
|
||||
clamp( EIMCtrlType, 0, 2 );
|
||||
clamp( EIMCtrlType, 0, 3 );
|
||||
|
||||
extract_value( ScndS, "ScndS", line, "" ); // brak pozycji rownoleglej przy niskiej nastawie PSR
|
||||
|
||||
@@ -8952,6 +9029,12 @@ void TMoverParameters::LoadFIZ_RList( std::string const &Input ) {
|
||||
extract_value( DynamicBrakeRes2, "DynBrakeRes2", Input, "");
|
||||
}
|
||||
|
||||
void TMoverParameters::LoadFIZ_UCList(std::string const &Input) {
|
||||
|
||||
extract_value(UniCtrlListSize, "Size", Input, "");
|
||||
|
||||
}
|
||||
|
||||
void TMoverParameters::LoadFIZ_DList( std::string const &Input ) {
|
||||
|
||||
extract_value( dizel_Mmax, "Mmax", Input, "" );
|
||||
|
||||
@@ -346,7 +346,7 @@ double TBrake::GetVRP()
|
||||
// cisnienie zbiornika sterujacego
|
||||
double TBrake::GetCRP()
|
||||
{
|
||||
return 0;
|
||||
return GetBRP();
|
||||
}
|
||||
|
||||
// przeplyw z przewodu glowneg
|
||||
@@ -2788,7 +2788,7 @@ double TMHZ_K5P::GetPos(int i)
|
||||
|
||||
double TMHZ_K5P::GetCP()
|
||||
{
|
||||
return RP;
|
||||
return CP;
|
||||
}
|
||||
|
||||
void TMHZ_K5P::SetParams(bool AO, bool MO, double, double)
|
||||
@@ -2890,6 +2890,8 @@ double TMHZ_6P::GetPF(double i_bcp, double PP, double HP, double dt, double ep)
|
||||
void TMHZ_6P::Init(double Press)
|
||||
{
|
||||
CP = Press;
|
||||
Time = true;
|
||||
TimeEP = true;
|
||||
}
|
||||
|
||||
void TMHZ_6P::SetReductor(double nAdj)
|
||||
@@ -2912,7 +2914,7 @@ double TMHZ_6P::GetPos(int i)
|
||||
|
||||
double TMHZ_6P::GetCP()
|
||||
{
|
||||
return RP;
|
||||
return CP;
|
||||
}
|
||||
|
||||
void TMHZ_6P::SetParams(bool AO, bool MO, double OverP, double)
|
||||
|
||||
Reference in New Issue
Block a user