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

refactor: A32NX BatDisplay to fbw-common / add A380 separate BAT instrument #8495

Merged
merged 20 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Changed var name and added documentation of var
  • Loading branch information
frankkopp committed Feb 21, 2024
commit 77b74984e4e7d95f8a8a2f327c93b1e2aa9505c5
69 changes: 38 additions & 31 deletions fbw-a380x/docs/a380-simvars.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
- A380X_OVHD_ANN_LT_POSITION
- Enum
- Represents the state of the ANN LT switch
- State | Value
-------- | ----
TEST | 0
BRT | 1
DIM | 2
- | State | Value |
|-------|-------|
| TEST | 0 |
| BRT | 1 |
| DIM | 2 |

- A32NX_OVHD_{name}_PB_IS_AVAILABLE
- Bool
Expand Down Expand Up @@ -93,6 +93,13 @@
- Bool
- True when the AC ESS FEED push button is NORMAL

- A380X_OVHD_BAT_DISPLAY_SELECTOR_KNOB
- Number
- The position of the battery display knob from left to right
- ESS=0, APU=1, OFF=2, BAT1=3, BAT2=4
- Mapped to battery voltage indexes: {bat_index} = ESS=4 | APU=3 | OFF=0 | BAT1=1 | BAT2=2
- A32NX_ELEC_BAT_{bat_index}_POTENTIAL is used to get the voltage

- A32NX_NOSE_WHEEL_LEFT_ANIM_ANGLE
- Degrees
- Angular position of left nose wheel (in wheel axis not steering)
Expand Down Expand Up @@ -490,7 +497,7 @@
- 3
- 4

## Indicating/Recording ATA 31
## Indicating-Recording ATA 31

- A32NX_CDS_CAN_BUS_1_1_AVAIL
- Bool
Expand Down Expand Up @@ -549,22 +556,22 @@
- A380X_ECAM_CP_SELECTED_PAGE
- Enum
- Currently requested page on the ECAM CP
- State | Value
-------- | ----
ENG | 0
BLEED | 1
PRESS | 2
EL/AC | 3
FUEL | 4
HYD | 5
C/B | 6
APU | 7
COND | 8
DOOR | 9
EL/DC | 10
WHEEL | 11
F/CTL | 12
VIDEO | 13
- | State | Value |
|-------|-------|
| ENG | 0 |
| BLEED | 1 |
| PRESS | 2 |
| EL/AC | 3 |
| FUEL | 4 |
| HYD | 5 |
| C/B | 6 |
| APU | 7 |
| COND | 8 |
| DOOR | 9 |
| EL/DC | 10 |
| WHEEL | 11 |
| F/CTL | 12 |
| VIDEO | 13 |

## EFIS Control Panel ATA 31

Expand All @@ -587,20 +594,20 @@
- Boolean
- Indicates which waypoint filter is selected
- {side} = L or R
- State | Value
-------- | ----
WPT | 0
VORD | 1
NDB | 2
- | State | Value |
|-------|-------|
| WPT | 0 |
| VORD | 1 |
| NDB | 2 |

- A380X_EFIS_{side}_ACTIVE_OVERLAY
- Boolean
- Indicates which waypoint filter is selected
- {side} = L or R
- State | Value
-------- | ----
WX | 0
TERR | 1
- | State | Value |
|-------|-------|
| WX | 0 |
| TERR | 1 |

- A380X_EFIS_{side}_ARPT_BUTTON_IS_ON
- Boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2383,7 +2383,7 @@
<SWITCH_DIRECTION>Horizontal</SWITCH_DIRECTION>
<ARROW_TYPE>Curved</ARROW_TYPE>
<SWITCH_POSITION_TYPE>L</SWITCH_POSITION_TYPE>
<SWITCH_POSITION_VAR>A380X_KNOB_OVHD_BAT_POSITION</SWITCH_POSITION_VAR>
<SWITCH_POSITION_VAR>A380X_OVHD_BAT_DISPLAY_SELECTOR_KNOB</SWITCH_POSITION_VAR>
<ANIMREF_ID>0</ANIMREF_ID>
<ANIMCURSOR_MIN>0</ANIMCURSOR_MIN>
<ANIMCURSOR_MAX>1</ANIMCURSOR_MAX>
Expand Down
4 changes: 2 additions & 2 deletions fbw-a380x/src/systems/instruments/src/BAT/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ import {BatDisplay} from '@flybywiresim/bat';
import {useSimVar} from '@flybywiresim/fbw-sdk';

const BatRoot = () => {
const [selectedBattery, setSelectedBattery] = useSimVar('L:A380X_KNOB_OVHD_BAT_POSITION', 'Number', 100);
const [selectedBattery, setSelectedBattery] = useSimVar('L:A380X_OVHD_BAT_DISPLAY_SELECTOR_KNOB', 'Number', 100);

// set to OFF if the value is out of range
if (selectedBattery < 0 || selectedBattery > 4) {
setSelectedBattery(0);
setSelectedBattery(2);
}

// mapping of knob (lvar) values to battery numbers to allow easy lvar and model values
Expand Down