mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-05 13:14:50 +01:00
Merge pull request #189 from pwarszawski/fix/ai-ready-released-brakes
AI: don't cut the power for a brake already released below 0.4 bar
This commit is contained in:
@@ -5922,9 +5922,12 @@ TController::determine_consist_state() {
|
|||||||
auto const bp { std::max( 0.0, vehicle->BrakePress - ( vehicle->SpeedCtrlUnit.Parking ? vehicle->MaxBrakePress[ 0 ] * vehicle->StopBrakeDecc : 0.0 ) ) };
|
auto const bp { std::max( 0.0, vehicle->BrakePress - ( vehicle->SpeedCtrlUnit.Parking ? vehicle->MaxBrakePress[ 0 ] * vehicle->StopBrakeDecc : 0.0 ) ) };
|
||||||
if (Ready) {
|
if (Ready) {
|
||||||
// bo jak coś nie odhamowane, to dalej nie ma co sprawdzać
|
// bo jak coś nie odhamowane, to dalej nie ma co sprawdzać
|
||||||
if( TestFlagAny(vehicle->Hamulec->GetBrakeStatus(), b_hld | b_on)
|
if( auto const isbraking { TestFlagAny( vehicle->Hamulec->GetBrakeStatus(), b_hld | b_on ) };
|
||||||
|| ( vehicle->Vel < 1.0 ? bp > 0.4 : // ensure the brakes are sufficiently released when starting to move
|
vehicle->Vel < 1.0 ?
|
||||||
vehicle->Fb * 0.001 > 10.0 ) ) { // once in motion we can make a more lenient check
|
isbraking || bp > 0.4 : // ensure the brakes are sufficiently released when starting to move
|
||||||
|
// once in motion a brake down to 0.4 bar counts as released (UIC), even if its distributor
|
||||||
|
// is still in the lap position while the brake pipe recharges
|
||||||
|
( isbraking && bp > 0.4 ) || vehicle->Fb > 10000.0 ) { // 10 kN
|
||||||
Ready = false;
|
Ready = false;
|
||||||
}
|
}
|
||||||
// Ra: odluźnianie przeładowanych lokomotyw, ciągniętych na zimno - prowizorka...
|
// Ra: odluźnianie przeładowanych lokomotyw, ciągniętych na zimno - prowizorka...
|
||||||
|
|||||||
Reference in New Issue
Block a user