diff --git a/McZapkie/MOVER.h b/McZapkie/MOVER.h index 54b10409..40c1c5f8 100644 --- a/McZapkie/MOVER.h +++ b/McZapkie/MOVER.h @@ -89,6 +89,8 @@ const double g = 9.81; // przyspieszenie ziemskie const double SandSpeed = 0.1; // ile kg/s} /// 2*pi shortcut. const double Pirazy2 = 6.2831853071794f; +/// Brake pipe pressure above nominal that counts as an overcharge [bar]. +const double PipeOverchargeMargin = 0.2; //-- var, const, procedure --------------------------------------------------- /// Truthy alias used by CheckLocomotiveParameters() to ignore a check failure. @@ -1648,7 +1650,7 @@ class TMoverParameters double Handle_OverloadPressureDecrease = 0.002; // predkosc spadku cisnienia przy asymilacji /*max. cisnienie w cyl. ham., stala proporcjonalnosci p-K*/ double HighPipePress = 0.0; - double PipeOverchargeTime = 0.0; // [s] + double PipeOverchargeTime = 0.0; // czas ponad ciśnieniem nominalnym w PG [s] double LowPipePress = 0.0; double DeltaPipePress = 0.0; /*max. i min. robocze cisnienie w przewodzie glownym oraz roznica miedzy nimi*/ diff --git a/McZapkie/Mover.cpp b/McZapkie/Mover.cpp index 3fdceb46..ed358427 100644 --- a/McZapkie/Mover.cpp +++ b/McZapkie/Mover.cpp @@ -4789,7 +4789,7 @@ void TMoverParameters::UpdatePipePressure(double dt) if (CompressedVolume < 0.0) CompressedVolume = 0.0; - PipeOverchargeTime = ( PipePress > HighPipePress + 0.2 ? PipeOverchargeTime + dt : 0.0 ); + PipeOverchargeTime = ( PipePress > HighPipePress + PipeOverchargeMargin ? PipeOverchargeTime + dt : 0.0 ); } // ************************************************************************************************* diff --git a/vehicle/Driver.cpp b/vehicle/Driver.cpp index 5388a739..e3ea6d5f 100644 --- a/vehicle/Driver.cpp +++ b/vehicle/Driver.cpp @@ -2621,18 +2621,12 @@ void TController::Lights(int head, int rear) void TController::DirectionInitial() { // sets the direction after a trainset is loaded mvOccupied->CabActivisationAuto(); - if( mvOccupied->Vel >= EU07_AI_MOVEMENT ) { + if( mvOccupied->Vel > EU07_AI_NOMOVEMENT ) { // actually moving - direction from the sign of V iDirection = mvOccupied->V > 0 ? 1 : -1; iDirectionOrder = iDirection; DirectionForward( mvOccupied->V * mvOccupied->CabActive >= 0.0 ); } - else { - // standing: reverser forward relative to the cab, not from the sign of a micro V - DirectionForward( true ); - iDirection = CheckDirection(); - iDirectionOrder = iDirection; - } CheckVehicles(); }; @@ -5199,8 +5193,7 @@ TController::PrepareDirection() { if( iDirection == 0 ) { // jeśli nie ma ustalonego kierunku - // as in DirectionInitial / TakeControl: below 1 km/h counts as standing - if( mvOccupied->Vel < EU07_AI_MOVEMENT ) { // determine the direction while standing + if( mvOccupied->Vel < EU07_AI_NOMOVEMENT ) { // ustalenie kierunku, gdy stoi iDirection = mvOccupied->CabActive; // wg wybranej kabiny if( iDirection == 0 ) { iDirection = mvOccupied->CabOccupied; @@ -8446,9 +8439,11 @@ void TController::control_main_pipe() { } } - if( mvOccupied->Compressor < 5.0 + if( mvOccupied->Compressor < EU07_AI_COMPRESSORLOWPRESSURE || ( BrakeCtrlPosition < gbh_RP - && ( mvOccupied->EqvtPipePress > (fReady < 0.25 ? 5.1 : 5.2) + && ( mvOccupied->EqvtPipePress > ( fReady < EU07_AI_READYBRAKEPRESSURE ? + EU07_AI_CHARGECUTOFFPRESSURERELEASED : + EU07_AI_CHARGECUTOFFPRESSURE ) || IsAnyPipeOvercharged ) ) ) { cue_action( driver_hint::trainbrakerelease ); } @@ -8556,7 +8551,7 @@ TController::check_cell_ahead() { // shut down, so no signal is acted upon; a command cell is the only way to reach us if( false == AIControllFlag ) { return; } if( ( OrderCurrentGet() & ~( Shunt | Loose_shunt | Obey_train | Bank ) ) != 0 ) { return; } - if( mvOccupied->Vel >= 0.1 ) { return; } + if( mvOccupied->Vel >= EU07_AI_NOMOVEMENT ) { return; } if( TableUpdate( VelDesired, ActualProximityDist, VelNext, AccDesired ) != TCommandType::cm_Command ) { return; } if( eSignNext == nullptr ) { return; } eSignNext->send_command( *this ); diff --git a/vehicle/Driver.h b/vehicle/Driver.h index 679d5f50..2be61a40 100644 --- a/vehicle/Driver.h +++ b/vehicle/Driver.h @@ -26,6 +26,10 @@ auto const EU07_AI_NOMOVEMENT = 0.05; // standstill velocity threshold auto const EU07_AI_OVERCHARGETIME = 3.0; // [s] auto const EU07_AI_MOVEMENT = 1.0; // deliberate movement velocity threshold auto const EU07_AI_SPEEDLIMITEXTENDSBEYONDSCANRANGE = 10000.0; +auto const EU07_AI_READYBRAKEPRESSURE = 0.25; // [bar] powyżej tego skład liczy się jako zahamowany +auto const EU07_AI_CHARGECUTOFFPRESSURE = 5.2; // [bar] koniec napełniania uderzeniowego +auto const EU07_AI_CHARGECUTOFFPRESSURERELEASED = 5.1; // [bar] to samo, gdy skład jest odhamowany +auto const EU07_AI_COMPRESSORLOWPRESSURE = 5.0; // [bar] poniżej tego zbiornik główny nie wystarcza na napełnianie enum TOrders { // rozkazy dla AI