mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-20 16:14:58 +01:00
fix: review of the EN57 EP brake (Sonar null check, EP fuse of the cab car, AI re-asserts the EP brake)
- tests: REQUIRE the brake handle before dereferencing it (Sonar cpp:S2259) - TESt::FillBrakeRes is const (S5817) - cab EP brake command: drop the mvControlled->EpFuse check, SwitchEPBrake already checks the cab car's (mvOccupied) EP fuse with the control supply - AI: with the handle already at the EP brake position, switch the EP brake on again once the control supply is back
This commit is contained in:
@@ -3126,6 +3126,14 @@ bool TController::IncBrake()
|
||||
mvOccupied->SwitchEPBrake( 1 ); // to nie chce działać
|
||||
OK = true;
|
||||
}
|
||||
else if( ( mvOccupied->Handle->GetPos( bh_EPR ) - mvOccupied->Handle->GetPos( bh_EPN ) < 0.1 )
|
||||
&& ( mvOccupied->EpForce <= 0.0 )
|
||||
&& ( mvOccupied->EPBrakeControlPowered() ) ) {
|
||||
// the handle already in the EP brake position, but the EP brake dropped out with the control's
|
||||
// supply (e.g. the EP fuse off in the running brake test): switch it on again
|
||||
mvOccupied->SwitchEPBrake( 1 );
|
||||
OK = ( mvOccupied->EpForce > 0.0 );
|
||||
}
|
||||
else
|
||||
OK = false;
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user