Skip to content

Commit

Permalink
feat(pfd): Add vertical deviation indicator, ROW/ROP/OANS warnings (f…
Browse files Browse the repository at this point in the history
…lybywiresim#8605)

* linting

* port LinearDeviationIndicator from a32nx PFD

* add PFD warnings for ROW, ROP, OANS

* add speed margins to a380x

* add ROP/ROW/OANS PFD warnings to a32nx

* update two-line message, fix bug in getDisplayIndex()

* make RWY TOO SHORT smaller

* Disable second ISIS; update colors for PFD tapes, PFD horizon, EWD THR gauges

* restructure code, add A380X-only warnings

* refactor Publisher structure, leave only data with existing sources

* switch to data words for ROS/ROP and OANS PFD alerts

* clean up

* feat: add some A429 utils

* fix(pfd): tidy up publishers

* feat: add fwc publisher

* fix(pfd): use fwc data for stall warning

* A380X: GPWS PFD alerts, ROP/ROW aural alerts,
A32NX: Add GPWS discrete word to GPWS,
Both: warnings position update

* use correct discrete word bit fields

* Add ROP/ROW aural alerts to A32NX

* fix lint after rebase

* lint-fix

* update font for IF WET RWY TOO SHORT (fix for a32nx)

* lint + lint-fixes

* add LS reminder for ILS, frequency of ILS information has same font size before and after decimal point

* consolidate to single definitions.scss, use standard colors for thrust gauge and PFD tapes

* move ISIS changes to other PR

* move logic from A32NX_FWC.js to PseudoFWC

* inhibit single chimes for the first two seconds after power-on

---------

Co-authored-by: Michael Corcoran <[email protected]>
  • Loading branch information
flogross89 and tracernz authored Jun 15, 2024
1 parent 20c8d71 commit 4bedac5
Show file tree
Hide file tree
Showing 43 changed files with 1,808 additions and 178 deletions.
1 change: 1 addition & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@
1. [EFCS] Fix ground spoiler retraction after increasing TLA slightly above 0 - @lukecologne (luke)
1. [FWC] Improved LDG LT memo to take into account light position - @BravoMike99 (bruno_pt99)
1. [PRESS] Add pressurization system failures - @mjuhe (Miquel Juhe)
1. [PFD] Implement alerts within artificial horizon (ROP, ROW, OANS, stall, windshear) @flogross89 (Flo)

## 0.11.0

Expand Down
58 changes: 58 additions & 0 deletions fbw-a32nx/docs/a320-simvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
- [Landing Gear (ATA 32)](#landing-gear-ata-32)
- [ATC (ATA 34)](#atc-ata-34)
- [Radio Altimeter (ATA 34)](#radio-altimeter-ata-34)
- [GPWS / TAWS (ATA 34)](#gpws--taws-ata-34)
- [ROW / ROP / OANS (ATA 34)](#row--rop--oans-ata-34)
- [Electronic Flight Bag (ATA 46)](#electronic-flight-bag-ata-46)

## Uncategorized
Expand Down Expand Up @@ -3913,6 +3915,62 @@ In the variables below, {number} should be replaced with one item in the set: {
- 1
- 2

## GPWS / TAWS (ATA 34)
- `A32NX_EGPWS_ALERT_{1 | 2}_DISCRETE_WORD_1`
- Data word for GPWS alerts. Used for displaying alerts on the PFD (on the A380) and triggering aural warnings
- Arinc429<Discrete>
- | Bit | Description |
|:---:|:----------------------:|
| 11 | SINKRATE |
| 12 | PULL UP |
| 13 | TERRAIN |
| 14 | DON'T SINK |
| 15 | TOO LOW GEAR |
| 16 | TOO LOW FLAPS |
| 17 | TOO LOW TERRAIN |
| 18 | GLIDESLOPE |
| 20 | TERRAIN PULL UP |
| 22 | TERRAIN AHEAD PULL UP |
| 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) or on the GPWS visual indicators on the A320
- Arinc429<Discrete>
- | Bit | Description |
|:---:|:----------------------------:|
| 11 | G/S CANCEL |
| 12 | GPWS ALERT |
| 13 | GPWS WARNING |
| 14 | GPWS INOP |
| 15 | W/S WARNING |
| 16 | AUDIO ON |
| 22 | TERRAIN AWARENESS WARNING |
| 23 | TERRAIN AWARENESS CAUTION |
| 24 | TERRAIN AWARENESS INOP |
| 25 | EXTERNAL FAULT |
| 26 | TERRAIN AWARENESS NOT AVAIL. |

## ROW / ROP / OANS (ATA 34)

- A32NX_ROW_ROP_WORD_1
- Data word for ROW and ROP functions. Used for displaying alerts on the PFD.
- Arinc429<Discrete>
- | Bit | Description |
|:---:|:---------------------------------:|
| 11 | ROW/ROP operative |
| 12 | ROP: Active with autobrake |
| 13 | ROP: Active with manual braking |
| 14 | ROW Wet: Runway too short |
| 15 | ROW Dry: Runway too short |

- A32NX_OANS_WORD_1
- Data word for OANS functions. Used for displaying alerts on the PFD.
- Arinc429<Discrete>
- | Bit | Description |
|:---:|:---------------------------------:|
| 11 | OANS: Runway ahead |


## Electronic Flight Bag (ATA 46)

- A32NX_PUSHBACK_SYSTEM_ENABLED
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2306,15 +2306,50 @@
</Requires>
</Sound>

<!-- Stall warning =====================================================================-->
<Sound WwiseEvent="aural_stall_new" WwiseData="true" NodeName="PEDALS_LEFT" LocalVar="A32NX_AUDIO_STALL_WARNING" Continuous="true">
<Range LowerBound="1"/>
<Requires SimVar="ELECTRICAL MAIN BUS VOLTAGE" Units="VOLTS" Index="1">
<Range LowerBound="28" />
</Requires>
</Sound>

<!-- ROP/ROW warnings =====================================================================-->
<Sound WwiseEvent="brake_max_braking" WwiseData="true" NodeName="Wiper_Base_l" LocalVar="A32NX_AUDIO_ROP_MAX_BRAKING" Continuous="true">
<Range LowerBound="1"/>
<Requires SimVar="ELECTRICAL MAIN BUS VOLTAGE" Units="VOLTS" Index="1">
<Range LowerBound="28" />
</Requires>
</Sound>

<Sound WwiseEvent="set_max_reverse" WwiseData="true" NodeName="Wiper_Base_l" LocalVar="A32NX_AUDIO_ROW_SET_MAX_REVERSE" Continuous="true">
<Range LowerBound="1"/>
<Requires SimVar="ELECTRICAL MAIN BUS VOLTAGE" Units="VOLTS" Index="1">
<Range LowerBound="28" />
</Requires>
</Sound>

<Sound WwiseEvent="keep_max_reverse" WwiseData="true" NodeName="Wiper_Base_l" LocalVar="A32NX_AUDIO_ROP_KEEP_MAX_REVERSE" Continuous="false">
<Range LowerBound="1"/>
<Requires SimVar="ELECTRICAL MAIN BUS VOLTAGE" Units="VOLTS" Index="1">
<Range LowerBound="28" />
</Requires>
</Sound>

<Sound WwiseEvent="runway_too_short" WwiseData="true" NodeName="Wiper_Base_l" LocalVar="A32NX_AUDIO_ROW_RWY_TOO_SHORT" Continuous="true">
<Range LowerBound="1"/>
<Requires SimVar="ELECTRICAL MAIN BUS VOLTAGE" Units="VOLTS" Index="1">
<Range LowerBound="28" />
</Requires>
</Sound>

</SimVarSounds>

<!-- AvionicSounds ========================================================================================== -->

<AvionicSounds>
<Sound WwiseData="true" WwiseEvent="cchordshort" Continuous="false" NodeName="PEDALS_LEFT" ViewPoint="Inside"/>
<Sound WwiseData="true" WwiseEvent="cchordloop" Continuous="true" NodeName="PEDALS_LEFT" ViewPoint="Inside"/>
<Sound WwiseData="true" WwiseEvent="aural_stall" />
<Sound WwiseData="true" WwiseEvent="aural_stall_new" NodeName="PEDALS_LEFT" ViewPoint="Inside" />
<Sound WwiseData="true" WwiseEvent="aural_pull_up" />
<Sound WwiseData="true" WwiseEvent="aural_pullup_new" Continuous="false" NodeName="PEDALS_LEFT" ViewPoint="Inside"/>
<Sound WwiseData="true" WwiseEvent="aural_overspeed" />
Expand Down Expand Up @@ -2388,13 +2423,6 @@
<Sound WwiseData="true" WwiseEvent="traffic_traffic" NodeName="Wiper_Base_l" />
<Sound WwiseData="true" WwiseEvent="TCAS_sys_test_OK" NodeName="Wiper_Base_l" />

<!-- ROPS callouts ==================================================================================== -->

<Sound WwiseData="true" WwiseEvent="brake_max_braking" NodeName="Wiper_Base_l" />
<Sound WwiseData="true" WwiseEvent="keep_max_reverse" NodeName="Wiper_Base_l" />
<Sound WwiseData="true" WwiseEvent="runway_too_short" NodeName="Wiper_Base_l" />
<Sound WwiseData="true" WwiseEvent="set_max_reverse" NodeName="Wiper_Base_l" />

</AvionicSounds>

<!-- AnimationSounds ========================================================================================== -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class A32NX_GPWS {
{},
],
onChange: (current, _) => {
SimVar.SetSimVarValue("L:A32NX_GPWS_GS_Warning_Active", "Bool", current >= 1);
this.setGlideSlopeWarning(current >= 1);
}
}
];
Expand All @@ -109,15 +109,53 @@ class A32NX_GPWS {
this.AltCallState.setState("ground");
this.RetardState = A32NX_Util.createMachine(RetardStateMachine);
this.RetardState.setState("landed");

this.egpwsAlertDiscreteWord1 = Arinc429Word.empty();
this.egpwsAlertDiscreteWord2 = Arinc429Word.empty();
}

gpwsUpdateDiscreteWords() {
this.egpwsAlertDiscreteWord1.ssm = Arinc429SignStatusMatrix.NormalOperation;
this.egpwsAlertDiscreteWord1.setBitValue(11, this.modes[0].current === 1);
this.egpwsAlertDiscreteWord1.setBitValue(12, this.modes[0].current === 2);
this.egpwsAlertDiscreteWord1.setBitValue(13, this.modes[1].current === 1);
this.egpwsAlertDiscreteWord1.setBitValue(12, this.modes[1].current === 2);
this.egpwsAlertDiscreteWord1.setBitValue(14, this.modes[2].current === 1);
this.egpwsAlertDiscreteWord1.setBitValue(15, this.modes[3].current === 1);
this.egpwsAlertDiscreteWord1.setBitValue(16, this.modes[3].current === 2);
this.egpwsAlertDiscreteWord1.setBitValue(17, this.modes[3].current === 3);
this.egpwsAlertDiscreteWord1.setBitValue(18, this.modes[4].current === 1);
Arinc429Word.toSimVarValue('L:A32NX_EGPWS_ALERT_1_DISCRETE_WORD_1', this.egpwsAlertDiscreteWord1.value, this.egpwsAlertDiscreteWord1.ssm);
Arinc429Word.toSimVarValue('L:A32NX_EGPWS_ALERT_2_DISCRETE_WORD_1', this.egpwsAlertDiscreteWord1.value, this.egpwsAlertDiscreteWord1.ssm);

this.egpwsAlertDiscreteWord2.ssm = Arinc429SignStatusMatrix.NormalOperation;
this.egpwsAlertDiscreteWord2.setBitValue(14, false);
Arinc429Word.toSimVarValue('L:A32NX_EGPWS_ALERT_1_DISCRETE_WORD_2', this.egpwsAlertDiscreteWord2.value, this.egpwsAlertDiscreteWord2.ssm);
Arinc429Word.toSimVarValue('L:A32NX_EGPWS_ALERT_2_DISCRETE_WORD_2', this.egpwsAlertDiscreteWord2.value, this.egpwsAlertDiscreteWord2.ssm);
}

setGlideSlopeWarning(state) {
SimVar.SetSimVarValue('L:A32NX_GPWS_GS_Warning_Active', 'Bool', state ? 1 : 0); // Still need this for XML
this.egpwsAlertDiscreteWord2.setBitValue(11, state);
Arinc429Word.toSimVarValue('L:A32NX_EGPWS_ALERT_1_DISCRETE_WORD_2', this.egpwsAlertDiscreteWord2.value, this.egpwsAlertDiscreteWord2.ssm);
Arinc429Word.toSimVarValue('L:A32NX_EGPWS_ALERT_2_DISCRETE_WORD_2', this.egpwsAlertDiscreteWord2.value, this.egpwsAlertDiscreteWord2.ssm);
}

setGpwsWarning(state) {
SimVar.SetSimVarValue('L:A32NX_GPWS_Warning_Active', 'Bool', state ? 1 : 0); // Still need this for XML
this.egpwsAlertDiscreteWord2.setBitValue(12, state);
this.egpwsAlertDiscreteWord2.setBitValue(13, state);
Arinc429Word.toSimVarValue('L:A32NX_EGPWS_ALERT_1_DISCRETE_WORD_2', this.egpwsAlertDiscreteWord2.value, this.egpwsAlertDiscreteWord2.ssm);
Arinc429Word.toSimVarValue('L:A32NX_EGPWS_ALERT_2_DISCRETE_WORD_2', this.egpwsAlertDiscreteWord2.value, this.egpwsAlertDiscreteWord2.ssm);
}

init() {
console.log('A32NX_GPWS init');

this.radnav.init(NavMode.FOUR_SLOTS);

SimVar.SetSimVarValue("L:A32NX_GPWS_GS_Warning_Active", "Bool", 0);
SimVar.SetSimVarValue("L:A32NX_GPWS_Warning_Active", "Bool", 0);
this.setGlideSlopeWarning(false);
this.setGpwsWarning(false);

NXDataStore.getAndSubscribe('CONFIG_A32NX_FWC_RADIO_AUTO_CALL_OUT_PINS', (k, v) => k === 'CONFIG_A32NX_FWC_RADIO_AUTO_CALL_OUT_PINS' && (this.autoCallOutPins = v), DEFAULT_RADIO_AUTO_CALL_OUTS);
}
Expand Down Expand Up @@ -171,11 +209,12 @@ class A32NX_GPWS {
this.Mode4MaxRAAlt = NaN;
}

SimVar.SetSimVarValue("L:A32NX_GPWS_GS_Warning_Active", "Bool", 0);
SimVar.SetSimVarValue("L:A32NX_GPWS_Warning_Active", "Bool", 0);
this.setGlideSlopeWarning(false);
this.setGpwsWarning(false);
}

this.GPWSComputeLightsAndCallouts();
this.egpwsAlertDiscreteWord1();

if ((mda !== 0 || (dh !== -1 && dh !== -2) && phase === FmgcFlightPhases.APPROACH)) {
let minimumsDA; //MDA or DH
Expand Down Expand Up @@ -276,7 +315,7 @@ class A32NX_GPWS {
}

const illuminateGpwsLight = activeTypes.some((type) => type.gpwsLight);
SimVar.SetSimVarValue("L:A32NX_GPWS_Warning_Active", "Bool", illuminateGpwsLight);
this.setGpwsWarning(illuminateGpwsLight);
}

/**
Expand Down
Loading

0 comments on commit 4bedac5

Please sign in to comment.