mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 22:09:19 +02:00
shp activation fix
This commit is contained in:
@@ -2373,8 +2373,9 @@ void TMoverParameters::SecuritySystemCheck(double dt)
|
|||||||
if ((!Radio))
|
if ((!Radio))
|
||||||
RadiostopSwitch(false);
|
RadiostopSwitch(false);
|
||||||
|
|
||||||
if ((SecuritySystem.SystemType > 0) && (SecuritySystem.Status > 0) &&
|
if ((SecuritySystem.SystemType > 0)
|
||||||
(Battery)) // Ra: EZT ma teraz czuwak w rozrządczym
|
&& (SecuritySystem.Status > 0)
|
||||||
|
&& (Battery)) // Ra: EZT ma teraz czuwak w rozrządczym
|
||||||
{
|
{
|
||||||
// CA
|
// CA
|
||||||
if( ( SecuritySystem.AwareMinSpeed > 0.0 ?
|
if( ( SecuritySystem.AwareMinSpeed > 0.0 ?
|
||||||
@@ -2402,30 +2403,29 @@ void TMoverParameters::SecuritySystemCheck(double dt)
|
|||||||
SecuritySystem.EmergencyBrakeDelay) &&
|
SecuritySystem.EmergencyBrakeDelay) &&
|
||||||
(SecuritySystem.EmergencyBrakeDelay >= 0))
|
(SecuritySystem.EmergencyBrakeDelay >= 0))
|
||||||
SetFlag(SecuritySystem.Status, s_CAebrake);
|
SetFlag(SecuritySystem.Status, s_CAebrake);
|
||||||
|
}
|
||||||
// SHP
|
// SHP
|
||||||
if (TestFlag(SecuritySystem.SystemType, 2) &&
|
if( TestFlag( SecuritySystem.SystemType, 2 ) ) {
|
||||||
TestFlag(SecuritySystem.Status, s_active)) // jeśli świeci albo miga
|
if( TestFlag( SecuritySystem.Status, s_SHPalarm ) ) {
|
||||||
SecuritySystem.SystemSoundSHPTimer += dt;
|
// jeśli buczy
|
||||||
if (TestFlag(SecuritySystem.SystemType, 2) &&
|
|
||||||
TestFlag(SecuritySystem.Status, s_SHPalarm)) // jeśli buczy
|
|
||||||
SecuritySystem.SystemBrakeSHPTimer += dt;
|
SecuritySystem.SystemBrakeSHPTimer += dt;
|
||||||
if (TestFlag(SecuritySystem.SystemType, 2) && TestFlag(SecuritySystem.Status, s_active))
|
}
|
||||||
if ((Vel > SecuritySystem.VelocityAllowed) && (SecuritySystem.VelocityAllowed >= 0))
|
if( TestFlag( SecuritySystem.Status, s_active ) ) {
|
||||||
SetFlag(SecuritySystem.Status, s_SHPebrake);
|
// jeśli świeci albo miga
|
||||||
else if (((SecuritySystem.SystemSoundSHPTimer > SecuritySystem.SoundSignalDelay) &&
|
SecuritySystem.SystemSoundSHPTimer += dt;
|
||||||
(SecuritySystem.SoundSignalDelay >= 0)) ||
|
|
||||||
((Vel > SecuritySystem.NextVelocityAllowed) &&
|
|
||||||
(SecuritySystem.NextVelocityAllowed >= 0)))
|
|
||||||
if (!SetFlag(SecuritySystem.Status,
|
|
||||||
s_SHPalarm)) // juz wlaczony sygnal dzwiekowy}
|
|
||||||
if ((SecuritySystem.SystemBrakeSHPTimer >
|
|
||||||
SecuritySystem.EmergencyBrakeDelay) &&
|
|
||||||
(SecuritySystem.EmergencyBrakeDelay >= 0))
|
|
||||||
SetFlag(SecuritySystem.Status, s_SHPebrake);
|
|
||||||
|
|
||||||
} // else SystemTimer:=0;
|
|
||||||
|
|
||||||
|
if( ( SecuritySystem.VelocityAllowed >= 0 ) && ( Vel > SecuritySystem.VelocityAllowed ) ) {
|
||||||
|
SetFlag( SecuritySystem.Status, s_SHPebrake );
|
||||||
|
}
|
||||||
|
else if( ( ( SecuritySystem.SoundSignalDelay >= 0 ) && ( SecuritySystem.SystemSoundSHPTimer > SecuritySystem.SoundSignalDelay ) )
|
||||||
|
|| ( ( SecuritySystem.NextVelocityAllowed >= 0 ) && ( Vel > SecuritySystem.NextVelocityAllowed ) ) ) {
|
||||||
|
SetFlag( SecuritySystem.Status, s_SHPalarm );
|
||||||
|
if( ( SecuritySystem.EmergencyBrakeDelay >= 0 ) && ( SecuritySystem.SystemBrakeSHPTimer > SecuritySystem.EmergencyBrakeDelay ) ) {
|
||||||
|
SetFlag( SecuritySystem.Status, s_SHPebrake );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// TEST CA
|
// TEST CA
|
||||||
if (TestFlag(SecuritySystem.Status, s_CAtest)) // jeśli świeci albo miga
|
if (TestFlag(SecuritySystem.Status, s_CAtest)) // jeśli świeci albo miga
|
||||||
SecuritySystem.SystemBrakeCATestTimer += dt;
|
SecuritySystem.SystemBrakeCATestTimer += dt;
|
||||||
@@ -10308,7 +10308,7 @@ bool TMoverParameters::RunCommand( std::string Command, double CValue1, double C
|
|||||||
else if ((CValue1 == 0))
|
else if ((CValue1 == 0))
|
||||||
Battery = false;
|
Battery = false;
|
||||||
if ((Battery) && (ActiveCab != 0) /*or (TrainType=dt_EZT)*/)
|
if ((Battery) && (ActiveCab != 0) /*or (TrainType=dt_EZT)*/)
|
||||||
SecuritySystem.Status = SecuritySystem.Status || s_waiting; // aktywacja czuwaka
|
SecuritySystem.Status = SecuritySystem.Status | s_waiting; // aktywacja czuwaka
|
||||||
else
|
else
|
||||||
SecuritySystem.Status = 0; // wyłączenie czuwaka
|
SecuritySystem.Status = 0; // wyłączenie czuwaka
|
||||||
OK = SendCtrlToNext( Command, CValue1, CValue2, Couplertype );
|
OK = SendCtrlToNext( Command, CValue1, CValue2, Couplertype );
|
||||||
|
|||||||
Reference in New Issue
Block a user