diff --git a/Driver.cpp b/Driver.cpp index ac6cb3d6..1af6fd7a 100644 --- a/Driver.cpp +++ b/Driver.cpp @@ -4996,6 +4996,7 @@ TController::UpdateSituation(double dt) { TableClear(); // skanowanie od nowa iDrivigFlags &= ~moveStartHorn; // bez trąbienia przed ruszeniem SetVelocity(fShuntVelocity, fShuntVelocity); // ustawienie prędkości jazdy + mvOccupied->BrakeReleaser(0); // wyłączyć luzowanie } } diff --git a/McZapkie/MOVER.h b/McZapkie/MOVER.h index c9db86df..9e592985 100644 --- a/McZapkie/MOVER.h +++ b/McZapkie/MOVER.h @@ -1307,6 +1307,7 @@ public: double eimic = 0; /*aktualna pozycja zintegrowanego sterowania jazda i hamowaniem*/ double eimic_real = 0; /*faktycznie uzywana pozycja zintegrowanego sterowania jazda i hamowaniem*/ int EIMCtrlType = 0; /*rodzaj wariantu zadajnika jazdy*/ + bool SpeedCtrlTypeTime = false; /*czy tempomat sterowany czasowo*/ double eimv_pr = 0; /*realizowany procent dostepnej sily rozruchu/hamowania*/ double eimv[21]; static std::vector const eimv_labels; diff --git a/McZapkie/Mover.cpp b/McZapkie/Mover.cpp index e8e79703..78d6b51a 100644 --- a/McZapkie/Mover.cpp +++ b/McZapkie/Mover.cpp @@ -5021,7 +5021,44 @@ double TMoverParameters::TractionForce( double dt ) { { if( true == Mains ) { //tempomat - if (ScndCtrlPosNo > 1) + if (ScndCtrlPosNo == 4 && SpeedCtrlTypeTime) + { + switch (ScndCtrlPos) { + case 0: + NewSpeed = 0; + ScndCtrlActualPos = 0; + SpeedCtrlTimer = 10; + break; + case 1: + if (SpeedCtrlTimer > SpeedCtrlDelay) { + SpeedCtrlTimer = 0; + NewSpeed -= 10; + if (NewSpeed < 0) NewSpeed = 0; + } + else + SpeedCtrlTimer += dt; + break; + case 2: + SpeedCtrlTimer = 10; + ScndCtrlActualPos = NewSpeed; + break; + case 3: + if (SpeedCtrlTimer > SpeedCtrlDelay) { + SpeedCtrlTimer = 0; + NewSpeed += 10; + if (NewSpeed > Vmax) NewSpeed = Vmax; + } + else + SpeedCtrlTimer += dt; + break; + case 4: + NewSpeed = Vmax; + ScndCtrlActualPos = Vmax; + SpeedCtrlTimer = 10; + break; + } + } + else if (ScndCtrlPosNo > 1) { if (ScndCtrlPos != NewSpeed) { @@ -8619,6 +8656,10 @@ void TMoverParameters::LoadFIZ_Cntrl( std::string const &line ) { // speed control extract_value( SpeedCtrlDelay, "SpeedCtrlDelay", line, "" ); + SpeedCtrlTypeTime = + (extract_value("SpeedCtrlType", line) == "Time") ? + true : + false; // converter { diff --git a/McZapkie/hamulce.cpp b/McZapkie/hamulce.cpp index 3544b002..6d258f8e 100644 --- a/McZapkie/hamulce.cpp +++ b/McZapkie/hamulce.cpp @@ -481,6 +481,12 @@ double TWest::GetPF( double const PP, double const dt, double const Vel ) dv = 0; BrakeCyl->Flow(-dv); + if ((BrakeStatus & b_rls) == b_rls) //odluzniacz + dv = PF(0, CVP, 0.1 * SizeBC) * dt; + else + dv = 0; + BrakeCyl->Flow(-dv); + // hamulec EP temp = BVP * int(EPS > 0); dv = PF(temp, LBP, 0.0015) * dt * EPS * EPS * int(LBP * EPS < MaxBP * LoadC); diff --git a/Train.cpp b/Train.cpp index 27edc02f..3d547637 100644 --- a/Train.cpp +++ b/Train.cpp @@ -462,6 +462,7 @@ dictionary_source *TTrain::GetTrainState() { dict->insert( "main_ctrl_actual_pos", mover->MainCtrlActualPos ); dict->insert( "scndctrl_pos", mover->ScndCtrlPos ); dict->insert( "scnd_ctrl_actual_pos", mover->ScndCtrlActualPos ); + dict->insert( "new_speed", mover->NewSpeed); // brakes dict->insert( "manual_brake", ( mvOccupied->ManualBrakePos > 0 ) ); bool const bEP = ( mvControlled->LocHandle->GetCP() > 0.2 ) || ( fEIMParams[ 0 ][ 2 ] > 0.01 );