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