Skip to content

Commit

Permalink
chore(a380x): port fcu and make fixes (flybywiresim#8919)
Browse files Browse the repository at this point in the history
* chore: straight port of fcu

* chore: add actual type information

The type errors are now all real.

* chore: clean up css vars

* chore: missed one

* chore: fix erroneous typings

* feat: port altitude

* feat: port baro and fix presel

* doc: fixme

* feat(fcu): pointers

* fix: add radio nav publisher since it's referenced already

* fix: publisher

* fix: eslintrc

* chore: fix lint (except bugs from old fcu)

* fix: allow element to be undefined

* fix: logic errors in vs manager (from old code)

* fix: logic errors in hdg manager (from old code)

* fix: accept undefined element

* fix: comment for 2cas

* fix: type error in mode manager

* fix: type errors in speed manager

* fix: add some fixmes
  • Loading branch information
tracernz authored Oct 12, 2024
1 parent 53c9f3c commit 7c6f3d2
Show file tree
Hide file tree
Showing 55 changed files with 2,316 additions and 5,820 deletions.
4 changes: 2 additions & 2 deletions fbw-a32nx/mach.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ module.exports = {
],
};

function msfsAvionicsInstrument(name, folder = name) {
function msfsAvionicsInstrument(name, index = 'instrument.tsx') {
return {
name,
index: `src/systems/instruments/src/${folder}/instrument.tsx`,
index: `src/systems/instruments/src/${name}/${index}`,
simulatorPackage: {
type: 'baseInstrument',
templateId: `A32NX_${name}`,
Expand Down
5 changes: 3 additions & 2 deletions fbw-a380x/mach.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ module.exports = {
instruments: [
msfsAvionicsInstrument('Clock'),
msfsAvionicsInstrument('EWD'),
msfsAvionicsInstrument('FCU', 'FcuBaseInstrument.ts'),
msfsAvionicsInstrument('MFD'),
msfsAvionicsInstrument('ND'),
msfsAvionicsInstrument('PFD'),
Expand All @@ -44,10 +45,10 @@ module.exports = {
],
};

function msfsAvionicsInstrument(name, folder = name) {
function msfsAvionicsInstrument(name, index = 'instrument.tsx') {
return {
name,
index: `src/systems/instruments/src/${folder}/instrument.tsx`,
index: `src/systems/instruments/src/${name}/${index}`,
simulatorPackage: {
type: 'baseInstrument',
templateId: `A380X_${name}`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@
<ANIMTIP_1>TT:COCKPIT.TOOLTIPS.AUTOPILOT_PANEL_BARO_KNOB_DECREASE</ANIMTIP_1>
<ANIMTIP_1_ON_CURSOR>TurnLeft</ANIMTIP_1_ON_CURSOR>
<BARO_ID>#ID#</BARO_ID>
<MODE_BARO>0</MODE_BARO>
<MODE_QFE>0</MODE_QFE>
<MODE_QNH>1</MODE_QNH>
<MODE_STD_BARO>2</MODE_STD_BARO>
<MODE_STD_QFE>2</MODE_STD_QFE>
<MODE_STD_QNH>3</MODE_STD_QNH>
<NODE_ID>AUTOPILOT_Knob_Baro_#ID##SUFFIX_ID#</NODE_ID>
<PART_ID>AUTOPILOT_Knob_Baro</PART_ID>
Expand All @@ -46,73 +46,41 @@
<Component ID="#NODE_ID#" Node="#NODE_ID#">
<UseTemplate Name="ASOBO_GT_Knob_Infinite_PushPull">
<ANTICLOCKWISE_CODE>
(L:XMLVAR_Baro#BARO_ID#_Mode) #MODE_STD_BARO# != (L:XMLVAR_Baro#BARO_ID#_Mode) #MODE_STD_QNH# != and if{
(L:XMLVAR_Baro#BARO_ID#_Mode) #MODE_STD_QFE# != (L:XMLVAR_Baro#BARO_ID#_Mode) #MODE_STD_QNH# != and if{
(L:XMLVAR_Baro_Selector_HPA_#BARO_ID#) if{
#BARO_ID# (A:KOHLSMAN SETTING MB:1, mbars) -- 16 * (&gt;K:2:KOHLSMAN_SET)
} els{
#BARO_ID# (&gt;K:KOHLSMAN_DEC)
}
} els{
(L:XMLVAR_Baro_Selector_HPA_#BARO_ID#) if{
(L:A380X_EFIS_L_BARO_PRESELECTED) 1 - (&gt;L:A380X_EFIS_L_BARO_PRESELECTED)
} els{
(L:A380X_EFIS_L_BARO_PRESELECTED) 0.01 - (&gt;L:A380X_EFIS_L_BARO_PRESELECTED)
}
(&gt;H:A380X_FCU_BARO_PRESEL_DEC)
}
</ANTICLOCKWISE_CODE>

<CLOCKWISE_CODE>
(L:XMLVAR_Baro#BARO_ID#_Mode) #MODE_STD_BARO# != (L:XMLVAR_Baro#BARO_ID#_Mode) #MODE_STD_QNH# != and if{
(L:XMLVAR_Baro#BARO_ID#_Mode) #MODE_STD_QFE# != (L:XMLVAR_Baro#BARO_ID#_Mode) #MODE_STD_QNH# != and if{
(L:XMLVAR_Baro_Selector_HPA_#BARO_ID#) if{
#BARO_ID# (A:KOHLSMAN SETTING MB:1, mbars) ++ 16 * (&gt;K:2:KOHLSMAN_SET)
} els{
#BARO_ID# (&gt;K:KOHLSMAN_INC)
}
} els{
(L:XMLVAR_Baro_Selector_HPA_#BARO_ID#) if{
(L:A380X_EFIS_L_BARO_PRESELECTED) 1 + (&gt;L:A380X_EFIS_L_BARO_PRESELECTED)
} els{
(L:A380X_EFIS_L_BARO_PRESELECTED) 0.01 + (&gt;L:A380X_EFIS_L_BARO_PRESELECTED)
}
(&gt;H:A380X_FCU_BARO_PRESEL_INC)
}
</CLOCKWISE_CODE>

<PULL_CODE>
(L:XMLVAR_Baro#BARO_ID#_Mode) #MODE_BARO# == if{
#MODE_STD_BARO# (&gt;L:XMLVAR_Baro#BARO_ID#_Mode)
} els{
(L:XMLVAR_Baro#BARO_ID#_Mode) #MODE_QNH# == if{
#MODE_STD_QNH# (&gt;L:XMLVAR_Baro#BARO_ID#_Mode)
(L:XMLVAR_Baro_Selector_HPA_#BARO_ID#) if{
1013.25 (&gt;L:A380X_EFIS_L_BARO_PRESELECTED)
} els{
29.92 (&gt;L:A380X_EFIS_L_BARO_PRESELECTED)
}
}
}
#MODE_STD_QNH# (&gt;L:XMLVAR_Baro#BARO_ID#_Mode)
</PULL_CODE>
<PUSH_CODE>
(L:XMLVAR_Baro#BARO_ID#_Mode) #MODE_STD_BARO# == if{
#MODE_BARO# (&gt;L:XMLVAR_Baro#BARO_ID#_Mode)
} els{
(L:XMLVAR_Baro#BARO_ID#_Mode) #MODE_STD_QNH# == if{
(L:XMLVAR_Baro_Selector_HPA_#BARO_ID#) if{
#BARO_ID# (L:A380X_EFIS_L_BARO_PRESELECTED) 16 * (&gt;K:2:KOHLSMAN_SET)
} els{
#BARO_ID# (L:A380X_EFIS_L_BARO_PRESELECTED) 541.822 * (&gt;K:2:KOHLSMAN_SET)
}
#MODE_QNH# (&gt;L:XMLVAR_Baro#BARO_ID#_Mode)
} els{
(L:XMLVAR_Baro#BARO_ID#_Mode) ! (&gt;L:XMLVAR_Baro#BARO_ID#_Mode)
}
}
#MODE_QNH# (&gt;L:XMLVAR_Baro#BARO_ID#_Mode)
</PUSH_CODE>

<CENTER_RADIUS>0</CENTER_RADIUS>
<COUNT>36</COUNT>
<OVERRIDE_PUSH_ANIM_CODE>
0 100
(L:XMLVAR_Baro#BARO_ID#_Mode) #MODE_STD_BARO# ==
(L:XMLVAR_Baro#BARO_ID#_Mode) #MODE_STD_QFE# ==
(L:XMLVAR_Baro#BARO_ID#_Mode) #MODE_STD_QNH# == or ?
50
(O:_PushAnimVar) ?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ size_mm=5120,5120
pixel_size=5120,5120
texture=$FCU

htmlgauge00=LegacyA380X/FCU/A380_FCU.html, 0,0,5120,5120
htmlgauge00=A380X/FCU/FCU.html, 0,0,5120,5120

[VCockpit10]
size_mm=512,512
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
<!-- Copyright (c) 2023-2024 FlyByWire Simulations -->
<!-- SPDX-License-Identifier: GPL-3.0 -->

<!--TODO: Do we even need this files?`If not it should be removed -->

<PlaneHTMLConfig>

<Instrument>
<Name>A380X_FCU</Name>
<Electric>
<Or>
<Simvar name="L:A32NX_ELEC_DC_ESS_BUS_IS_POWERED" unit="Boolean"/>
<Simvar name="L:A32NX_ELEC_DC_2_BUS_IS_POWERED" unit="Boolean"/>
</Or>
</Electric>
</Instrument>
</PlaneHTMLConfig>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

Loading

0 comments on commit 7c6f3d2

Please sign in to comment.