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

SecuritySystem fixes

This commit is contained in:
milek7
2019-03-18 22:32:59 +01:00
parent 04f548788f
commit e46add2939
2 changed files with 6 additions and 16 deletions

View File

@@ -609,9 +609,6 @@ bool TMoverParameters::DirectionForward()
{ {
++ActiveDir; ++ActiveDir;
DirAbsolute = ActiveDir * CabNo; DirAbsolute = ActiveDir * CabNo;
if (DirAbsolute)
if (Battery) // jeśli bateria jest już załączona
BatterySwitch(true); // to w ten oto durny sposób aktywuje się CA/SHP
SendCtrlToNext("Direction", ActiveDir, CabNo); SendCtrlToNext("Direction", ActiveDir, CabNo);
return true; return true;
} }
@@ -2144,8 +2141,7 @@ bool TMoverParameters::CabActivisation(void)
if (OK) if (OK)
{ {
CabNo = ActiveCab; // sterowanie jest z kabiny z obsadą CabNo = ActiveCab; // sterowanie jest z kabiny z obsadą
DirAbsolute = ActiveDir * CabNo; DirAbsolute = ActiveDir * CabNo;
SecuritySystem.set_enabled(true);
SendCtrlToNext("CabActivisation", 1, CabNo); SendCtrlToNext("CabActivisation", 1, CabNo);
} }
return OK; return OK;
@@ -2164,8 +2160,7 @@ bool TMoverParameters::CabDeactivisation(void)
{ {
CabNo = 0; CabNo = 0;
DirAbsolute = ActiveDir * CabNo; DirAbsolute = ActiveDir * CabNo;
DepartureSignal = false; // nie buczeć z nieaktywnej kabiny DepartureSignal = false; // nie buczeć z nieaktywnej kabiny
SecuritySystem.set_enabled(false);
SendCtrlToNext("CabActivisation", 0, ActiveCab); // CabNo==0! SendCtrlToNext("CabActivisation", 0, ActiveCab); // CabNo==0!
} }
@@ -2250,11 +2245,10 @@ bool TMoverParameters::Sandbox( bool const State, range_t const Notify )
// hunter-091012: rozbicie alarmow, dodanie testu czuwaka // hunter-091012: rozbicie alarmow, dodanie testu czuwaka
void TMoverParameters::SecuritySystemReset(void) // zbijanie czuwaka/SHP void TMoverParameters::SecuritySystemReset(void) // zbijanie czuwaka/SHP
{ {
if (TrainType != dt_EZT && ActiveDir == 0) // reset all, used by AI
return; // Ra 2014-03: w EZT nie trzeba ustawiać kierunku
SecuritySystem.acknowledge_press(); SecuritySystem.acknowledge_press();
SecuritySystem.acknowledge_release(); SecuritySystem.acknowledge_release();
SecuritySystem.cabsignal_reset();
} }
// ************************************************************************************************* // *************************************************************************************************
@@ -2290,7 +2284,7 @@ bool TMoverParameters::BatterySwitch(bool State)
SendCtrlToNext("BatterySwitch", 0, CabNo); SendCtrlToNext("BatterySwitch", 0, CabNo);
BS = true; BS = true;
SecuritySystem.set_enabled((Battery) && (ActiveCab != 0)); SecuritySystem.set_enabled(Battery);
return BS; return BS;
} }
@@ -2332,9 +2326,6 @@ bool TMoverParameters::DirectionBackward(void)
// else // else
ActiveDir--; ActiveDir--;
DirAbsolute = ActiveDir * CabNo; DirAbsolute = ActiveDir * CabNo;
if (DirAbsolute != 0)
if (Battery) // jeśli bateria jest już załączona
BatterySwitch(true); // to w ten oto durny sposób aktywuje się CA/SHP
DB = true; DB = true;
SendCtrlToNext("Direction", ActiveDir, CabNo); SendCtrlToNext("Direction", ActiveDir, CabNo);
} }
@@ -9750,7 +9741,7 @@ bool TMoverParameters::RunCommand( std::string Command, double CValue1, double C
Battery = true; Battery = true;
else if ((CValue1 == 0)) else if ((CValue1 == 0))
Battery = false; Battery = false;
SecuritySystem.set_enabled(((Battery) && (ActiveCab != 0))); SecuritySystem.set_enabled(Battery);
OK = SendCtrlToNext( Command, CValue1, CValue2, Couplertype ); OK = SendCtrlToNext( Command, CValue1, CValue2, Couplertype );
} }
// else if command='EpFuseSwitch' then {NBMX} // else if command='EpFuseSwitch' then {NBMX}

View File

@@ -1768,7 +1768,6 @@ void TTrain::OnCommand_batteryenable( TTrain *Train, command_data const &Command
if( Train->mvOccupied->LightsPosNo > 0 ) { if( Train->mvOccupied->LightsPosNo > 0 ) {
Train->SetLights(); Train->SetLights();
} }
Train->mvOccupied->SecuritySystem.set_enabled(true); // Ra: znowu w kabinie jest coś, co być nie powinno!
} }
} }
} }