Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(fws): rebuild flight warning system in Rust #4872

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

92 changes: 71 additions & 21 deletions fbw-a32nx/docs/a320-simvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
- [Autoflight (ATA 22)](#autoflight-ata-22)
- [Flaps / Slats (ATA 27)](#flaps--slats-ata-27)
- [Flight Controls (ATA 27)](#flight-controls-ata-27)
- [Flight Warning System (ATA 31)](#flight-warning-system-ata-31)
- [Landing Gear (ATA 32)](#landing-gear-ata-32)
- [ATC (ATA 34)](#atc-ata-34)
- [Radio Altimeter (ATA 34)](#radio-altimeter-ata-34)
Expand Down Expand Up @@ -244,27 +245,6 @@
- Feet
- Departure runway elevation as calculated by the FMC

- A32NX_FWC_FLIGHT_PHASE
- Enum
- Contains the numeric flight phase as determined by the FWC
- Input for: systems.wasm

- A32NX_FWC_SKIP_STARTUP
- Bool
- Set to true in a non-cold and dark flight phase to skip the initial memorization step

- A32NX_FWC_TOMEMO
- Bool
- True when the FWC decides that the takeoff memo should be shown

- A32NX_FWC_LDGMEMO
- Bool
- True when the FWC decides that the landing memo should be shown

- A32NX_FWC_INHIBOVRD
- Bool
- True when the FWC decides that flight phase inhibits should be overridden (and ignored)

- A32NX_SPEEDS_VS
- Number
- Current config stall speed
Expand Down Expand Up @@ -3458,6 +3438,70 @@ In the variables below, {number} should be replaced with one item in the set: {
- Percent
- Trim wheel position in percent

## Flight Warning System (ATA 31)

- A32NX_FWC_FLIGHT_PHASE
- Enum
- Contains the numeric flight phase as determined by the FWC
- **WARNING:** This value may be nonsensical or unset if the FWCs have lost power or have failed. Only use this if you're modeling a screen or system that truly retrieves this from an FWC.
- **DEPRECATED:** You should be using A32NX_FWS_FWC_{1|2}_FLIGHT_PHASE instead.

- A32NX_FWS_ANY_FWC_NORMAL
- Bool
- True when either FWC is working.

- A32NX_FWS_MW_CANCEL_ON_{CAPT,FO}
- Bool
- True while the captain/first officer Master Warning cancel button is depressed.

- A32NX_FWS_MC_CANCEL_ON_{CAPT,FO}
- Bool
- True while the captain/first officer Master Caution cancel button is depressed.

- A32NX_FWS_TOMEMO
- Bool
- True when the FWC responsible for the ECAM determines that the takeoff memo should be shown

- A32NX_FWS_LDGMEMO
- Bool
- True when the FWC responsible for the ECAM determines that the landing memo should be shown

- A32NX_FWS_TOINHIBIT
- Bool
- True when the FWC responsible for the ECAM determines that the special line T.O INHIBIT should be shown

- A32NX_FWS_LDGMEMO
- Bool
- True when the FWC responsible for the ECAM determines that the special line LDG INHIBIT should be shown

- A32NX_FWS_INHIBOVRD
- Bool
- True when the FWC responsible for the ECAM determines that flight phase inhibits should be overridden (and ignored)

- A32NX_FWS_FWC_{1|2}_NORMAL
- Bool
- True when the corresponding FWC is working.

- A32NX_FWS_FWC_{1|2}_FLIGHT_PHASE
- Enum
- The flight phase as determined by the corresponding FWC, or 0 if the FWC is not ready.

- A32NX_FWS_FWC_{1|2}_AUDIO_ATTENUATION
- Bool
- True when the corresponding FWC has determined that aural warnings should be 6dB quieter.

- A32NX_FWS_FWC_{1|2}_SYNTHETIC_VOICE
- Enum
- The specific synthetic voice line that should be played, or 0 when none should be played.

- A32NX_FWS_FWC_{1|2}_ALT_ALERT_PULSING
- Bool
- True when the altitude window should be pulsing due to an altitude alert, as determined the corresponding FWC.

- A32NX_FWS_FWC_{1|2}_ALT_ALERT_FLASHING
- Enum
- True when the altitude window should be flashing due to an altitude alert, as determined the corresponding FWC.

## Landing Gear (ATA 32)

- A32NX_LGCIU_{number}_DISCRETE_WORD_1
Expand Down Expand Up @@ -3675,6 +3719,12 @@ In the variables below, {number} should be replaced with one item in the set: {
- {number}
- 0
- 1

- A32NX_TCAS_AURAL_ADVISORY_OUTPUT
- boolean
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- boolean
- Bool

- Populated by TCAS, Read-Only for other systems
- Whether TCAS is currently playing an aural advisory. True for the duration of the synthetic voice.

## Radio Altimeter (ATA 34)

- A32NX_RA_{number}_RADIO_ALTITUDE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,51 @@
</UseTemplate>
</Template>

<Template Name="FBW_ECAM_HELD_BUTTON_SubTemplate">
<DefaultTemplateParameters>
<NODE_ID>PUSH_ECAM_#BASE_NAME#</NODE_ID>
<ANIM_NAME_BUTTON>PUSH_ECAM_#BASE_NAME#</ANIM_NAME_BUTTON>
<BACKLIGHT_NODE_ID>PUSH_ECAM_#BASE_NAME#_SEQ1</BACKLIGHT_NODE_ID>
<WWISE_EVENT_1>mcdubuttons</WWISE_EVENT_1>
<NORMALIZED_TIME_1>0.1</NORMALIZED_TIME_1>
<WWISE_EVENT_2>mcdubuttons</WWISE_EVENT_2>
<NORMALIZED_TIME_2>0.5</NORMALIZED_TIME_2>
<SEQ2_POWERED>1</SEQ2_POWERED>
</DefaultTemplateParameters>

<Component ID="#NODE_ID#" Node="#NODE_ID#">
<UseTemplate Name="ASOBO_GT_Push_Button_Held">
<ANIM_NAME>#ANIM_NAME_BUTTON#</ANIM_NAME>
<LEFT_SINGLE_CODE>
1 (&gt;L:A32NX_BTN_#BASE_NAME#)
</LEFT_SINGLE_CODE>
<LEFT_LEAVE_CODE>
0 (&gt;L:A32NX_BTN_#BASE_NAME#)
</LEFT_LEAVE_CODE>
</UseTemplate>
</Component>

<Condition Check="POTENTIOMETER">
<True>
<Component ID="#BACKLIGHT_NODE_ID#" Node="#BACKLIGHT_NODE_ID#">
<UseTemplate Name="ASOBO_GT_Emissive_Potentiometer">
<EMISSIVE_CODE>#SEQ2_POWERED#</EMISSIVE_CODE>
</UseTemplate>
</Component>
</True>
</Condition>
</Template>

<Template Name="FBW_ECAM_HELD_BUTTON_Template">
<DefaultTemplateParameters>
<BASE_NAME>UNKNOWN</BASE_NAME>
<GROUP_INDEX>-1</GROUP_INDEX>
</DefaultTemplateParameters>

<UseTemplate Name="FBW_ECAM_HELD_BUTTON_SubTemplate">
</UseTemplate>
</Template>

<Template Name="A32NX_ECAM_CLR_BUTTON_Template">
<DefaultTemplateParameters>
<BASE_NAME>UNKNOWN</BASE_NAME>
Expand Down Expand Up @@ -347,11 +392,14 @@
</DefaultTemplateParameters>

<Component ID="#NODE_ID#" Node="#NODE_ID#">
<UseTemplate Name="ASOBO_GT_Push_Button">
<UseTemplate Name="ASOBO_GT_Push_Button_Held">
<ANIM_NAME>#ANIM_NAME_BUTTON#</ANIM_NAME>
<LEFT_SINGLE_CODE>
1 (&gt;L:A32NX_BTN_#BASE_NAME#)
</LEFT_SINGLE_CODE>
<LEFT_LEAVE_CODE>
0 (&gt;L:A32NX_BTN_#BASE_NAME#)
</LEFT_LEAVE_CODE>
</UseTemplate>
</Component>

Expand Down Expand Up @@ -511,7 +559,7 @@
<!-- ECAM T.O CONFIG -->
<UseTemplate Name="FBW_Anim_Interactions">
<ANIM_TYPE>BUTTON</ANIM_TYPE>
<ANIM_TEMPLATE>FBW_ECAM_BUTTON_Template</ANIM_TEMPLATE>
<ANIM_TEMPLATE>FBW_ECAM_HELD_BUTTON_Template</ANIM_TEMPLATE>
<BASE_NAME>TOCONFIG</BASE_NAME>
<PART_ID>ECAM_TOCFG</PART_ID>
<TOOLTIPID>Test T.O CONFIG</TOOLTIPID>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ A32NX_OVHD_HYD_LEAK_MEASUREMENT_G_PB_IS_AUTO=1
A32NX_OVHD_HYD_LEAK_MEASUREMENT_B_PB_IS_AUTO=1
A32NX_OVHD_HYD_LEAK_MEASUREMENT_Y_PB_IS_AUTO=1
A32NX_INITIAL_FLIGHT_PHASE = 5
A32NX_FWC_SKIP_STARTUP=1
A32NX_RAIN_REPELLENT_RIGHT_ON = 0
A32NX_RAIN_REPELLENT_LEFT_ON = 0
A32NX_RCDR_TEST = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ A32NX_OVHD_HYD_LEAK_MEASUREMENT_G_PB_IS_AUTO=1
A32NX_OVHD_HYD_LEAK_MEASUREMENT_B_PB_IS_AUTO=1
A32NX_OVHD_HYD_LEAK_MEASUREMENT_Y_PB_IS_AUTO=1
A32NX_INITIAL_FLIGHT_PHASE = 3
A32NX_FWC_SKIP_STARTUP=1
A32NX_RAIN_REPELLENT_RIGHT_ON = 0
A32NX_RAIN_REPELLENT_LEFT_ON = 0
A32NX_RCDR_TEST = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,6 @@ A32NX_OVHD_HYD_LEAK_MEASUREMENT_G_PB_IS_AUTO=1
A32NX_OVHD_HYD_LEAK_MEASUREMENT_B_PB_IS_AUTO=1
A32NX_OVHD_HYD_LEAK_MEASUREMENT_Y_PB_IS_AUTO=1
A32NX_INITIAL_FLIGHT_PHASE = 5
A32NX_FWC_SKIP_STARTUP=1
A32NX_RAIN_REPELLENT_RIGHT_ON = 0
A32NX_RAIN_REPELLENT_LEFT_ON = 0
A32NX_RCDR_TEST = 0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4710,17 +4710,17 @@
<PART_ID>MASTERWARN_L</PART_ID>
<LEFT_SINGLE_CODE>
0 (&gt;L:A32NX_MASTER_WARNING)
1 (&gt;L:PUSH_AUTOPILOT_MASTERAWARN_L)
1 (&gt;L:A32NX_FWS_MW_CANCEL_ON_CAPT)
</LEFT_SINGLE_CODE>
<LEFT_LEAVE_CODE>
0 (&gt;L:PUSH_AUTOPILOT_MASTERAWARN_L)
0 (&gt;L:A32NX_FWS_MW_CANCEL_ON_CAPT)
</LEFT_LEAVE_CODE>
<!-- 801XP-C via CB 29LP -->
<SEQ1_POWERED>(L:A32NX_ELEC_AC_ESS_SHED_BUS_IS_POWERED)</SEQ1_POWERED>
<SEQ1_CODE>(L:Generic_Master_Warning_Active) (L:A32NX_OVHD_INTLT_ANN) 0 == (L:A32NX_ELEC_DC_2_BUS_IS_POWERED, Bool) and or</SEQ1_CODE>
<SEQ1_CODE>(L:Generic_Master_Warning_Active) (L:A32NX_FWS_FWC_1_NORMAL) 1 == and (L:A32NX_OVHD_INTLT_ANN) 0 == (L:A32NX_ELEC_DC_2_BUS_IS_POWERED, Bool) and or</SEQ1_CODE>
<!-- 202XP-A via CB 27LP -->
<SEQ2_POWERED>(L:A32NX_ELEC_AC_2_BUS_IS_POWERED)</SEQ2_POWERED>
<SEQ2_CODE>(L:Generic_Master_Warning_Active) (L:A32NX_OVHD_INTLT_ANN) 0 == (L:A32NX_ELEC_DC_2_BUS_IS_POWERED, Bool) and or</SEQ2_CODE>
<SEQ2_CODE>(L:Generic_Master_Warning_Active) (L:A32NX_FWS_FWC_2_NORMAL) 1 == and (L:A32NX_OVHD_INTLT_ANN) 0 == (L:A32NX_ELEC_DC_2_BUS_IS_POWERED, Bool) and or</SEQ2_CODE>
<TOOLTIPID>TT:COCKPIT.TOOLTIPS.MASTER_WARNING_ACKNOWLEDGE</TOOLTIPID>
</UseTemplate>
<UseTemplate Name="FBW_Anim_Interactions">
Expand All @@ -4730,17 +4730,17 @@
<PART_ID>MASTERCAUT_L</PART_ID>
<LEFT_SINGLE_CODE>
0 (&gt;L:A32NX_MASTER_CAUTION)
1 (&gt;L:PUSH_AUTOPILOT_MASTERCAUT_L)
1 (&gt;L:A32NX_FWS_MC_CANCEL_ON_CAPT)
</LEFT_SINGLE_CODE>
<LEFT_LEAVE_CODE>
0 (&gt;L:PUSH_AUTOPILOT_MASTERCAUT_L)
0 (&gt;L:A32NX_FWS_MC_CANCEL_ON_CAPT)
</LEFT_LEAVE_CODE>
<!-- 801XP-C via CB 29LP -->
<SEQ1_POWERED>(L:A32NX_ELEC_AC_ESS_SHED_BUS_IS_POWERED)</SEQ1_POWERED>
<SEQ1_CODE>(L:Generic_Master_Caution_Active) (L:A32NX_OVHD_INTLT_ANN) 0 == (L:A32NX_ELEC_DC_2_BUS_IS_POWERED, Bool) and or</SEQ1_CODE>
<SEQ1_CODE>(L:Generic_Master_Caution_Active) (L:A32NX_FWS_FWC_1_NORMAL) 1 == and (L:A32NX_OVHD_INTLT_ANN) 0 == (L:A32NX_ELEC_DC_2_BUS_IS_POWERED, Bool) and or</SEQ1_CODE>
<!-- 202XP-A via CB 27LP -->
<SEQ2_POWERED>(L:A32NX_ELEC_AC_2_BUS_IS_POWERED)</SEQ2_POWERED>
<SEQ2_CODE>(L:Generic_Master_Caution_Active) (L:A32NX_OVHD_INTLT_ANN) 0 == (L:A32NX_ELEC_DC_2_BUS_IS_POWERED, Bool) and or</SEQ2_CODE>
<SEQ2_CODE>(L:Generic_Master_Caution_Active) (L:A32NX_FWS_FWC_2_NORMAL) 1 == and (L:A32NX_OVHD_INTLT_ANN) 0 == (L:A32NX_ELEC_DC_2_BUS_IS_POWERED, Bool) and or</SEQ2_CODE>
<TOOLTIPID>TT:COCKPIT.TOOLTIPS.MASTER_CAUTION_ACKNOWLEDGE</TOOLTIPID>
</UseTemplate>
<UseTemplate Name="FBW_Anim_Interactions">
Expand All @@ -4750,17 +4750,17 @@
<PART_ID>MASTERWARN_R</PART_ID>
<LEFT_SINGLE_CODE>
0 (&gt;L:A32NX_MASTER_WARNING)
1 (&gt;L:PUSH_AUTOPILOT_MASTERAWARN_L)
1 (&gt;L:A32NX_FWS_MW_CANCEL_ON_FO)
</LEFT_SINGLE_CODE>
<LEFT_LEAVE_CODE>
0 (&gt;L:PUSH_AUTOPILOT_MASTERAWARN_L)
0 (&gt;L:A32NX_FWS_MW_CANCEL_ON_FO)
</LEFT_LEAVE_CODE>
<!-- 202XP-A via CB 27LP -->
<SEQ1_POWERED>(L:A32NX_ELEC_AC_2_BUS_IS_POWERED)</SEQ1_POWERED>
<SEQ1_CODE>(L:Generic_Master_Warning_Active) (L:A32NX_OVHD_INTLT_ANN) 0 == (L:A32NX_ELEC_DC_2_BUS_IS_POWERED, Bool) and or</SEQ1_CODE>
<SEQ1_CODE>(L:Generic_Master_Warning_Active) (L:A32NX_FWS_FWC_2_NORMAL) 1 == and (L:A32NX_OVHD_INTLT_ANN) 0 == (L:A32NX_ELEC_DC_2_BUS_IS_POWERED, Bool) and or</SEQ1_CODE>
<!-- 801XP-C via CB 29LP -->
<SEQ2_POWERED>(L:A32NX_ELEC_AC_ESS_SHED_BUS_IS_POWERED)</SEQ2_POWERED>
<SEQ2_CODE>(L:Generic_Master_Warning_Active) (L:A32NX_OVHD_INTLT_ANN) 0 == (L:A32NX_ELEC_DC_2_BUS_IS_POWERED, Bool) and or</SEQ2_CODE>
<SEQ2_CODE>(L:Generic_Master_Warning_Active) (L:A32NX_FWS_FWC_1_NORMAL) 1 == and (L:A32NX_OVHD_INTLT_ANN) 0 == (L:A32NX_ELEC_DC_2_BUS_IS_POWERED, Bool) and or</SEQ2_CODE>
<TOOLTIPID>TT:COCKPIT.TOOLTIPS.MASTER_WARNING_ACKNOWLEDGE</TOOLTIPID>
</UseTemplate>
<UseTemplate Name="FBW_Anim_Interactions">
Expand All @@ -4770,17 +4770,17 @@
<PART_ID>MASTERCAUT_R</PART_ID>
<LEFT_SINGLE_CODE>
0 (&gt;L:A32NX_MASTER_CAUTION)
1 (&gt;L:PUSH_AUTOPILOT_MASTERCAUT_L)
1 (&gt;L:A32NX_FWS_MC_CANCEL_ON_FO)
</LEFT_SINGLE_CODE>
<LEFT_LEAVE_CODE>
0 (&gt;L:PUSH_AUTOPILOT_MASTERCAUT_L)
0 (&gt;L:A32NX_FWS_MC_CANCEL_ON_FO)
</LEFT_LEAVE_CODE>
<!-- 202XP-A via CB 27LP -->
<SEQ1_POWERED>(L:A32NX_ELEC_AC_2_BUS_IS_POWERED)</SEQ1_POWERED>
<SEQ1_CODE>(L:Generic_Master_Caution_Active) (L:A32NX_OVHD_INTLT_ANN) 0 == (L:A32NX_ELEC_DC_2_BUS_IS_POWERED, Bool) and or</SEQ1_CODE>
<SEQ1_CODE>(L:Generic_Master_Caution_Active) (L:A32NX_FWS_FWC_2_NORMAL) 1 == and (L:A32NX_OVHD_INTLT_ANN) 0 == (L:A32NX_ELEC_DC_2_BUS_IS_POWERED, Bool) and or</SEQ1_CODE>
<!-- 801XP-C via CB 29LP -->
<SEQ2_POWERED>(L:A32NX_ELEC_AC_ESS_SHED_BUS_IS_POWERED)</SEQ2_POWERED>
<SEQ2_CODE>(L:Generic_Master_Caution_Active) (L:A32NX_OVHD_INTLT_ANN) 0 == (L:A32NX_ELEC_DC_2_BUS_IS_POWERED, Bool) and or</SEQ2_CODE>
<SEQ2_CODE>(L:Generic_Master_Caution_Active) (L:A32NX_FWS_FWC_1_NORMAL) 1 == and (L:A32NX_OVHD_INTLT_ANN) 0 == (L:A32NX_ELEC_DC_2_BUS_IS_POWERED, Bool) and or</SEQ2_CODE>
<TOOLTIPID>TT:COCKPIT.TOOLTIPS.MASTER_CAUTION_ACKNOWLEDGE</TOOLTIPID>
</UseTemplate>
<!-- old buttons without split seq 1/2 -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ A32NX_OVHD_HYD_LEAK_MEASUREMENT_B_PB_IS_AUTO=1
A32NX_OVHD_HYD_LEAK_MEASUREMENT_Y_PB_IS_AUTO=1
A32NX_CABIN_READY=1
A32NX_TO_CONFIG_NORMAL=1
A32NX_FWC_SKIP_STARTUP=1
A32NX_RAIN_REPELLENT_RIGHT_ON = 0
A32NX_RAIN_REPELLENT_LEFT_ON = 0
A32NX_RCDR_TEST = 0
Expand Down
Loading
Loading