From 99f96a9035439ff1155742f28a374dee61a18203 Mon Sep 17 00:00:00 2001 From: flogross89 <63071941+flogross89@users.noreply.github.com> Date: Wed, 18 Sep 2024 21:28:17 +0200 Subject: [PATCH] fix(a380x): Various fixes pt.2: MFD, pitch trim switch, EFIS sync for LS button (#8926) * check for valid xpdr code in MFD SURV * fix ILS back course on POSITION/NAVAID * systems-host: enable lint (no functional changes) * disable back course * fix deselect navaid * add PITCH TRIM switch * fix LS EFIS sync * remove debug messages * Revert "systems-host: enable lint (no functional changes)" This reverts commit bc1258d2c870d867ff4642f405c9400d0febca40. * Update fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/POSITION/MfdFmsPositionNavaids.tsx Co-authored-by: Michael Corcoran * don't use min/max for squawk code * pass only positive courses to MMR --------- Co-authored-by: Michael Corcoran --- .../fmgc/src/navigation/NavaidTuner.ts | 8 +- .../FlyByWire_A380_842/model/A380_COCKPIT.xml | 61 +++------- .../behaviour/pedestal/pedestal-inputs.xml | 17 +++ .../FMS/POSITION/MfdFmsPositionNavaids.tsx | 112 +++++++----------- .../src/MFD/pages/common/DataEntryFormats.tsx | 25 ++-- .../providers/FcuBusPublisher.ts | 2 +- .../instruments/src/PFD/HeadingIndicator.tsx | 11 +- .../src/PFD/LandingSystemIndicator.tsx | 10 -- .../src/PFD/shared/PFDSimvarPublisher.tsx | 4 +- .../wasm/fbw_a380/src/FlyByWireInterface.cpp | 17 +-- 10 files changed, 111 insertions(+), 156 deletions(-) diff --git a/fbw-a32nx/src/systems/fmgc/src/navigation/NavaidTuner.ts b/fbw-a32nx/src/systems/fmgc/src/navigation/NavaidTuner.ts index 30fd97109d6..15fe962ff2a 100644 --- a/fbw-a32nx/src/systems/fmgc/src/navigation/NavaidTuner.ts +++ b/fbw-a32nx/src/systems/fmgc/src/navigation/NavaidTuner.ts @@ -621,12 +621,12 @@ export class NavaidTuner { return this.adfTuningStatus.map((adfStatus) => adfStatus.facility).filter((fac) => fac !== undefined); } - deselectNavaid(icao: string): void { - this.navaidSelectionManager.deselectNavaid(icao); + deselectNavaid(databaseId: string): void { + this.navaidSelectionManager.deselectNavaid(databaseId); } - reselectNavaid(icao: string): void { - this.navaidSelectionManager.reselectNavaid(icao); + reselectNavaid(databaseId: string): void { + this.navaidSelectionManager.reselectNavaid(databaseId); } get deselectedNavaids(): string[] { diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/A380_COCKPIT.xml b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/A380_COCKPIT.xml index 5c908d46d8a..099403c8545 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/A380_COCKPIT.xml +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/A380_COCKPIT.xml @@ -106,9 +106,6 @@ (L:A32NX_EFIS_L_ND_MODE) (>L:A380X_EFIS_L_ND_MODE) (L:A32NX_EFIS_R_ND_MODE) (>L:A380X_EFIS_R_ND_MODE) - (L:A380X_EFIS_L_LS_BUTTON_IS_ON) (>L:BTN_LS_1_FILTER_ACTIVE) - (L:A380X_EFIS_R_LS_BUTTON_IS_ON) (>L:BTN_LS_2_FILTER_ACTIVE) - 0 (L:A380X_EFIS_L_ACTIVE_FILTER) 1 == if{ @@ -514,12 +511,6 @@ (L:A32NX_ELEC_DC_1_BUS_IS_POWERED, Bool) - - LEVER_ELEVATORTRIM_DECAL - 85 - (L:A32NX_ELEC_DC_1_BUS_IS_POWERED, Bool) - - pedestal_cables 85 @@ -899,28 +890,6 @@ PUSH_THROTTLE_2 - - lever_trimtab_elevator_key_pct - LEVER_ELEVATORTRIM_1 - LEVER_ELEVATORTRIM_2 - 5 - 20 - -4854 - - - - LEVER_ELEVATORTRIM_DECAL - -4 - 13.5 - -4 - 0 - 13 - 94 - 13.5 - 100 - 2 - - DECAL_THROTTLE_01 85 @@ -1036,8 +1005,8 @@ KNOB_RUDDERTRIM KNOB_RUDDERTRIM - PUSH_RUDDERTRIM_RESET - PUSH_RUDDERTRIM_RESET + PUSH_TRIM_RESET + PUSH_TRIM_RESET @@ -1082,6 +1051,12 @@ AIRLINER TT:COCKPIT.TOOLTIPS.SPEEDBRAKE_LEVER + + + SWITCH_TRIM_PITCH + SWITCH_TRIM_PITCH + 1 + @@ -4543,12 +4518,12 @@ - PUSH_PANELCS_AIDS - L:A32NX_AIDS_PRINT_ON - Print data + PUSH_ACMS_TRIGGER + L:A32NX_ACMS_TRIGGER_ON + ACMS trigger (Inop.) - PUSH_PANELCS_DFDR + PUSH_DFDR_EVENT L:A32NX_DFDR_EVENT_ON Print data (Inop.) @@ -5179,15 +5154,15 @@ - SWITCH_DOORPANEL_LOCK - SWITCH_DOORPANEL_LOCK + LOCK_DOOR_LCKG_SYS + LOCK_DOOR_LCKG_SYS 1 - PUSH_DOORPANEL_OPEN - PUSH_DOORPANEL_OPEN - (L:A32NX_ELEC_AC_2_BUS_IS_POWERED, Bool) - (L:A32NX_ELEC_AC_2_BUS_IS_POWERED, Bool) + PUSH_DOOR_LCKG_SYS + PUSH_DOOR_LCKG_SYS + (L:A32NX_ELEC_DC_1_BUS_IS_POWERED, Bool) + (L:A32NX_ELEC_DC_1_BUS_IS_POWERED, Bool) diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/behaviour/pedestal/pedestal-inputs.xml b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/behaviour/pedestal/pedestal-inputs.xml index e1fe3add2cd..f196bc698ad 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/behaviour/pedestal/pedestal-inputs.xml +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/model/behaviour/pedestal/pedestal-inputs.xml @@ -23,4 +23,21 @@ + + diff --git a/fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/POSITION/MfdFmsPositionNavaids.tsx b/fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/POSITION/MfdFmsPositionNavaids.tsx index 774c25cdaef..d0ef095817e 100644 --- a/fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/POSITION/MfdFmsPositionNavaids.tsx +++ b/fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/POSITION/MfdFmsPositionNavaids.tsx @@ -1,6 +1,7 @@ import { ClockEvents, FSComponent, Subject, VNode } from '@microsoft/msfs-sdk'; import './MfdFmsPositionNavaids.scss'; +import { NavaidSubsectionCode } from '@flybywiresim/fbw-sdk'; import { AbstractMfdPageProps } from 'instruments/src/MFD/MFD'; import { Footer } from 'instruments/src/MFD/pages/common/Footer'; @@ -137,7 +138,9 @@ export class MfdFmsPositionNavaids extends FmsPage { this.deselectedNavaids.forEach((v, i) => { if (this.props.fmcService.master?.navaidTuner.deselectedNavaids[i]) { - v.set(this.props.fmcService.master.navaidTuner.deselectedNavaids[i]); + // FIXME pass full navaid objects to deselected navaids so we can get the ident. + // Taking it from the databaseId is not safe but all we can do for now. + v.set(this.props.fmcService.master.navaidTuner.deselectedNavaids[i].substring(7).trim()); } else { v.set(null); } @@ -150,6 +153,14 @@ export class MfdFmsPositionNavaids extends FmsPage { this.thirdRowIdentRef.instance.style.visibility = mmr.ident ? 'visible' : 'hidden'; } + private async parseNavaid(navaid: string, onlyVor = false) { + const navaids = await (onlyVor + ? NavigationDatabaseService.activeDatabase.searchVor(navaid) + : NavigationDatabaseService.activeDatabase.searchAllNavaid(navaid)); + + return this.props.mfd.deduplicateFacilities(navaids); + } + private deselectGlide() { // TODO } @@ -163,21 +174,21 @@ export class MfdFmsPositionNavaids extends FmsPage { this.props.fmcService.master?.addMessageToQueue(NXSystemMessages.notAllowed, undefined, undefined); } } else { - const navaids = await NavigationDatabaseService.activeDatabase.searchVor(ident); - // FIXME need to handle duplicate navaids and pilot navaid page if no result - if (navaids.length > 0) { + const navaid = await this.parseNavaid(ident, true); + + if (navaid && navaid.subSectionCode === NavaidSubsectionCode.VhfNavaid) { if ( this.props.fmcService.master?.navaidTuner.deselectedNavaids.find( - (databaseId) => databaseId === navaids[0].databaseId, + (databaseId) => databaseId === navaid.databaseId, ) ) { this.props.fmcService.master.addMessageToQueue( - NXSystemMessages.xxxIsDeselected.getModifiedMessage(navaids[0].ident), + NXSystemMessages.xxxIsDeselected.getModifiedMessage(navaid.ident), undefined, undefined, ); } else { - this.props.fmcService.master?.navaidTuner.setManualVor(index, navaids[0]); + this.props.fmcService.master?.navaidTuner.setManualVor(index, navaid); } } } @@ -212,9 +223,9 @@ export class MfdFmsPositionNavaids extends FmsPage { } } else { const ils = await NavigationDatabaseService.activeDatabase.backendDatabase.getILSs([ident]); - // FIXME need to handle duplicate navaids and pilot navaid page if no result - if (ils.length > 0) { - await this.props.fmcService.master?.navaidTuner.setManualIls(ils[0]); + const deduplicatedIls = await this.props.mfd.deduplicateFacilities(ils); + if (deduplicatedIls) { + await this.props.fmcService.master?.navaidTuner.setManualIls(deduplicatedIls); } } this.onNewData(); @@ -234,6 +245,21 @@ export class MfdFmsPositionNavaids extends FmsPage { this.onNewData(); } + async deselectionHandler(nV: string | null, oV: string | null | undefined) { + if (nV) { + const navaid = await this.parseNavaid(nV); + if (navaid) { + this.props.fmcService.master?.navaidTuner.deselectNavaid(navaid.databaseId); + } + } else if (oV) { + const navaid = await this.parseNavaid(oV); + if (navaid) { + this.props.fmcService.master?.navaidTuner.reselectNavaid(navaid.databaseId); + } + } + this.onNewData(); + } + public onAfterRender(node: VNode): void { super.onAfterRender(node); @@ -424,17 +450,8 @@ export class MfdFmsPositionNavaids extends FmsPage {
- // FIXME all these need to handle duplicate names, and actually validate the navaid exists dataEntryFormat={new NavaidIdentFormat('-')} - dataHandlerDuringValidation={async (nV, oV) => { - // FIXME these functions require a databaseId to uniquely id the navaid, not an ident - if (nV) { - this.props.fmcService.master?.navaidTuner.deselectNavaid(nV); - } else if (oV) { - this.props.fmcService.master?.navaidTuner.reselectNavaid(oV); - } - this.onNewData(); - }} + dataHandlerDuringValidation={this.deselectionHandler.bind(this)} value={this.deselectedNavaids[0]} alignText="center" errorHandler={(e) => this.props.fmcService.master?.showFmsErrorMessage(e)} @@ -445,15 +462,7 @@ export class MfdFmsPositionNavaids extends FmsPage {
dataEntryFormat={new NavaidIdentFormat('-')} - dataHandlerDuringValidation={async (nV, oV) => { - // FIXME these functions require a databaseId to uniquely id the navaid, not an ident - if (nV) { - this.props.fmcService.master?.navaidTuner.deselectNavaid(nV); - } else if (oV) { - this.props.fmcService.master?.navaidTuner.reselectNavaid(oV); - } - this.onNewData(); - }} + dataHandlerDuringValidation={this.deselectionHandler.bind(this)} value={this.deselectedNavaids[1]} alignText="center" disabled={this.deselectedNavaids[0].map((it) => it === null)} @@ -465,15 +474,7 @@ export class MfdFmsPositionNavaids extends FmsPage {
dataEntryFormat={new NavaidIdentFormat('-')} - dataHandlerDuringValidation={async (nV, oV) => { - // FIXME these functions require a databaseId to uniquely id the navaid, not an ident - if (nV) { - this.props.fmcService.master?.navaidTuner.deselectNavaid(nV); - } else if (oV) { - this.props.fmcService.master?.navaidTuner.reselectNavaid(oV); - } - this.onNewData(); - }} + dataHandlerDuringValidation={this.deselectionHandler.bind(this)} value={this.deselectedNavaids[2]} alignText="center" disabled={this.deselectedNavaids[1].map((it) => it === null)} @@ -487,15 +488,7 @@ export class MfdFmsPositionNavaids extends FmsPage {
dataEntryFormat={new NavaidIdentFormat('-')} - dataHandlerDuringValidation={async (nV, oV) => { - // FIXME these functions require a databaseId to uniquely id the navaid, not an ident - if (nV) { - this.props.fmcService.master?.navaidTuner.deselectNavaid(nV); - } else if (oV) { - this.props.fmcService.master?.navaidTuner.reselectNavaid(oV); - } - this.onNewData(); - }} + dataHandlerDuringValidation={this.deselectionHandler.bind(this)} value={this.deselectedNavaids[3]} alignText="center" disabled={this.deselectedNavaids[2].map((it) => it === null)} @@ -507,15 +500,7 @@ export class MfdFmsPositionNavaids extends FmsPage {
dataEntryFormat={new NavaidIdentFormat('-')} - dataHandlerDuringValidation={async (nV, oV) => { - // FIXME these functions require a databaseId to uniquely id the navaid, not an ident - if (nV) { - this.props.fmcService.master?.navaidTuner.deselectNavaid(nV); - } else if (oV) { - this.props.fmcService.master?.navaidTuner.reselectNavaid(oV); - } - this.onNewData(); - }} + dataHandlerDuringValidation={this.deselectionHandler.bind(this)} value={this.deselectedNavaids[4]} alignText="center" disabled={this.deselectedNavaids[3].map((it) => it === null)} @@ -527,15 +512,7 @@ export class MfdFmsPositionNavaids extends FmsPage {
dataEntryFormat={new NavaidIdentFormat('-')} - dataHandlerDuringValidation={async (nV, oV) => { - // FIXME these functions require a databaseId to uniquely id the navaid, not an ident - if (nV) { - this.props.fmcService.master?.navaidTuner.deselectNavaid(nV); - } else if (oV) { - this.props.fmcService.master?.navaidTuner.reselectNavaid(oV); - } - this.onNewData(); - }} + dataHandlerDuringValidation={this.deselectionHandler.bind(this)} value={this.deselectedNavaids[5]} alignText="center" disabled={this.deselectedNavaids[4].map((it) => it === null)} @@ -590,7 +567,10 @@ export class MfdFmsPositionNavaids extends FmsPage { dataEntryFormat={new LsCourseFormat()} dataHandlerDuringValidation={async (v) => { - this.props.fmcService.master?.navaidTuner.setIlsCourse(v || null); + this.props.fmcService.master?.navaidTuner.setIlsCourse( + v !== null ? Math.abs(v) : null, + v && v < 0 ? true : false, + ); }} mandatory={Subject.create(false)} enteredByPilot={this.lsCourseEnteredByPilot} diff --git a/fbw-a380x/src/systems/instruments/src/MFD/pages/common/DataEntryFormats.tsx b/fbw-a380x/src/systems/instruments/src/MFD/pages/common/DataEntryFormats.tsx index 7e0fc3b7dc4..9f4f3aa5417 100644 --- a/fbw-a380x/src/systems/instruments/src/MFD/pages/common/DataEntryFormats.tsx +++ b/fbw-a380x/src/systems/instruments/src/MFD/pages/common/DataEntryFormats.tsx @@ -1349,12 +1349,13 @@ export class FrequencyADFFormat implements DataEntryFormat { } // Still need to find a way to store whether course is true or magnetic +/** Negative number indicates back course */ export class LsCourseFormat implements DataEntryFormat { public placeholder = '----'; public maxDigits = 4; - private minValue = 0; + private minValue = -360; private maxValue = 360.0; @@ -1362,7 +1363,7 @@ export class LsCourseFormat implements DataEntryFormat { if (value === null || value === undefined) { return [this.placeholder, null, '°'] as FieldFormatTuple; } - return [`F${value.toFixed(0).padStart(3, '0')}`, null, '°'] as FieldFormatTuple; + return [`${value < 0 ? 'B' : 'F'}${Math.abs(value).toFixed(0).padStart(3, '0')}`, null, '°'] as FieldFormatTuple; } public async parse(input: string) { @@ -1371,16 +1372,22 @@ export class LsCourseFormat implements DataEntryFormat { } let numberPart = input; + let sign = +1; if (input.length === 4) { if (input[0] === 'F' || input[0] === 'B') { - numberPart = input.substring(1, 3); + sign = input[0] === 'B' ? -1 : +1; + numberPart = input.substring(1, 4); } else { - numberPart = input.substring(0, 2); + numberPart = input.substring(0, 3); } } + + // FIXME Delete next line as soon as back course is implemented + if (input[0] === 'B') throw new FmsError(FmsErrorType.FormatError); + const nbr = Number(numberPart); if (!Number.isNaN(nbr) && nbr <= this.maxValue && nbr >= this.minValue) { - return nbr; + return sign * nbr; } if (nbr > this.maxValue || nbr < this.minValue) { throw new FmsError(FmsErrorType.EntryOutOfRange); @@ -1395,10 +1402,6 @@ export class SquawkFormat implements DataEntryFormat { public maxDigits = 4; - private minValue = 0; - - private maxValue = 7777; - public format(value: number) { if (value === null || value === undefined) { return [this.placeholder, null, null] as FieldFormatTuple; @@ -1412,10 +1415,10 @@ export class SquawkFormat implements DataEntryFormat { } const nbr = Number(input); - if (!Number.isNaN(nbr) && nbr <= this.maxValue && nbr >= this.minValue) { + if (!Number.isNaN(nbr) && /^[0-7]{4}$/.test(input)) { return nbr; } - if (nbr > this.maxValue || nbr < this.minValue) { + if (!/^[0-7]{4}$/.test(input)) { throw new FmsError(FmsErrorType.EntryOutOfRange); } else { throw new FmsError(FmsErrorType.FormatError); diff --git a/fbw-a380x/src/systems/instruments/src/MsfsAvionicsCommon/providers/FcuBusPublisher.ts b/fbw-a380x/src/systems/instruments/src/MsfsAvionicsCommon/providers/FcuBusPublisher.ts index d68d8eedda4..8f10f647029 100644 --- a/fbw-a380x/src/systems/instruments/src/MsfsAvionicsCommon/providers/FcuBusPublisher.ts +++ b/fbw-a380x/src/systems/instruments/src/MsfsAvionicsCommon/providers/FcuBusPublisher.ts @@ -23,7 +23,7 @@ export class FcuBusPublisher extends SimVarPublisher { ['option', { name: `L:A32NX_EFIS_${efisSide}_OPTION`, type: SimVarValueType.Enum }], ['navaidMode1', { name: `L:A32NX_EFIS_${efisSide}_NAVAID_1_MODE`, type: SimVarValueType.Enum }], ['navaidMode2', { name: `L:A32NX_EFIS_${efisSide}_NAVAID_2_MODE`, type: SimVarValueType.Enum }], - ['efisLsActive', { name: `L:BTN_LS_${efisSide === 'L' ? 1 : 2}_FILTER_ACTIVE`, type: SimVarValueType.Bool }], + ['efisLsActive', { name: `L:A380X_EFIS_${efisSide}_LS_BUTTON_IS_ON`, type: SimVarValueType.Bool }], ['oansRange', { name: `L:A32NX_EFIS_${efisSide}_OANS_RANGE`, type: SimVarValueType.Number }], ]), bus); } diff --git a/fbw-a380x/src/systems/instruments/src/PFD/HeadingIndicator.tsx b/fbw-a380x/src/systems/instruments/src/PFD/HeadingIndicator.tsx index 70ad18242c8..ad1e48bf62b 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/HeadingIndicator.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/HeadingIndicator.tsx @@ -82,11 +82,12 @@ export class HeadingOfftape extends DisplayComponent<{ bus: EventBus; failed: Su this.ILSCourse.set(n); }); - sub.on('hEvent').handle((eventName) => { - if (eventName === `A320_Neo_PFD_BTN_LS_${getDisplayIndex()}`) { - this.lsPressed.set(!this.lsPressed.get()); - } - }); + sub + .on(getDisplayIndex() === 1 ? 'ls1Button' : 'ls2Button') + .whenChanged() + .handle((lsButton) => { + this.lsPressed.set(lsButton); + }); } render(): VNode { diff --git a/fbw-a380x/src/systems/instruments/src/PFD/LandingSystemIndicator.tsx b/fbw-a380x/src/systems/instruments/src/PFD/LandingSystemIndicator.tsx index 1e5d0fb8983..ffb26b26731 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/LandingSystemIndicator.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/LandingSystemIndicator.tsx @@ -46,16 +46,6 @@ export class LandingSystem extends DisplayComponent<{ bus: EventBus; instrument: const sub = this.props.bus.getSubscriber(); - sub.on('hEvent').handle((eventName) => { - if (eventName === `A320_Neo_PFD_BTN_LS_${getDisplayIndex()}`) { - this.lsButtonPressedVisibility = !this.lsButtonPressedVisibility; - SimVar.SetSimVarValue(`L:BTN_LS_${getDisplayIndex()}_FILTER_ACTIVE`, 'Bool', this.lsButtonPressedVisibility); - - this.lsGroupRef.instance.style.display = this.lsButtonPressedVisibility ? 'inline' : 'none'; - this.handleGsReferenceLine(); - } - }); - sub .on(getDisplayIndex() === 1 ? 'ls1Button' : 'ls2Button') .whenChanged() diff --git a/fbw-a380x/src/systems/instruments/src/PFD/shared/PFDSimvarPublisher.tsx b/fbw-a380x/src/systems/instruments/src/PFD/shared/PFDSimvarPublisher.tsx index 5345e40a055..d920b909ac2 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/shared/PFDSimvarPublisher.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/shared/PFDSimvarPublisher.tsx @@ -278,8 +278,8 @@ export enum PFDVars { autoBrakeDecel = 'L:A32NX_AUTOBRAKES_DECEL_LIGHT', fpaRaw = 'L:A32NX_ADIRS_IR_1_FLIGHT_PATH_ANGLE', daRaw = 'L:A32NX_ADIRS_IR_1_DRIFT_ANGLE', - ls1Button = 'L:BTN_LS_1_FILTER_ACTIVE', - ls2Button = 'L:BTN_LS_2_FILTER_ACTIVE', + ls1Button = 'L:A380X_EFIS_L_LS_BUTTON_IS_ON', + ls2Button = 'L:A380X_EFIS_R_LS_BUTTON_IS_ON', xtk = 'L:A32NX_FG_CROSS_TRACK_ERROR', ldevLeft = 'L:A32NX_FMGC_L_LDEV_REQUEST', ldevRight = 'L:A32NX_FMGC_R_LDEV_REQUEST', diff --git a/fbw-a380x/src/wasm/fbw_a380/src/FlyByWireInterface.cpp b/fbw-a380x/src/wasm/fbw_a380/src/FlyByWireInterface.cpp index e6e92d3fd1a..5dfa6ff6ae8 100644 --- a/fbw-a380x/src/wasm/fbw_a380/src/FlyByWireInterface.cpp +++ b/fbw-a380x/src/wasm/fbw_a380/src/FlyByWireInterface.cpp @@ -508,8 +508,8 @@ void FlyByWireInterface::setupLocalVariables() { idSyncFoEfisEnabled = std::make_unique("A32NX_FO_SYNC_EFIS_ENABLED"); - idLs1Active = std::make_unique("BTN_LS_1_FILTER_ACTIVE"); - idLs2Active = std::make_unique("BTN_LS_2_FILTER_ACTIVE"); + idLs1Active = std::make_unique("A380X_EFIS_L_LS_BUTTON_IS_ON"); + idLs2Active = std::make_unique("A380X_EFIS_R_LS_BUTTON_IS_ON"); idIsisLsActive = std::make_unique("A32NX_ISIS_LS_ACTIVE"); idWingAntiIce = std::make_unique("A32NX_PNEU_WING_ANTI_ICE_SYSTEM_ON"); @@ -2861,18 +2861,7 @@ bool FlyByWireInterface::updateFoSide(double sampleTime) { // get sim data auto simData = simConnectInterface.getSimData(); - // FD Button - if (additionalData.syncFoEfisEnabled && simData.ap_fd_1_active != simData.ap_fd_2_active) { - if (last_fd1_active != simData.ap_fd_1_active) { - simConnectInterface.sendEvent(SimConnectInterface::Events::TOGGLE_FLIGHT_DIRECTOR, 2); - } - - if (last_fd2_active != simData.ap_fd_2_active) { - simConnectInterface.sendEvent(SimConnectInterface::Events::TOGGLE_FLIGHT_DIRECTOR, 1); - } - } - last_fd1_active = simData.ap_fd_1_active; - last_fd2_active = simData.ap_fd_2_active; + // Only one FD state, no sync needed // LS Button if (additionalData.syncFoEfisEnabled && additionalData.ls1Active != additionalData.ls2Active) {