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

tmj merge

This commit is contained in:
milek7
2017-10-30 16:30:04 +01:00
73 changed files with 9521 additions and 7735 deletions

View File

@@ -706,6 +706,7 @@ public:
headlight_upper = 0x04,
headlight_right = 0x10,
redmarker_right = 0x20,
rearendsignals = 0x40
};
int ScndInMain{ 0 }; /*zaleznosc bocznika od nastawnika*/
bool MBrake = false; /*Czy jest hamulec reczny*/
@@ -778,6 +779,7 @@ public:
double Ftmax = 0.0;
/*- dla lokomotyw z silnikami indukcyjnymi -*/
double eimc[26];
bool EIMCLogForce; //
static std::vector<std::string> const eimc_labels;
/*-dla wagonow*/
double MaxLoad = 0.0; /*masa w T lub ilosc w sztukach - ladownosc*/
@@ -820,6 +822,7 @@ public:
double AccN = 0.0; //przyspieszenie normalne w [m/s^2]
double AccV = 0.0;
double nrot = 0.0;
double WheelFlat = 0.0;
/*! rotacja kol [obr/s]*/
double EnginePower = 0.0; /*! chwilowa moc silnikow*/
double dL = 0.0; double Fb = 0.0; double Ff = 0.0; /*przesuniecie, sila hamowania i tarcia*/

View File

@@ -3455,7 +3455,7 @@ void TMoverParameters::UpdatePipePressure(double dt)
temp = 0.0; // odetnij
else
temp = 1.0; // połącz
Pipe->Flow(temp * Hamulec->GetPF(temp * PipePress, dt, Vel) + GetDVc(dt));
Pipe->Flow( temp * Hamulec->GetPF( temp * PipePress, dt, Vel ) + GetDVc( dt ) );
if (ASBType == 128)
Hamulec->ASB(int(SlippingWheels));
@@ -3751,14 +3751,23 @@ void TMoverParameters::ComputeTotalForce(double dt, double dt1, bool FullVer)
Sign(nrot * M_PI * WheelDiameter - V) *
Adhesive(RunningTrack.friction) * TotalMassxg,
dt, nrot);
Fwheels = Sign(nrot * M_PI * WheelDiameter - V) * TotalMassxg * Adhesive(RunningTrack.friction);
Fwheels = Sign(temp_nrot * M_PI * WheelDiameter - V) * TotalMassxg * Adhesive(RunningTrack.friction);
if (Fwheels*Sign(V)>0)
{
FTrain = Fwheels - Fb;
FTrain = Fwheels + Fb*Sign(V);
}
else if (FTrain*Sign(V)>0)
{
Fb = FTrain*Sign(V) - Fwheels*Sign(V);
}
else
{
Fb = FTrain - Fwheels;
Fb = -Fwheels*Sign(V);
FTrain = 0;
}
if (nrot < 0.1)
{
WheelFlat = sqrt(sqr(WheelFlat) + abs(Fwheels) / NAxles*Vel*0.000002);
}
if (Sign(nrot * M_PI * WheelDiameter - V)*Sign(temp_nrot * M_PI * WheelDiameter - V) < 0)
{
@@ -4648,7 +4657,7 @@ double TMoverParameters::TractionForce(double dt)
{
PosRatio = -Sign(V) * DirAbsolute * eimv[eimv_Fr] /
(eimc[eimc_p_Fh] *
Max0R(dtrans / MaxBrakePress[0], AnPos) /*dizel_fill*/);
Max0R(Max0R(dtrans,0.01) / MaxBrakePress[0], AnPos) /*dizel_fill*/);
}
else
PosRatio = 0;
@@ -4699,11 +4708,11 @@ double TMoverParameters::TractionForce(double dt)
if( ( SlippingWheels ) ) {
PosRatio = 0;
tmp = 9;
Sandbox( true, range::local );
Sandbox( true, range::unit );
} // przeciwposlizg
else {
// switch sandbox off
Sandbox( false, range::local );
Sandbox( false, range::unit );
}
dizel_fill += Max0R(Min0R(PosRatio - dizel_fill, 0.1), -0.1) * 2 *
@@ -4740,6 +4749,13 @@ double TMoverParameters::TractionForce(double dt)
-Sign(V) * (DirAbsolute)*std::min(
eimc[eimc_p_Ph] * 3.6 / (Vel != 0.0 ? Vel : 0.001),
std::min(-eimc[eimc_p_Fh] * dizel_fill, eimv[eimv_FMAXMAX]));
double pr = dizel_fill;
if (EIMCLogForce)
pr = -log(1 - 4 * pr) / log(5);
eimv[eimv_Fr] =
-Sign(V) * (DirAbsolute)*std::min(
eimc[eimc_p_Ph] * 3.6 / (Vel != 0.0 ? Vel : 0.001),
std::min(-eimc[eimc_p_Fh] * pr, eimv[eimv_FMAXMAX]));
//*Min0R(1,(Vel-eimc[eimc_p_Vh0])/(eimc[eimc_p_Vh1]-eimc[eimc_p_Vh0]))
}
else
@@ -4751,9 +4767,13 @@ double TMoverParameters::TractionForce(double dt)
eimv[eimv_Fmax] = eimv[eimv_Fful] * dizel_fill;
// else
// eimv[eimv_Fmax]:=Min0R(eimc[eimc_p_F0]*dizel_fill,eimv[eimv_Fful]);
double pr = dizel_fill;
if (EIMCLogForce)
pr = log(1 + 4 * pr) / log(5);
eimv[eimv_Fr] = eimv[eimv_Fful] * pr;
}
eimv[eimv_ks] = eimv[eimv_Fmax] / eimv[eimv_FMAXMAX];
eimv[eimv_ks] = eimv[eimv_Fr] / eimv[eimv_FMAXMAX];
eimv[eimv_df] = eimv[eimv_ks] * eimc[eimc_s_dfmax];
eimv[eimv_fp] = DirAbsolute * enrot * eimc[eimc_s_p] +
eimv[eimv_df]; // do przemyslenia dzialanie pp z tmpV
@@ -4924,7 +4944,7 @@ 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 (std::abs(deltan) < 0.01)
if (std::abs(deltan) < 0.001)
SlippingWheels = false; // wygaszenie poslizgu
if (SlippingWheels) // nie ma zwiazku z predkoscia liniowa V
{ // McZapkie-221103: uszkodzenia kol podczas poslizgu
@@ -6923,7 +6943,7 @@ void TMoverParameters::LoadFIZ_Brake( std::string const &line ) {
}
if( true == extract_value( AirLeakRate, "AirLeakRate", line, "" ) ) {
// the parameter is provided in form of a multiplier, where 1.0 means the default rate of 0.001
// the parameter is provided in form of a multiplier, where 1.0 means the default rate of 0.01
AirLeakRate *= 0.01;
}
}
@@ -7149,6 +7169,7 @@ void TMoverParameters::LoadFIZ_Cntrl( std::string const &line ) {
if( asb == "Manual" ) { ASBType = 1; }
else if( asb == "Automatic" ) { ASBType = 2; }
else if (asb == "Yes") { ASBType = 128; }
}
else {
@@ -7397,6 +7418,7 @@ void TMoverParameters::LoadFIZ_Engine( std::string const &Input ) {
extract_value( eimc[ eimc_p_Imax ], "Imax", Input, "" );
extract_value( eimc[ eimc_p_abed ], "abed", Input, "" );
extract_value( eimc[ eimc_p_eped ], "edep", Input, "" );
EIMCLogForce = ( extract_value( "eimclf", Input ) == "Yes" );
Flat = ( extract_value( "Flat", Input ) == "1" );
@@ -7826,10 +7848,13 @@ bool TMoverParameters::CheckLocomotiveParameters(bool ReadyFlag, int Dir)
BrakeCtrlPos = static_cast<int>( Handle->GetPos( bh_NP ) );
else
BrakeCtrlPos = static_cast<int>( Handle->GetPos( bh_RP ) );
/*
// NOTE: disabled and left up to the driver, if there's any
MainSwitch( false );
PantFront( true );
PantRear( true );
MainSwitch( true );
*/
ActiveDir = 0; // Dir; //nastawnik kierunkowy - musi być ustawiane osobno!
DirAbsolute = ActiveDir * CabNo; // kierunek jazdy względem sprzęgów
LimPipePress = CntrlPipePress;

View File

@@ -435,8 +435,6 @@ void TNESt3::ForceEmptiness()
Miedzypoj->CreatePress(0);
CntrlRes->CreatePress(0);
BrakeStatus = 0;
ValveRes->Act();
BrakeRes->Act();
Miedzypoj->Act();

View File

@@ -413,6 +413,7 @@ void TBrake::ForceEmptiness()
{
ValveRes->CreatePress(0);
BrakeRes->CreatePress(0);
ValveRes->Act();
BrakeRes->Act();
}
@@ -757,6 +758,17 @@ double TESt::GetCRP()
return CntrlRes->P();
}
void TESt::ForceEmptiness() {
ValveRes->CreatePress( 0 );
BrakeRes->CreatePress( 0 );
CntrlRes->CreatePress( 0 );
ValveRes->Act();
BrakeRes->Act();
CntrlRes->Act();
}
//---EP2---
void TEStEP2::Init( double const PP, double const HPP, double const LPP, double const BP, int const BDF )
@@ -1462,9 +1474,15 @@ double TEStED::GetPF( double const PP, double const dt, double const Vel )
// powtarzacz — podwojny zawor zwrotny
temp = Max0R(LoadC * BCP / temp * Min0R(Max0R(1 - EDFlag, 0), 1), LBP);
double speed = 1;
if ((ASBP < 0.1) && ((BrakeStatus & b_asb) == b_asb))
{
temp = 0;
speed = 3;
}
if ((BrakeCyl->P() > temp))
dv = -PFVd(BrakeCyl->P(), 0, 0.02 * SizeBC, temp) * dt;
dv = -PFVd(BrakeCyl->P(), 0, 0.02 * SizeBC * speed, temp) * dt;
else if ((BrakeCyl->P() < temp))
dv = PFVa(BVP, BrakeCyl->P(), 0.02 * SizeBC, temp) * dt;
else
@@ -1721,6 +1739,17 @@ double TCV1::GetCRP()
return CntrlRes->P();
}
void TCV1::ForceEmptiness() {
ValveRes->CreatePress( 0 );
BrakeRes->CreatePress( 0 );
CntrlRes->CreatePress( 0 );
ValveRes->Act();
BrakeRes->Act();
CntrlRes->Act();
}
//---CV1-L-TR---
void TCV1L_TR::SetLBP( double const P )
@@ -1995,7 +2024,8 @@ double TKE::GetPF( double const PP, double const dt, double const Vel )
// luzowanie CH
// temp:=Max0R(BCP,LBP);
IMP = Max0R(IMP / temp, Max0R(LBP, ASBP * int((BrakeStatus & b_asb) == b_asb)));
if ((ASBP < 0.1) && ((BrakeStatus & b_asb) == b_asb))
IMP = 0;
// luzowanie CH
if ((BCP > IMP + 0.005) || (Max0R(ImplsRes->P(), 8 * LBP) < 0.25))
dv = PFVd(BCP, 0, 0.05, IMP) * dt;
@@ -2090,6 +2120,21 @@ void TKE::SetLBP( double const P )
LBP = P;
}
void TKE::ForceEmptiness() {
ValveRes->CreatePress( 0 );
BrakeRes->CreatePress( 0 );
CntrlRes->CreatePress( 0 );
ImplsRes->CreatePress( 0 );
Brak2Res->CreatePress( 0 );
ValveRes->Act();
BrakeRes->Act();
CntrlRes->Act();
ImplsRes->Act();
Brak2Res->Act();
}
//---KRANY---
double TDriverHandle::GetPF(double const i_bcp, double PP, double HP, double dt, double ep)

View File

@@ -260,6 +260,7 @@ class TESt : public TBrake {
void CheckReleaser(double dt); //odluzniacz
double CVs(double BP); //napelniacz sterujacego
double BVs(double BCP); //napelniacz pomocniczego
void ForceEmptiness() /*override*/; // wymuszenie bycia pustym
inline TESt(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) :
TBrake( i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
@@ -410,6 +411,7 @@ public:
void CheckState( double const BCP, double &dV1 );
double CVs( double const BP );
double BVs( double const BCP );
void ForceEmptiness() /*override*/; // wymuszenie bycia pustym
inline TCV1(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) :
TBrake( i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)
@@ -482,6 +484,7 @@ class TKE : public TBrake { //Knorr Einheitsbauart — jeden do wszystkiego
void PLC( double const mass ); //wspolczynnik cisnienia przystawki wazacej
void SetLP( double const TM, double const LM, double const TBP ); //parametry przystawki wazacej
void SetLBP( double const P ); //cisnienie z hamulca pomocniczego
void ForceEmptiness() /*override*/; // wymuszenie bycia pustym
inline TKE(double i_mbp, double i_bcr, double i_bcd, double i_brc, int i_bcn, int i_BD, int i_mat, int i_ba, int i_nbpa) :
TBrake( i_mbp, i_bcr, i_bcd, i_brc, i_bcn, i_BD, i_mat, i_ba, i_nbpa)