Skip to content

Commit

Permalink
Add ROP/ROW aural alerts to A32NX
Browse files Browse the repository at this point in the history
  • Loading branch information
flogross89 committed Apr 6, 2024
1 parent c22d5d5 commit ec991e7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fbw-a32nx/docs/a320-simvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -3867,7 +3867,7 @@ In the variables below, {number} should be replaced with one item in the set: {
| 27 | TERRAIN AHEAD |

- `A32NX_EGPWS_ALERT_{1 | 2}_DISCRETE_WORD_2`
- Data word for GPWS alerts. Used for displaying alerts on the PFD (on the A380)
- Data word for GPWS alerts. Used for displaying alerts on the PFD (on the A380) or on the GPWS visual indicators on the A320
- Arinc429<Discrete>
- | Bit | Description |
|:---:|:----------------------------:|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class A32NX_FWC {
this._updateTakeoffMemo(_deltaTime);
this._updateLandingMemo(_deltaTime);
this._updateAltitudeWarning();
this.updateRowRopWarnings();
}

_updateButtons(_deltaTime) {
Expand Down Expand Up @@ -380,4 +381,28 @@ class A32NX_FWC {
}
return true;
}

updateRowRopWarnings() {
const w = Arinc429Word.fromSimVarValue('L:A32NX_ROW_ROP_WORD_1');

// ROW
SimVar.SetSimVarValue('L:A32NX_AUDIO_ROW_RWY_TOO_SHORT', 'bool', w.getBitValueOr(15, false));

// ROP
// MAX BRAKING, only for manual braking, if maximum pedal braking is not applied
const maxBrakingSet = SimVar.GetSimVarValue('L:A32NX_LEFT_BRAKE_PEDAL_INPUT', 'number') > 90 || SimVar.GetSimVarValue('L:A32NX_RIGHT_BRAKE_PEDAL_INPUT', 'number') > 90;
const maxBraking = w.getBitValueOr(13, false) && !maxBrakingSet;
SimVar.SetSimVarValue('L:A32NX_AUDIO_ROP_MAX_BRAKING', 'bool', maxBraking);

// SET MAX REVERSE, if not already max. reverse set and !MAX_BRAKING
const maxReverseSet = SimVar.GetSimVarValue('L:XMLVAR_Throttle1Position', 'number') < 0.1 && SimVar.GetSimVarValue('L:XMLVAR_Throttle2Position', 'number') < 0.1;
const maxReverse = (w.getBitValueOr(12, false) || w.getBitValueOr(13, false)) && !maxReverseSet;
SimVar.SetSimVarValue('L:A32NX_AUDIO_ROW_SET_MAX_REVERSE', 'bool', !maxBraking && maxReverse);

// At 80kt, KEEP MAX REVERSE once, if max. reversers deployed
const ias = SimVar.GetSimVarValue('AIRSPEED INDICATED', 'knots');
SimVar.SetSimVarValue('L:A32NX_AUDIO_ROP_KEEP_MAX_REVERSE', 'bool', (ias <= 80 && ias > 4) && (w.getBitValueOr(12, false) || w.getBitValueOr(13, false)));


}
}
2 changes: 1 addition & 1 deletion fbw-a380x/src/systems/systems-host/systems/LegacyFwc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ export class LegacyFwc {

// SET MAX REVERSE, if not already max. reverse set and !MAX_BRAKING
const maxReverseSet = SimVar.GetSimVarValue('L:XMLVAR_Throttle2Position', 'number') < 0.1 && SimVar.GetSimVarValue('L:XMLVAR_Throttle3Position', 'number') < 0.1;
const maxReverse = w.getBitValueOr(12, false) && !maxReverseSet;
const maxReverse = (w.getBitValueOr(12, false) || w.getBitValueOr(13, false)) && !maxReverseSet;
SimVar.SetSimVarValue('L:A32NX_AUDIO_ROW_SET_MAX_REVERSE', 'bool', !maxBraking && maxReverse);

// At 80kt, KEEP MAX REVERSE once, if max. reversers deployed
Expand Down

0 comments on commit ec991e7

Please sign in to comment.