mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 13:59:19 +02:00
Merge branch 'tmj-dev' into nogfx
This commit is contained in:
@@ -867,7 +867,8 @@ public:
|
||||
/*
|
||||
int BrakeStatus = b_off; //0 - odham, 1 - ham., 2 - uszk., 4 - odluzniacz, 8 - antyposlizg, 16 - uzyte EP, 32 - pozycja R, 64 - powrot z R
|
||||
*/
|
||||
bool EmergencyBrakeFlag = false; /*hamowanie nagle*/
|
||||
bool AlarmChainFlag = false; // manual emergency brake
|
||||
bool RadioStopFlag = false; /*hamowanie nagle*/
|
||||
int BrakeDelayFlag = 0; /*nastawa opoznienia ham. osob/towar/posp/exp 0/1/2/4*/
|
||||
int BrakeDelays = 0; /*nastawy mozliwe do uzyskania*/
|
||||
int BrakeOpModeFlag = 0; /*nastawa trybu pracy PS/PN/EP/MED 1/2/4/8*/
|
||||
@@ -1082,7 +1083,8 @@ public:
|
||||
bool IncManualBrakeLevel(int CtrlSpeed);
|
||||
bool DecManualBrakeLevel(int CtrlSpeed);
|
||||
bool DynamicBrakeSwitch(bool Switch);
|
||||
bool EmergencyBrakeSwitch(bool Switch);
|
||||
bool RadiostopSwitch(bool Switch);
|
||||
bool AlarmChainSwitch( bool const State );
|
||||
bool AntiSlippingBrake(void);
|
||||
bool BrakeReleaser(int state);
|
||||
bool SwitchEPBrake(int state);
|
||||
|
||||
@@ -1081,7 +1081,7 @@ void TMoverParameters::CollisionDetect(int CouplerN, double dt)
|
||||
EventFlag = true;
|
||||
|
||||
if ((coupler.CouplingFlag & ctrain_pneumatic) == ctrain_pneumatic)
|
||||
EmergencyBrakeFlag = true; // hamowanie nagle - zerwanie przewodow hamulcowych
|
||||
AlarmChainFlag = true; // hamowanie nagle - zerwanie przewodow hamulcowych
|
||||
coupler.CouplingFlag = 0;
|
||||
|
||||
switch (CouplerN) // wyzerowanie flag podlaczenia ale ciagle sa wirtualnie polaczone
|
||||
@@ -2187,7 +2187,7 @@ void TMoverParameters::SecuritySystemCheck(double dt)
|
||||
// obsady
|
||||
// poza tym jest zdefiniowany we wszystkich 3 członach EN57
|
||||
if ((!Radio))
|
||||
EmergencyBrakeSwitch(false);
|
||||
RadiostopSwitch(false);
|
||||
|
||||
if ((SecuritySystem.SystemType > 0) && (SecuritySystem.Status > 0) &&
|
||||
(Battery)) // Ra: EZT ma teraz czuwak w rozrządczym
|
||||
@@ -2258,7 +2258,7 @@ void TMoverParameters::SecuritySystemCheck(double dt)
|
||||
}
|
||||
else if (!Battery)
|
||||
{ // wyłączenie baterii deaktywuje sprzęt
|
||||
EmergencyBrakeSwitch(false);
|
||||
RadiostopSwitch(false);
|
||||
// SecuritySystem.Status = 0; //deaktywacja czuwaka
|
||||
}
|
||||
}
|
||||
@@ -2776,34 +2776,49 @@ bool TMoverParameters::DynamicBrakeSwitch(bool Switch)
|
||||
// Q: 20160711
|
||||
// włączenie / wyłączenie hamowania awaryjnego
|
||||
// *************************************************************************************************
|
||||
bool TMoverParameters::EmergencyBrakeSwitch(bool Switch)
|
||||
bool TMoverParameters::RadiostopSwitch(bool Switch)
|
||||
{
|
||||
bool EBS;
|
||||
if ((BrakeSystem != Individual) && (BrakeCtrlPosNo > 0))
|
||||
{
|
||||
if ((!EmergencyBrakeFlag) && Switch)
|
||||
{
|
||||
EmergencyBrakeFlag = Switch;
|
||||
if( ( BrakeSystem != Individual )
|
||||
&& ( BrakeCtrlPosNo > 0 ) ) {
|
||||
|
||||
if( ( true == Switch )
|
||||
&& ( false == RadioStopFlag ) ) {
|
||||
RadioStopFlag = Switch;
|
||||
EBS = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ((abs(V) < 0.1) &&
|
||||
(Switch == false)) // odblokowanie hamulca bezpieczenistwa tylko po zatrzymaniu
|
||||
{
|
||||
EmergencyBrakeFlag = Switch;
|
||||
else {
|
||||
if( ( Switch == false )
|
||||
&& ( std::abs( V ) < 0.1 ) ) {
|
||||
// odblokowanie hamulca bezpieczenistwa tylko po zatrzymaniu
|
||||
RadioStopFlag = Switch;
|
||||
EBS = true;
|
||||
}
|
||||
else
|
||||
else {
|
||||
EBS = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
EBS = false; // nie ma hamulca bezpieczenstwa gdy nie ma hamulca zesp.
|
||||
else {
|
||||
// nie ma hamulca bezpieczenstwa gdy nie ma hamulca zesp.
|
||||
EBS = false;
|
||||
}
|
||||
|
||||
return EBS;
|
||||
}
|
||||
|
||||
bool TMoverParameters::AlarmChainSwitch( bool const State ) {
|
||||
|
||||
bool stateswitched { false };
|
||||
|
||||
if( AlarmChainFlag != State ) {
|
||||
// simple routine for the time being
|
||||
AlarmChainFlag = State;
|
||||
stateswitched = true;
|
||||
}
|
||||
return stateswitched;
|
||||
}
|
||||
|
||||
// *************************************************************************************************
|
||||
// Q: 20160710
|
||||
// hamowanie przeciwpoślizgowe
|
||||
@@ -3281,12 +3296,19 @@ void TMoverParameters::UpdatePipePressure(double dt)
|
||||
Pipe2->Flow(dpMainValve);
|
||||
}
|
||||
|
||||
// if(EmergencyBrakeFlag)and(BrakeCtrlPosNo=0)then //ulepszony hamulec bezp.
|
||||
if ((EmergencyBrakeFlag) || (TestFlag(SecuritySystem.Status, s_SHPebrake)) ||
|
||||
(TestFlag(SecuritySystem.Status, s_CAebrake)) ||
|
||||
(s_CAtestebrake == true) ||
|
||||
(TestFlag(EngDmgFlag, 32)) /* or (not Battery)*/) // ulepszony hamulec bezp.
|
||||
dpMainValve = dpMainValve + PF(0, PipePress, 0.15) * dt;
|
||||
// ulepszony hamulec bezp.
|
||||
if( ( true == RadioStopFlag )
|
||||
|| ( true == AlarmChainFlag )
|
||||
|| ( true == TestFlag( SecuritySystem.Status, s_SHPebrake ) )
|
||||
|| ( true == TestFlag( SecuritySystem.Status, s_CAebrake ) )
|
||||
/*
|
||||
// NOTE: disabled because 32 is 'load destroyed' flag, what does this have to do with emergency brake?
|
||||
// (if it's supposed to be broken coupler, such event sets alarmchainflag instead when appropriate)
|
||||
|| ( true == TestFlag( EngDmgFlag, 32 ) )
|
||||
*/
|
||||
|| ( true == s_CAtestebrake ) ) {
|
||||
dpMainValve = dpMainValve + PF( 0, PipePress, 0.15 ) * dt;
|
||||
}
|
||||
// 0.2*Spg
|
||||
Pipe->Flow(-dpMainValve);
|
||||
Pipe->Flow(-(PipePress)*0.001 * dt);
|
||||
@@ -8266,7 +8288,7 @@ bool TMoverParameters::RunCommand( std::string Command, double CValue1, double C
|
||||
}
|
||||
else if (Command == "Emergency_brake")
|
||||
{
|
||||
if (EmergencyBrakeSwitch(floor(CValue1) == 1)) // YB: czy to jest potrzebne?
|
||||
if (RadiostopSwitch(floor(CValue1) == 1)) // YB: czy to jest potrzebne?
|
||||
OK = true;
|
||||
else
|
||||
OK = false;
|
||||
|
||||
Reference in New Issue
Block a user