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

Vehicles with EIMCtrlType>0 use integrated controller instead of localbrake handle

This commit is contained in:
Królik Uszasty
2019-03-21 09:50:40 +01:00
parent b600d0fb85
commit 72fa1c22a2
2 changed files with 37 additions and 4 deletions

View File

@@ -2707,7 +2707,7 @@ bool TController::IncBrake()
} }
} }
standalone = standalone && ( mvControlling->EIMCtrlType == 0 ); //standalone = standalone && ( mvControlling->EIMCtrlType == 0 );
if( true == standalone ) { if( true == standalone ) {
if( mvControlling->EIMCtrlType > 0 ) { if( mvControlling->EIMCtrlType > 0 ) {
@@ -2855,9 +2855,11 @@ bool TController::DecBrake()
} }
} }
if( !OK ) { if( !OK ) {
OK = DecBrakeEIM(); OK = mvOccupied->DecLocalBrakeLevel(2);
// OK = mvOccupied->DecLocalBrakeLevel(2);
} }
if (!OK) {
OK = DecBrakeEIM();
}
if (mvOccupied->PipePress < 3.0) if (mvOccupied->PipePress < 3.0)
Need_BrakeRelease = true; Need_BrakeRelease = true;
break; break;
@@ -3352,6 +3354,33 @@ void TController::SpeedCntrl(double DesiredSpeed)
} }
}; };
void TController::SetTimeControllers()
{
};
void TController::CheckTimeControllers()
{
//1. Check the type of Main Brake Handle
//2. Check the type of Secondary Brake Handle
//3. Check the type od EIMCtrlType
if (mvOccupied->EIMCtrlType > 0)
{
if (mvOccupied->EIMCtrlType == 1) //traxx
{
if (mvOccupied->MainCtrlPos > 3) mvOccupied->MainCtrlPos = 5;
if (mvOccupied->MainCtrlPos < 3) mvOccupied->MainCtrlPos = 1;
}
else if (mvOccupied->EIMCtrlType == 2) //elf
{
if (mvOccupied->eimic > 0) mvOccupied->MainCtrlPos = 3;
if (mvOccupied->eimic < 0) mvOccupied->MainCtrlPos = 2;
}
}
};
// otwieranie/zamykanie drzwi w składzie albo (tylko AI) EZT // otwieranie/zamykanie drzwi w składzie albo (tylko AI) EZT
void TController::Doors( bool const Open, int const Side ) { void TController::Doors( bool const Open, int const Side ) {
@@ -4291,6 +4320,8 @@ TController::UpdateSituation(double dt) {
auto const reactiontime = std::min( ReactionTime, 2.0 ); auto const reactiontime = std::min( ReactionTime, 2.0 );
if( LastReactionTime < reactiontime ) { return; } if( LastReactionTime < reactiontime ) { return; }
CheckTimeControllers();
LastReactionTime -= reactiontime; LastReactionTime -= reactiontime;
// Ra: nie wiem czemu ReactionTime potrafi dostać 12 sekund, to jest przegięcie, bo przeżyna STÓJ // Ra: nie wiem czemu ReactionTime potrafi dostać 12 sekund, to jest przegięcie, bo przeżyna STÓJ
// yB: otóż jest to jedna trzecia czasu napełniania na towarowym; może się przydać przy // yB: otóż jest to jedna trzecia czasu napełniania na towarowym; może się przydać przy
@@ -5509,7 +5540,7 @@ TController::UpdateSituation(double dt) {
} }
} }
if (mvOccupied->BrakeSystem == TBrakeSystem::Pneumatic) // napełnianie uderzeniowe if (mvOccupied->BrakeSystem == TBrakeSystem::Pneumatic) // napełnianie uderzeniowe
if (mvOccupied->BrakeHandle == TBrakeHandle::FV4a) if (mvOccupied->BrakeHandle == TBrakeHandle::FV4a || mvOccupied->BrakeHandle == TBrakeHandle::MHZ_6P)
{ {
if( mvOccupied->BrakeCtrlPos == -2 ) { if( mvOccupied->BrakeCtrlPos == -2 ) {
mvOccupied->BrakeLevelSet( 0 ); mvOccupied->BrakeLevelSet( 0 );

View File

@@ -218,6 +218,8 @@ private:
bool DecSpeedEIM(); bool DecSpeedEIM();
void SpeedSet(); void SpeedSet();
void SpeedCntrl(double DesiredSpeed); void SpeedCntrl(double DesiredSpeed);
void SetTimeControllers(); /*setting state of time controllers depending of desired action*/
void CheckTimeControllers(); /*checking state of time controllers to reset them to stable position*/
double ESMVelocity(bool Main); double ESMVelocity(bool Main);
bool UpdateHeating(); bool UpdateHeating();
// uaktualnia informacje o prędkości // uaktualnia informacje o prędkości