16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 15:09:19 +02:00

Merge remote-tracking branch 'youby/master' into sim

This commit is contained in:
milek7
2019-04-02 23:07:57 +02:00
9 changed files with 199 additions and 84 deletions

View File

@@ -613,7 +613,7 @@ bool TMoverParameters::Dettach(int ConnectNo)
bool TMoverParameters::DirectionForward()
{
if ((MainCtrlPosNo > 0) && (ActiveDir < 1) && (MainCtrlPos <= MaxMainCtrlPosNoDirChange) && (EIMDirectionChangeAllow()))
if ((MainCtrlPosNo > 0) && (ActiveDir < 1) && (EIMDirectionChangeAllow()))
{
++ActiveDir;
DirAbsolute = ActiveDir * CabNo;
@@ -2349,7 +2349,7 @@ bool TMoverParameters::DirectionBackward(void)
DB = true; //
return DB; // exit; TODO: czy dobrze przetlumaczone?
}
if ((MainCtrlPosNo > 0) && (ActiveDir > -1) && (MainCtrlPos <= MaxMainCtrlPosNoDirChange) && (EIMDirectionChangeAllow()))
if ((MainCtrlPosNo > 0) && (ActiveDir > -1) && (EIMDirectionChangeAllow()))
{
if (EngineType == TEngineType::WheelsDriven)
CabNo--;
@@ -2367,7 +2367,11 @@ bool TMoverParameters::DirectionBackward(void)
bool TMoverParameters::EIMDirectionChangeAllow(void)
{
bool OK = false;
/*
// NOTE: disabled while eimic variables aren't immediately synced with master controller changes inside ai module
OK = (EngineType != TEngineType::ElectricInductionMotor || ((eimic <= 0) && (eimic_real <= 0) && (Vel < 0.1)));
*/
OK = ( MainCtrlPos <= MaxMainCtrlPosNoDirChange );
return OK;
}
@@ -3696,7 +3700,7 @@ void TMoverParameters::UpdatePipePressure(double dt)
Pipe->Flow( temp * Hamulec->GetPF( temp * PipePress, dt, Vel ) + GetDVc( dt ) );
if (ASBType == 128)
Hamulec->ASB(int(SlippingWheels));
Hamulec->ASB(int(SlippingWheels && (Vel>1))*(1+2*int(nrot_eps<-0.01)));
dpPipe = 0;
@@ -3944,6 +3948,7 @@ void TMoverParameters::ComputeTotalForce(double dt) {
// juz zoptymalizowane:
FStand = FrictionForce(RunningShape.R, RunningTrack.DamageFlag); // siła oporów ruchu
double old_nrot = abs(nrot);
nrot = v2n(); // przeliczenie prędkości liniowej na obrotową
if( ( true == TestFlag( BrakeMethod, bp_MHS ) )
@@ -4016,8 +4021,9 @@ void TMoverParameters::ComputeTotalForce(double dt) {
}
else
{
Fb = -Fwheels*Sign(V);
FTrain = 0;
double factor = (FTrain - Fb * Sign(V) != 0 ? Fwheels/(FTrain - Fb * Sign(V)) : 1.0);
Fb *= factor;
FTrain *= factor;
}
if (nrot < 0.1)
{
@@ -4026,6 +4032,7 @@ void TMoverParameters::ComputeTotalForce(double dt) {
nrot = temp_nrot;
}
nrot_eps = (abs(nrot) - (old_nrot))/dt;
// doliczenie sił z innych pojazdów
for( int end = end::front; end <= end::rear; ++end ) {
if( Neighbours[ end ].vehicle != nullptr ) {
@@ -4318,6 +4325,7 @@ double TMoverParameters::CouplerForce( int const End, double dt ) {
// zderzenie
coupler.CheckCollision = true;
if( ( coupler.CouplerType == TCouplerType::Automatic )
&& ( coupler.CouplerType == othercoupler.CouplerType )
&& ( coupler.CouplingFlag == coupling::faux ) ) {
// sprzeganie wagonow z samoczynnymi sprzegami
// EN57
@@ -6000,6 +6008,26 @@ void TMoverParameters::CheckEIMIC(double dt)
}
if (MainCtrlPos >= 3 && eimic < 0) eimic = 0;
if (MainCtrlPos <= 3 && eimic > 0) eimic = 0;
if (LocHandleTimeTraxx)
{
if (LocalBrakeRatio() < 0.05) //pozycja 0
{
eim_localbrake -= dt*0.17; //zmniejszanie
}
if (LocalBrakeRatio() > 0.15) //pozycja 2
{
eim_localbrake += dt*0.17; //wzrastanie
eim_localbrake = std::max(eim_localbrake, BrakePress / MaxBrakePress[0]);
}
else
{
if (eim_localbrake < Hamulec->GetEDBCP() / MaxBrakePress[0])
eim_localbrake = 0;
}
eim_localbrake = clamp(eim_localbrake, 0.0, 1.0);
if (eim_localbrake > 0.04 && eimic > 0) eimic = 0;
}
break;
case 2:
switch (MainCtrlPos)
@@ -8620,6 +8648,7 @@ void TMoverParameters::LoadFIZ_Cntrl( std::string const &line ) {
extract_value( CoupledCtrl, "CoupledCtrl", line, "" );
extract_value( EIMCtrlType, "EIMCtrlType", line, "" );
clamp( EIMCtrlType, 0, 3 );
LocHandleTimeTraxx = (extract_value("LocalBrakeTraxx", line) == "Yes");
extract_value( ScndS, "ScndS", line, "" ); // brak pozycji rownoleglej przy niskiej nastawie PSR