mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 15:09:19 +02:00
Dodany opcjonalny przełącznik aktywacji kabiny oraz rozłączania tylnego sprzęgu
This commit is contained in:
@@ -1510,6 +1510,9 @@ public:
|
||||
int MainCtrlMaxDirChangePos { 0 }; // can't change reverser state with master controller set above this position
|
||||
int CabActive = 0; //numer kabiny, z której jest sterowanie: 1 lub -1; w przeciwnym razie brak sterowania - rozrzad
|
||||
int CabOccupied = 0; //numer kabiny, w ktorej jest obsada (zwykle jedna na skład) // TODO: move to TController
|
||||
bool CabMaster = false; //czy pojazd jest nadrzędny w składzie
|
||||
bool AutomaticCabActivation = true; //czy zmostkowany rozrzad przelacza sie sam przy zmianie kabiny
|
||||
bool InactivaCabEmergencyBrake = false; //czy bez aktywacji włącza się nagłe
|
||||
double LastSwitchingTime = 0.0; /*czas ostatniego przelaczania czegos*/
|
||||
int WarningSignal = 0; // 0: nie trabi, 1,2,4: trabi
|
||||
bool DepartureSignal = false; /*sygnal odjazdu*/
|
||||
@@ -1715,6 +1718,8 @@ public:
|
||||
void PutCommand(std::string NewCommand, double NewValue1, double NewValue2, const TLocation &NewLocation);
|
||||
bool CabActivisation( bool const Enforce = false );
|
||||
bool CabDeactivisation( bool const Enforce = false );
|
||||
bool CabActivisationAuto( bool const Enforce = false );
|
||||
bool CabDeactivisationAuto( bool const Enforce = false );
|
||||
|
||||
/*! funkcje zwiekszajace/zmniejszajace nastawniki*/
|
||||
/*! glowny nastawnik:*/
|
||||
|
||||
@@ -2686,12 +2686,19 @@ bool TMoverParameters::CabActivisation( bool const Enforce )
|
||||
{
|
||||
CabActive = CabOccupied; // sterowanie jest z kabiny z obsadą
|
||||
DirAbsolute = DirActive * CabActive;
|
||||
CabMaster = true;
|
||||
SecuritySystem.Status |= s_waiting; // activate the alerter TODO: make it part of control based cab selection
|
||||
SendCtrlToNext("CabActivisation", 1, CabActive);
|
||||
}
|
||||
return OK;
|
||||
}
|
||||
|
||||
bool TMoverParameters::CabActivisationAuto(bool const Enforce)
|
||||
{
|
||||
bool OK = AutomaticCabActivation ? CabActivisation(Enforce) : false;
|
||||
return OK;
|
||||
}
|
||||
|
||||
// *************************************************************************************************
|
||||
// Q: 20160710
|
||||
// wyłączenie rozrządu
|
||||
@@ -2700,11 +2707,12 @@ bool TMoverParameters::CabDeactivisation( bool const Enforce )
|
||||
{
|
||||
bool OK = false;
|
||||
|
||||
OK = Enforce || (CabActive == CabOccupied); // o ile obsada jest w kabinie ze sterowaniem
|
||||
OK = Enforce || ((CabActive == CabOccupied) && CabMaster); // o ile obsada jest w kabinie ze sterowaniem
|
||||
if (OK)
|
||||
{
|
||||
CabActive = 0;
|
||||
DirAbsolute = DirActive * CabActive;
|
||||
CabMaster = false;
|
||||
DepartureSignal = false; // nie buczeć z nieaktywnej kabiny
|
||||
SecuritySystem.Status = s_off; // deactivate alerter TODO: make it part of control based cab selection
|
||||
SecuritySystem.SHPLock = false;
|
||||
@@ -2714,6 +2722,12 @@ bool TMoverParameters::CabDeactivisation( bool const Enforce )
|
||||
return OK;
|
||||
}
|
||||
|
||||
bool TMoverParameters::CabDeactivisationAuto(bool const Enforce)
|
||||
{
|
||||
bool OK = AutomaticCabActivation ? CabDeactivisation(Enforce) : false;
|
||||
return OK;
|
||||
}
|
||||
|
||||
// *************************************************************************************************
|
||||
// Q: 20160710
|
||||
// Siła napędzająca drezynę po naciśnięciu wajhy
|
||||
@@ -4441,6 +4455,7 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
||||
|| ( true == TestFlag( EngDmgFlag, 32 ) )
|
||||
*/
|
||||
|| ( true == s_CAtestebrake )
|
||||
|| ( ( 0 == CabActive ) && InactivaCabEmergencyBrake )
|
||||
|| ( ( SpringBrakeDriveEmergencyVel >= 0 )
|
||||
&& ( Vel > SpringBrakeDriveEmergencyVel )
|
||||
&& ( SpringBrake.IsActive ) )
|
||||
@@ -10374,6 +10389,9 @@ void TMoverParameters::LoadFIZ_Cntrl( std::string const &line ) {
|
||||
0;
|
||||
extract_value( BackwardsBranchesAllowed, "BackwardsBranchesAllowed", line, "" );
|
||||
|
||||
extract_value( AutomaticCabActivation, "AutomaticCabActivation", line, "" );
|
||||
extract_value( InactivaCabEmergencyBrake, "InactivaCabEmergencyBrake", line, "" );
|
||||
|
||||
extract_value( StopBrakeDecc, "SBD", line, "" );
|
||||
extract_value( ReleaseParkingBySpringBrake, "ReleaseParkingBySpringBrake", line, "" );
|
||||
extract_value( ReleaseParkingBySpringBrakeWhenDoorIsOpen, "ReleaseParkingBySpringBrakeWhenDoorIsOpen", line, "" );
|
||||
|
||||
Reference in New Issue
Block a user