From d65903972424b550a4114648291245c9951eaa79 Mon Sep 17 00:00:00 2001 From: lukecologne Date: Wed, 27 Nov 2024 18:48:11 +0100 Subject: [PATCH 01/14] fix(fcu): add leading zero below 1000hPa (#9596) --- .../src/systems/instruments/src/FCU/Components/EisDisplay.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fbw-a32nx/src/systems/instruments/src/FCU/Components/EisDisplay.tsx b/fbw-a32nx/src/systems/instruments/src/FCU/Components/EisDisplay.tsx index ec6f1b9eefe..ff887e6f80b 100644 --- a/fbw-a32nx/src/systems/instruments/src/FCU/Components/EisDisplay.tsx +++ b/fbw-a32nx/src/systems/instruments/src/FCU/Components/EisDisplay.tsx @@ -33,7 +33,7 @@ export class EisDisplay extends DisplayComponent { } else if (baroValueMode === 0) { return 'Std'; } else if (baroValueMode === 1) { - return Math.round(baroValue).toString(); + return Math.round(baroValue).toString().padStart(4, '0'); } else { return baroValue.toFixed(2); } From d3d60f9889b7dbf0836fce2b872c70f34badb7d7 Mon Sep 17 00:00:00 2001 From: Michael Corcoran Date: Thu, 28 Nov 2024 13:12:24 +1300 Subject: [PATCH 02/14] fix(a32nx/fcu): the lcd display is now visible with the backlight off (#9549) * feat(shared): start msfs aircraft system publisher * feat(a32nx/fcu): lcd is visible with backlight off * docs: changelog * feat: shared a32nx elec publisher * feat(fcu): backlight powered separately * fix: fcu healthy rather than dc --------- Co-authored-by: lukecologne --- .github/CHANGELOG.md | 1 + .../model/A320_NEO_INTERIOR.xml | 17 ++- .../src/systems/instruments/src/FCU/FCU.tsx | 33 ++++-- .../systems/instruments/src/FCU/config.json | 5 +- .../instruments/src/FCU/instrument.tsx | 70 +++++------ .../A32NXElectricalSystemPublisher.ts | 111 ++++++++++++++++++ .../Msfs/MsfsAircraftSystemPublisher.ts | 49 ++++++++ .../Msfs/MsfsRadioNavigationPublisher.ts | 4 +- .../shared/src/publishers/Msfs/index.ts | 1 + 9 files changed, 236 insertions(+), 55 deletions(-) create mode 100644 fbw-a32nx/src/systems/shared/src/publishers/A32NXElectricalSystemPublisher.ts create mode 100644 fbw-common/src/systems/shared/src/publishers/Msfs/MsfsAircraftSystemPublisher.ts diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 0fee134c9a5..025db3e51e9 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -72,6 +72,7 @@ 1. [FMS] Fix Pause at T/D not working in selected speed - @BlueberryKing (BlueberryKing) 1. [MISC] Replaced brake temperature simulation with physics based model of brakes - @Gurgel100 (Pascal) 1. [A32NX/MCDU] Suppress TMPY FPLN when no modifications made in airways page - @robertxing2004 (robeet) +1. [A32NX/FCU] The FCU LCD is now still visible with ambient light when the backlight is off @tracernz (Mike) 1. [A380X/FMC] Fix reset of perf data on done phase or database swap - @tracernz (Mike) 1. [A32NX/ATC] Fixed ATC/TCAS power supply - @tracernz (Mike) 1. [A32NX] Fixed appearance of FCU decals on MSFS2024 - @tracernz (Mike) diff --git a/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/model/A320_NEO_INTERIOR.xml b/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/model/A320_NEO_INTERIOR.xml index 2616c853d82..31839d0d653 100644 --- a/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/model/A320_NEO_INTERIOR.xml +++ b/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/model/A320_NEO_INTERIOR.xml @@ -360,12 +360,17 @@ 87 - - SCREEN_AUTOPILOT - 87 - - (L:A32NX_ELEC_AC_1_BUS_IS_POWERED, Bool) - + + + + + (L:A32NX_AMBIENT_BRIGHTNESS) * 0.05 * 0.01 max + (L:A32NX_ELEC_AC_1_BUS_IS_POWERED, Bool) if{ + (A:LIGHT POTENTIOMETER:87, percent over 100) max + } + + + PA diff --git a/fbw-a32nx/src/systems/instruments/src/FCU/FCU.tsx b/fbw-a32nx/src/systems/instruments/src/FCU/FCU.tsx index f3e7dea73e4..99f23f7c0b8 100644 --- a/fbw-a32nx/src/systems/instruments/src/FCU/FCU.tsx +++ b/fbw-a32nx/src/systems/instruments/src/FCU/FCU.tsx @@ -9,31 +9,42 @@ import { } from '@microsoft/msfs-sdk'; import { EisDisplay } from 'instruments/src/FCU/Components/EisDisplay'; import { AfsDisplay } from 'instruments/src/FCU/Components/AfsDisplay'; +import { FcuSimvars } from 'instruments/src/FCU/shared/FcuSimvarPublisher'; +import { A32NXElectricalSystemEvents } from '../../../shared/src/publishers/A32NXElectricalSystemPublisher'; import './style.scss'; -import { FcuSimvars } from 'instruments/src/FCU/shared/FcuSimvarPublisher'; interface FCUProps extends ComponentProps { bus: EventBus; } export class FCUComponent extends DisplayComponent { - private fcuHealthy = ConsumerSubject.create(null, false); + private readonly sub = this.props.bus.getSubscriber(); - onAfterRender(node: VNode): void { - super.onAfterRender(node); + private readonly fcuHealthy = ConsumerSubject.create(this.sub.on('fcuHealthy'), false); - const sub = this.props.bus.getSubscriber(); - - this.fcuHealthy.setConsumer(sub.on('fcuHealthy')); - } + private readonly isBacklightPowered = ConsumerSubject.create(this.sub.on('a32nx_elec_ac_1_bus_is_powered'), false); render(): VNode { return ( <> - - - + + + diff --git a/fbw-a32nx/src/systems/instruments/src/FCU/config.json b/fbw-a32nx/src/systems/instruments/src/FCU/config.json index ade492578f8..be499b65dcb 100644 --- a/fbw-a32nx/src/systems/instruments/src/FCU/config.json +++ b/fbw-a32nx/src/systems/instruments/src/FCU/config.json @@ -1,4 +1,7 @@ { "index": "./instrument.tsx", - "isInteractive": false + "isInteractive": false, + "extraDeps": [ + "../../../shared/src/publishers" + ] } diff --git a/fbw-a32nx/src/systems/instruments/src/FCU/instrument.tsx b/fbw-a32nx/src/systems/instruments/src/FCU/instrument.tsx index 7c03f5ca8c6..faab26eaddb 100644 --- a/fbw-a32nx/src/systems/instruments/src/FCU/instrument.tsx +++ b/fbw-a32nx/src/systems/instruments/src/FCU/instrument.tsx @@ -1,47 +1,52 @@ -import { EventBus, FSComponent, Subject } from '@microsoft/msfs-sdk'; +// Copyright (c) 2024 FlyByWire Simulations +// SPDX-License-Identifier: GPL-3.0 + +import { ConsumerSubject, EventBus, FSComponent, InstrumentBackplane, Subject } from '@microsoft/msfs-sdk'; import { FCUSimvarPublisher } from './shared/FcuSimvarPublisher'; import { FCUComponent } from './FCU'; import { calculateSunAzimuthElevation, lerp, calculateAmbientBrightness } from './SunAngle'; +import { MsfsAircraftSystemEvents, MsfsAircraftSystemPublisher } from '@flybywiresim/fbw-sdk'; +import { + A32NXElectricalSystemEvents, + A32NXElectricalSystemPublisher, +} from '../../../shared/src/publishers/A32NXElectricalSystemPublisher'; // eslint-disable-next-line camelcase class A32NX_FCU extends BaseInstrument { - private bus: EventBus; + private readonly bus = new EventBus(); + private readonly backplane = new InstrumentBackplane(); - private simVarPublisher: FCUSimvarPublisher; + private sub = this.bus.getSubscriber(); - /** - * "mainmenu" = 0 - * "loading" = 1 - * "briefing" = 2 - * "ingame" = 3 - */ - private gameState = 0; + private readonly simVarPublisher = new FCUSimvarPublisher(this.bus); + private readonly msfsAircraftSystemPublisher = new MsfsAircraftSystemPublisher(this.bus); + private readonly a32nxElecSystemPublisher = new A32NXElectricalSystemPublisher(this.bus); private simTime = new Date(); private solarParams = calculateSunAzimuthElevation(this.simTime, 0, 0); - private ambientBrightness = Subject.create(0, (a, b) => Math.abs(a - b) < 0.01); + private readonly ambientBrightness = Subject.create(0, (a, b) => Math.abs(a - b) < 0.01); + + private readonly backlightBrightness = ConsumerSubject.create(this.sub.on('msfs_light_potentiometer_87'), 0); - private screenBrightess = Subject.create(0, (a, b) => Math.abs(a - b) < 0.01); + private readonly isBacklightPowered = ConsumerSubject.create(this.sub.on('a32nx_elec_ac_1_bus_is_powered'), false); constructor() { super(); - this.bus = new EventBus(); - this.simVarPublisher = new FCUSimvarPublisher(this.bus); + + this.backplane.addPublisher('SimVarPublisher', this.simVarPublisher); + this.backplane.addPublisher('MsfsAircraftSystem', this.msfsAircraftSystemPublisher); + this.backplane.addPublisher('A32NXElectricalSystemPublisher', this.a32nxElecSystemPublisher); this.ambientBrightness.sub((ambientBrightness) => { SimVar.SetSimVarValue('L:A32NX_AMBIENT_BRIGHTNESS', 'number', ambientBrightness); this.updateDisplayBrightness(); }); - this.screenBrightess.sub(this.updateDisplayBrightness.bind(this), true); - - // need to run this at high speed to avoid jumps when the knob is rotated - setInterval(() => { - const screenBrightess = SimVar.GetSimVarValue('A:LIGHT POTENTIOMETER:87', 'percent over 100'); - this.screenBrightess.set(screenBrightess); - }); + const updateDisplayBrightness = this.updateDisplayBrightness.bind(this); + this.isBacklightPowered.sub(updateDisplayBrightness); + this.backlightBrightness.sub(updateDisplayBrightness, true); } get templateID(): string { @@ -50,18 +55,19 @@ class A32NX_FCU extends BaseInstrument { private updateDisplayBrightness() { const ambientBrightness = this.ambientBrightness.get(); - const screenBrightess = this.screenBrightess.get(); + const backlightBrightness = this.isBacklightPowered.get() ? this.backlightBrightness.get() : 0; - const saturation = lerp(ambientBrightness * (1.05 - screenBrightess), 1, 0.6, 10, 100); - const luminosity = lerp(ambientBrightness * (1.05 - screenBrightess), 1, 0.6, 80, 55); + const saturation = + backlightBrightness > 0 ? lerp(ambientBrightness * (1.05 - backlightBrightness), 1, 0.6, 0, 100) : 0; + const luminosity = lerp(ambientBrightness * (1.05 - backlightBrightness), 1, 0.6, 80, 55); const colour = `hsl(31, ${saturation.toFixed(1)}%, ${luminosity.toFixed(1)}%)`; document.documentElement.style.setProperty('--main-display-colour', colour); - const textShadowOpacity = lerp(screenBrightess, 0, 1, 0, 0.3) * lerp(ambientBrightness, 0, 0.9, 1, 0); + const textShadowOpacity = lerp(backlightBrightness, 0, 1, 0, 0.3) * lerp(ambientBrightness, 0, 0.9, 1, 0); const textShadow = `rgba(207, 110, 0, ${textShadowOpacity.toFixed(2)})`; document.documentElement.style.setProperty('--main-text-shadow-colour', textShadow); - const backgroundOpacity = lerp(screenBrightess, 0, 1, 0, 0.3) * lerp(ambientBrightness, 0, 0.8, 1, 0.1); + const backgroundOpacity = lerp(backlightBrightness, 0, 1, 0, 0.3) * lerp(ambientBrightness, 0, 0.8, 1, 0.1); document.documentElement.style.setProperty('--main-background-opacity', backgroundOpacity.toString()); } @@ -72,20 +78,14 @@ class A32NX_FCU extends BaseInstrument { // Remove "instrument didn't load" text document.getElementById('FCU_CONTENT').querySelector(':scope > h1').remove(); + + this.backplane.init(); } public Update(): void { super.Update(); - if (this.gameState !== 3) { - const gamestate = this.getGameState(); - if (gamestate === 3) { - this.simVarPublisher.startPublish(); - } - this.gameState = gamestate; - } else { - this.simVarPublisher.onUpdate(); - } + this.backplane.onUpdate(); const lat = SimVar.GetSimVarValue('PLANE LATITUDE', 'degrees'); const lon = SimVar.GetSimVarValue('PLANE LONGITUDE', 'degrees'); diff --git a/fbw-a32nx/src/systems/shared/src/publishers/A32NXElectricalSystemPublisher.ts b/fbw-a32nx/src/systems/shared/src/publishers/A32NXElectricalSystemPublisher.ts new file mode 100644 index 00000000000..b33ef2e64d6 --- /dev/null +++ b/fbw-a32nx/src/systems/shared/src/publishers/A32NXElectricalSystemPublisher.ts @@ -0,0 +1,111 @@ +import { + EventBus, + IndexedEventType, + PublishPacer, + SimVarPublisher, + SimVarPublisherEntry, + SimVarValueType, +} from '@microsoft/msfs-sdk'; + +interface A32NXElectricalSystemBaseEvents { + /** Whether AC bus 1 is currently connected to a supply. */ + a32nx_elec_ac_1_bus_is_powered: boolean; + /** Whether AC bus 2 is currently connected to a supply. */ + a32nx_elec_ac_2_bus_is_powered: boolean; + /** Whether AC ESS bus is currently connected to a supply. */ + a32nx_elec_ac_ess_bus_is_powered: boolean; + /** Whether sheddable AC ESS bus is currently connected to a supply. */ + a32nx_elec_ac_ess_shed_bus_is_powered: boolean; + /** Whether AC static inverter bus is currently connected to a supply. */ + a32nx_elec_ac_stat_inv_bus_is_powered: boolean; + /** Whether AC ground service bus is currently connected to a supply. */ + a32nx_elec_ac_gnd_flt_svc_is_powered: boolean; + /** Whether DC bus 1 is currently connected to a supply. */ + a32nx_elec_dc_1_bus_is_powered: boolean; + /** Whether DC bus 2 is currently connected to a supply. */ + a32nx_elec_dc_2_bus_is_powered: boolean; + /** Whether DC ESS bus is currently connected to a supply. */ + a32nx_elec_dc_ess_bus_is_powered: boolean; + /** Whether sheddable DC ESS bus is currently connected to a supply. */ + a32nx_elec_dc_ess_shed_bus_is_powered: boolean; + /** Whether DC common battery bus is currently connected to a supply. */ + a32nx_elec_dc_batt_bus_is_powered: boolean; + /** Whether DC battery 1 hot bus is currently connected to a supply. */ + a32nx_elec_dc_hot_1_bus_is_powered: boolean; + /** Whether DC battery 2 hot bus is currently connected to a supply. */ + a32nx_elec_dc_hot_2_bus_is_powered: boolean; + /** Whether DC ground service bus bus is currently connected to a supply. */ + a32nx_elec_dc_gnd_flt_svc_bus_is_powered: boolean; +} + +type IndexedTopics = never; + +type A32NXElectricalSystemIndexedEvents = { + [P in keyof Pick< + A32NXElectricalSystemBaseEvents, + IndexedTopics + > as IndexedEventType

]: A32NXElectricalSystemBaseEvents[P]; +}; + +/** + * Events for A32NX electrical system local vars. + * Event names are the same as the local var names (including a32nx_elec_ prefix). + */ +export interface A32NXElectricalSystemEvents + extends A32NXElectricalSystemBaseEvents, + A32NXElectricalSystemIndexedEvents {} + +/** + * Publisher for A32NX electrical system local vars. + */ +export class A32NXElectricalSystemPublisher extends SimVarPublisher { + /** + * Create a publisher. + * @param bus The EventBus to publish to + * @param pacer An optional pacer to use to control the rate of publishing + */ + public constructor(bus: EventBus, pacer?: PublishPacer) { + const simvars = new Map>([ + ['a32nx_elec_ac_1_bus_is_powered', { name: 'L:A32NX_ELEC_AC_1_BUS_IS_POWERED', type: SimVarValueType.Bool }], + ['a32nx_elec_ac_2_bus_is_powered', { name: 'L:A32NX_ELEC_AC_2_BUS_IS_POWERED', type: SimVarValueType.Bool }], + ['a32nx_elec_ac_ess_bus_is_powered', { name: 'L:A32NX_ELEC_AC_ESS_BUS_IS_POWERED', type: SimVarValueType.Bool }], + [ + 'a32nx_elec_ac_ess_shed_bus_is_powered', + { name: 'L:A32NX_ELEC_AC_ESS_SHED_BUS_IS_POWERED', type: SimVarValueType.Bool }, + ], + [ + 'a32nx_elec_ac_stat_inv_bus_is_powered', + { name: 'L:A32NX_ELEC_AC_STAT_INV_BUS_IS_POWERED', type: SimVarValueType.Bool }, + ], + [ + 'a32nx_elec_ac_gnd_flt_svc_is_powered', + { name: 'L:A32NX_ELEC_AC_GND_FLT_SVC_BUS_IS_POWERED', type: SimVarValueType.Bool }, + ], + ['a32nx_elec_dc_1_bus_is_powered', { name: 'L:A32NX_ELEC_DC_1_BUS_IS_POWERED', type: SimVarValueType.Bool }], + ['a32nx_elec_dc_2_bus_is_powered', { name: 'L:A32NX_ELEC_DC_2_BUS_IS_POWERED', type: SimVarValueType.Bool }], + ['a32nx_elec_dc_ess_bus_is_powered', { name: 'L:A32NX_ELEC_DC_ESS_BUS_IS_POWERED', type: SimVarValueType.Bool }], + [ + 'a32nx_elec_dc_ess_shed_bus_is_powered', + { name: 'L:A32NX_ELEC_DC_ESS_SHED_BUS_IS_POWERED', type: SimVarValueType.Bool }, + ], + [ + 'a32nx_elec_dc_batt_bus_is_powered', + { name: 'L:A32NX_ELEC_DC_BATT_BUS_IS_POWERED', type: SimVarValueType.Bool }, + ], + [ + 'a32nx_elec_dc_hot_1_bus_is_powered', + { name: 'L:A32NX_ELEC_DC_HOT_1_BUS_IS_POWERED', type: SimVarValueType.Bool }, + ], + [ + 'a32nx_elec_dc_hot_2_bus_is_powered', + { name: 'L:A32NX_ELEC_DC_HOT_2_BUS_IS_POWERED', type: SimVarValueType.Bool }, + ], + [ + 'a32nx_elec_dc_gnd_flt_svc_bus_is_powered', + { name: 'L:A32NX_ELEC_DC_GND_FLT_SVC_BUS_IS_POWERED', type: SimVarValueType.Bool }, + ], + ]); + + super(simvars, bus, pacer); + } +} diff --git a/fbw-common/src/systems/shared/src/publishers/Msfs/MsfsAircraftSystemPublisher.ts b/fbw-common/src/systems/shared/src/publishers/Msfs/MsfsAircraftSystemPublisher.ts new file mode 100644 index 00000000000..95ae1fdba56 --- /dev/null +++ b/fbw-common/src/systems/shared/src/publishers/Msfs/MsfsAircraftSystemPublisher.ts @@ -0,0 +1,49 @@ +import { + EventBus, + IndexedEventType, + PublishPacer, + SimVarPublisher, + SimVarPublisherEntry, + SimVarValueType, +} from '@microsoft/msfs-sdk'; + +interface MsfsAircraftSystemBaseEvents { + /** Adjust the potentiometer of the indexed lighting. Index is defined in the appropriate lightdef hashmap setting. 0-1 */ + msfs_light_potentiometer: number; +} + +type IndexedTopics = 'msfs_light_potentiometer'; + +type MsfsAircraftSystemIndexedEvents = { + [P in keyof Pick< + MsfsAircraftSystemBaseEvents, + IndexedTopics + > as IndexedEventType

]: MsfsAircraftSystemBaseEvents[P]; +}; + +/** + * Events for simvars listed on https://docs.flightsimulator.com/html/Programming_Tools/SimVars/Aircraft_SimVars/Aircraft_System_Variables.htm. + * Event names are the same as the simvar names, with msfs_ prefix, and index as suffix for indexed simvars. + */ +export interface MsfsAircraftSystemEvents extends MsfsAircraftSystemBaseEvents, MsfsAircraftSystemIndexedEvents {} + +/** + * Publisher for simvars listed on https://docs.flightsimulator.com/html/Programming_Tools/SimVars/Aircraft_SimVars/Aircraft_System_Variables.htm. + */ +export class MsfsAircraftSystemPublisher extends SimVarPublisher { + /** + * Create a publisher. + * @param bus The EventBus to publish to + * @param pacer An optional pacer to use to control the rate of publishing + */ + public constructor(bus: EventBus, pacer?: PublishPacer) { + const simvars = new Map>([ + [ + 'msfs_light_potentiometer', + { name: `LIGHT POTENTIOMETER:#index#`, type: SimVarValueType.PercentOver100, indexed: true }, + ], + ]); + + super(simvars, bus, pacer); + } +} diff --git a/fbw-common/src/systems/shared/src/publishers/Msfs/MsfsRadioNavigationPublisher.ts b/fbw-common/src/systems/shared/src/publishers/Msfs/MsfsRadioNavigationPublisher.ts index f1cfe74f0fa..b57ba08055b 100644 --- a/fbw-common/src/systems/shared/src/publishers/Msfs/MsfsRadioNavigationPublisher.ts +++ b/fbw-common/src/systems/shared/src/publishers/Msfs/MsfsRadioNavigationPublisher.ts @@ -14,7 +14,7 @@ interface MsfsRadioNavigationBaseEvents { type IndexedTopics = null; -type MsfsAutopilotAssitanceIndexedEvents = { +type MsfsRadioNavigationIndexedEvents = { [P in keyof Pick< MsfsRadioNavigationBaseEvents, IndexedTopics @@ -25,7 +25,7 @@ type MsfsAutopilotAssitanceIndexedEvents = { * Events for simvars listed on https://docs.flightsimulator.com/html/Programming_Tools/SimVars/Aircraft_SimVars/Aircraft_RadioNavigation_Variables.htm. * Event names are the same as the simvar names, with msfs_ prefix, and index as suffix for indexed simvars. */ -export interface MsfsRadioNavigationEvents extends MsfsRadioNavigationBaseEvents, MsfsAutopilotAssitanceIndexedEvents {} +export interface MsfsRadioNavigationEvents extends MsfsRadioNavigationBaseEvents, MsfsRadioNavigationIndexedEvents {} /** * Publisher for simvars listed on https://docs.flightsimulator.com/html/Programming_Tools/SimVars/Aircraft_SimVars/Aircraft_RadioNavigation_Variables.htm. diff --git a/fbw-common/src/systems/shared/src/publishers/Msfs/index.ts b/fbw-common/src/systems/shared/src/publishers/Msfs/index.ts index 11f3d54e28b..84fb3e422e2 100644 --- a/fbw-common/src/systems/shared/src/publishers/Msfs/index.ts +++ b/fbw-common/src/systems/shared/src/publishers/Msfs/index.ts @@ -1,3 +1,4 @@ +export * from './MsfsAircraftSystemPublisher'; export * from './MsfsAutopilotAssistancePublisher'; export * from './MsfsRadioNavigationPublisher'; export * from './MsfsElectricsPublisher'; From 63c2b9f053448ad0c146fab1ec8c6328a55b1a76 Mon Sep 17 00:00:00 2001 From: floridude <63071941+flogross89@users.noreply.github.com> Date: Thu, 28 Nov 2024 02:02:39 +0100 Subject: [PATCH 03/14] fix(a380x): EWD thrust fill area & PFD rudder trim visibility (#9581) * THR gauge fix (cherry picked from commit 1104ba104474ea93828493a7eca68e60f470c6fa) * don't show rudder trim indicator when ADIRS not aligned (cherry picked from commit f39fdd981af7f677f5d49bd41b26eda77242bd9e) * fix rudder trim display condition for startup (cherry picked from commit ddb1d81a294de1763487f211d1fd3b3825da8aa4) * changelog --- .github/CHANGELOG.md | 1 + .../systems/instruments/src/MsfsAvionicsCommon/gauges.tsx | 8 +++++--- fbw-a380x/src/systems/instruments/src/PFD/LowerArea.tsx | 7 ++++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 025db3e51e9..2ed611ba7f0 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -79,6 +79,7 @@ 1. [FMS] Fixed issue with airport loading timing out on MSFS2024 - @tracernz (Mike) 1. [A32NX] Fixed APU fire detection - @tracernz (Mike) 1. [A380X/COND] Fix wasm crash during rapid decompression - @mjuhe (Miquel Juhe) +1. [A380X] Fix EWD avail. thrust fill area & PFD rudder trim visibility on ground - @flogross89 (floridude) ## 0.12.0 diff --git a/fbw-a380x/src/systems/instruments/src/MsfsAvionicsCommon/gauges.tsx b/fbw-a380x/src/systems/instruments/src/MsfsAvionicsCommon/gauges.tsx index af0011f4f59..9b1176e4d0e 100644 --- a/fbw-a380x/src/systems/instruments/src/MsfsAvionicsCommon/gauges.tsx +++ b/fbw-a380x/src/systems/instruments/src/MsfsAvionicsCommon/gauges.tsx @@ -497,10 +497,12 @@ export class GaugeThrustComponent extends DisplayComponent { w.bitValueOr(28, false), ); + private readonly fwcFlightPhase = ConsumerSubject.create(this.sub.on('fwcFlightPhase'), 0); + private readonly speed = Arinc429ConsumerSubject.create(this.sub.on('speedAr')); private readonly engine1Running = ConsumerSubject.create(this.sub.on('engOneRunning'), true); @@ -595,9 +597,10 @@ class RudderTrimIndicator extends DisplayComponent<{ bus: ArincEventBus }> { const rt = this.rudderTrimOrder.get(); const inFlightOrGroundFaster60Exceeds1Deg = (!gnd || (gnd && cas.valueOr(0) > 60)) && Math.abs(rt) > 1; - const onGroundSlower60Exceeds0p3 = gnd && cas.valueOr(0) < 60 && Math.abs(rt) > 0.3; + const onGroundSlower60Exceeds0p3 = gnd && cas.valueOr(61) < 60 && Math.abs(rt) > 0.3; if ( + this.fwcFlightPhase.get() >= 2 && !gnd && (!this.engine1Running.get() || !this.engine2Running.get() || @@ -605,6 +608,8 @@ class RudderTrimIndicator extends DisplayComponent<{ bus: ArincEventBus }> { !this.engine4Running.get()) ) { this.engineHasFailed = true; + } else if (this.engineHasFailed && this.fwcFlightPhase.get() < 2) { + this.engineHasFailed = false; } const visCondition = From 45e5a70cfda086e7c95a9566d3279a7a0ddccf03 Mon Sep 17 00:00:00 2001 From: BravoMike99 <119708186+BravoMike99@users.noreply.github.com> Date: Thu, 28 Nov 2024 20:24:46 +0000 Subject: [PATCH 04/14] feat(a380/pfd): FMA code cleanup & update possible fmas (#9501) * feat(pfd): add op clb & RWY armed layout to the FMA * add ALT CRZ blue & alt CRZ * to FMA list * fix typo and cleanup more vars --------- Co-authored-by: 2hwk <15316958+2hwk@users.noreply.github.com> --- .../src/systems/instruments/src/PFD/FMA.tsx | 114 ++++-------------- 1 file changed, 21 insertions(+), 93 deletions(-) diff --git a/fbw-a380x/src/systems/instruments/src/PFD/FMA.tsx b/fbw-a380x/src/systems/instruments/src/PFD/FMA.tsx index 7c9959545b1..baf382f2f10 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/FMA.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/FMA.tsx @@ -9,7 +9,7 @@ import { Subscribable, VNode, } from '@microsoft/msfs-sdk'; -import { ArmedLateralMode, ArmedVerticalMode, isArmed, LateralMode, VerticalMode } from '@shared/autopilot'; +import { ArmedLateralMode, isArmed, LateralMode, VerticalMode } from '@shared/autopilot'; import { Arinc429Values } from './shared/ArincValueProvider'; import { PFDSimvars } from './shared/PFDSimvarPublisher'; import { Arinc429Word } from '@flybywiresim/fbw-sdk'; @@ -795,9 +795,6 @@ class B1Cell extends ShowForSecondsComponent { case VerticalMode.TCAS: text = 'TCAS'; break; - /* case 9: - text = 'FINAL'; - break; */ case VerticalMode.DES: text = 'DES'; break; @@ -826,7 +823,12 @@ class B1Cell extends ShowForSecondsComponent { } break; case VerticalMode.ALT_CPT: - text = 'ALT*'; + if (this.crzAltMode) { + // TODO hook to new FG var if necessary + text = 'ALT CRZ *'; + } else { + text = 'ALT*'; + } break; case VerticalMode.ALT_CST_CPT: text = 'ALT CST*'; @@ -834,9 +836,6 @@ class B1Cell extends ShowForSecondsComponent { case VerticalMode.ALT_CST: text = 'ALT CST'; break; - /* case 18: - text = 'ALT CRZ'; - break; */ case VerticalMode.FPA: { const FPAText = `${this.FPA > 0 ? '+' : ''}${(Math.round(this.FPA * 10) / 10).toFixed(1)}°`; @@ -1022,10 +1021,16 @@ class B2Cell extends DisplayComponent { const desArmed = (fmv >> 3) & 1; const gsArmed = (fmv >> 4) & 1; + // TODO hook to FG once implemented + const openClimbArmed = false; + const altCruiseArmed = false; + let text1: string; let color1 = 'Cyan'; let vertModeActive = true; - if (clbArmed) { + if (openClimbArmed) { + text1 = ' OP CLB'; + } else if (clbArmed) { text1 = ' CLB'; } else if (desArmed) { text1 = gsArmed ? 'DES ' : ' DES'; @@ -1034,6 +1039,8 @@ class B2Cell extends DisplayComponent { color1 = 'Magenta'; } else if (altArmed) { text1 = gsArmed ? 'ALT ' : ' ALT'; + } else if (altCruiseArmed) { + text1 = ' ALT CRZ'; } else { text1 = ''; vertModeActive = false; @@ -1078,10 +1085,6 @@ class C1Cell extends ShowForSecondsComponent { private activeLateralMode = 0; - private activeVerticalMode = 0; - - private armedVerticalMode = 0; - constructor(props: CellProps) { super(props, 10); } @@ -1105,41 +1108,9 @@ class C1Cell extends ShowForSecondsComponent { this.displayModeChangedPath(true); } }); - - sub - .on('activeVerticalMode') - .whenChanged() - .handle((lm) => { - this.activeVerticalMode = lm; - - const isShown = this.updateText(); - - if (isShown) { - this.displayModeChangedPath(); - } else { - this.displayModeChangedPath(true); - } - }); - - sub - .on('fmaVerticalArmed') - .whenChanged() - .handle((va) => { - this.armedVerticalMode = va; - - const hasChanged = this.updateText(); - - if (hasChanged) { - this.displayModeChangedPath(); - } else { - this.displayModeChangedPath(true); - } - }); } private updateText(): boolean { - const finalArmed = (this.armedVerticalMode >> 5) & 1; - let text: string; this.isShown = true; if (this.activeLateralMode === LateralMode.GA_TRACK) { @@ -1156,18 +1127,8 @@ class C1Cell extends ShowForSecondsComponent { text = 'TRACK'; } else if (this.activeLateralMode === LateralMode.LOC_TRACK) { text = 'LOC'; - } else if ( - this.activeLateralMode === LateralMode.NAV && - !finalArmed && - this.activeVerticalMode !== VerticalMode.FINAL - ) { + } else if (this.activeLateralMode === LateralMode.NAV) { text = 'NAV'; - } else if ( - this.activeLateralMode === LateralMode.NAV && - finalArmed && - this.activeVerticalMode !== VerticalMode.FINAL - ) { - text = 'APP NAV'; } else { text = ''; this.isShown = false; @@ -1222,17 +1183,12 @@ class C1Cell extends ShowForSecondsComponent { class C2Cell extends DisplayComponent { private fmaLateralArmed: number = 0; - private fmaVerticalArmed: number = 0; - - private activeVerticalMode: number = 0; - private textSub = Subject.create(''); private getText() { const navArmed = isArmed(this.fmaLateralArmed, ArmedLateralMode.NAV); const locArmed = isArmed(this.fmaLateralArmed, ArmedLateralMode.LOC); - - const finalArmed = isArmed(this.fmaVerticalArmed, ArmedVerticalMode.FINAL); + const runwayArmed = false; let text: string = ''; if (locArmed) { @@ -1243,8 +1199,8 @@ class C2Cell extends DisplayComponent { // case 3: // text = 'F-LOC'; // break; - } else if (navArmed && (finalArmed || this.activeVerticalMode === VerticalMode.FINAL)) { - text = 'APP NAV'; + } else if (runwayArmed) { + text = 'RWY' + (navArmed ? ' NAV' : ''); } else if (navArmed) { text = 'NAV'; } @@ -1263,27 +1219,11 @@ class C2Cell extends DisplayComponent { this.fmaLateralArmed = fla; this.getText(); }); - - sub - .on('fmaVerticalArmed') - .whenChanged() - .handle((fva) => { - this.fmaVerticalArmed = fva; - this.getText(); - }); - - sub - .on('activeVerticalMode') - .whenChanged() - .handle((avm) => { - this.activeVerticalMode = avm; - this.getText(); - }); } render(): VNode { return ( - + {this.textSub} ); @@ -1291,8 +1231,6 @@ class C2Cell extends DisplayComponent { } class BC1Cell extends ShowForSecondsComponent { - private lastLateralMode = 0; - private lastVerticalMode = 0; private textSub = Subject.create(''); @@ -1310,8 +1248,6 @@ class BC1Cell extends ShowForSecondsComponent { text = 'FLARE'; } else if (this.lastVerticalMode === VerticalMode.LAND) { text = 'LAND'; - } else if (this.lastVerticalMode === VerticalMode.FINAL && this.lastLateralMode === LateralMode.NAV) { - text = 'FINAL APP'; } else { text = ''; } @@ -1336,14 +1272,6 @@ class BC1Cell extends ShowForSecondsComponent { this.lastVerticalMode = v; this.setText(); }); - - sub - .on('activeLateralMode') - .whenChanged() - .handle((l) => { - this.lastLateralMode = l; - this.setText(); - }); } render(): VNode { From 0543c5cb54fdc05a6e80f80d8c3119bd5fc2841d Mon Sep 17 00:00:00 2001 From: floridude <63071941+flogross89@users.noreply.github.com> Date: Fri, 29 Nov 2024 01:12:17 +0100 Subject: [PATCH 05/14] fix(a380x): Fix green dot speed for heavy weights and high altitudes; Fix FMS speed target for GD > CLB speed limit (#9522) * changelog * Update analog_inputs data type, modify GD LUT * update VLS, green dot lookup tables in FAC * rework of complete FMS speeds interpolation * if FMS managed speed below green dot, target green dot * target GD min only when CONF 0...obviously --- .github/CHANGELOG.md | 1 + .../src/MFD/FMC/FmcAircraftInterface.ts | 11 +- .../systems/shared/src/OperatingSpeeds.tsx | 585 ++++++++++-------- .../shared/src/PerformanceConstants.ts | 4 +- .../src/wasm/fbw_a380/src/model/FacComputer.h | 16 +- .../fbw_a380/src/model/FacComputer_data.cpp | 78 +-- .../fbw_a380/src/model/FacComputer_types.h | 30 +- 7 files changed, 409 insertions(+), 316 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 2ed611ba7f0..62586caf764 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -55,6 +55,7 @@ 1. [A380X/PFD] Add T/D Reached PFD message - @BravoMike99 (bruno_pt99) 1. [A380X/CAMERA] Showcase & pilot view camera fixes @LunakisDev (LunakisLeaks) 1. [A380X/LIGHTS] Added cockpit ambient bounce lights - @ImenesFBW (Imenes) +1. [A380X/FWS] Fix green dot speed for high weights and altitudes, fix FMS speed target for GD > climb speed limit - @flogross89 (floridude) 1. [A380X/PRIM] Fix max. spoiler deflection based on flap conf - @flogross89 (floridude) 1. [A380X/PERF] Changed managed speeds to more realistic numbers - @slightlyclueles (abnormaltoast) 1. [A380X/MFD] Add ATCCOM connect page - @heclak (heclak) diff --git a/fbw-a380x/src/systems/instruments/src/MFD/FMC/FmcAircraftInterface.ts b/fbw-a380x/src/systems/instruments/src/MFD/FMC/FmcAircraftInterface.ts index 9c161965328..90db7380c9e 100644 --- a/fbw-a380x/src/systems/instruments/src/MFD/FMC/FmcAircraftInterface.ts +++ b/fbw-a380x/src/systems/instruments/src/MFD/FMC/FmcAircraftInterface.ts @@ -323,6 +323,7 @@ export class FmcAircraftInterface { const taxiFuel = this.fmgc.data.taxiFuel.get() ?? 0; const tow = (this.fmc.fmgc.getGrossWeightKg() ?? maxGw) - (this.fmgc.isAnEngineOn() ? 0 : taxiFuel); + const flapConf = this.fmgc.data.takeoffFlapsSetting.get(); return ( (this.flightPlanService.active.performanceData.v1 ?? Infinity) < Math.trunc(A380SpeedsUtils.getVmcg(zp)) || @@ -330,7 +331,7 @@ export class FmcAircraftInterface { (this.flightPlanService.active.performanceData.v2 ?? Infinity) < Math.trunc(1.1 * A380SpeedsUtils.getVmca(zp)) || (Number.isFinite(tow) && (this.flightPlanService.active.performanceData.v2 ?? Infinity) < - Math.trunc(1.13 * A380SpeedsUtils.getVs1g(tow / 1000, this.fmgc.data.takeoffFlapsSetting.get(), true))) + Math.trunc(1.13 * A380SpeedsUtils.getVs1g(tow, flapConf > 1 ? flapConf + 1 : flapConf, true))) ); } @@ -867,7 +868,9 @@ export class FmcAircraftInterface { if (!Vtap) { // Overspeed protection const vMax = this.speedVmax.get(); - Vtap = Math.min(this.managedSpeedTarget ?? Vmo - 5, vMax - 5); + const greenDot = this.fmgc.data.greenDotSpeed.get(); + const vMin = SimVar.GetSimVarValue('L:A32NX_FLAPS_HANDLE_INDEX', 'Number') === 0 && greenDot ? greenDot : 0; + Vtap = Math.min(Math.max(this.managedSpeedTarget ?? Vmo - 5, vMin), vMax - 5); } SimVar.SetSimVarValue('L:A32NX_SPEEDS_MANAGED_PFD', 'knots', vPfd); SimVar.SetSimVarValue('L:A32NX_SPEEDS_MANAGED_ATHR', 'knots', Vtap); @@ -1158,7 +1161,7 @@ export class FmcAircraftInterface { // Calculate approach speeds. Independent from ADR data const approachSpeeds = new A380OperatingSpeeds( - ldgWeight / 1000, + ldgWeight, 0, this.fmgc.data.approachFlapConfig.get(), FmgcFlightPhase.Approach, @@ -1187,7 +1190,7 @@ export class FmcAircraftInterface { flaps = 5; // CONF 1 } const speeds = new A380OperatingSpeeds( - grossWeight / 1000, + grossWeight, cas, flaps, this.flightPhase.get(), diff --git a/fbw-a380x/src/systems/shared/src/OperatingSpeeds.tsx b/fbw-a380x/src/systems/shared/src/OperatingSpeeds.tsx index 5a0723a4eec..9dad3515864 100644 --- a/fbw-a380x/src/systems/shared/src/OperatingSpeeds.tsx +++ b/fbw-a380x/src/systems/shared/src/OperatingSpeeds.tsx @@ -7,161 +7,309 @@ // TODO: Weight interpolation is different for the two CG extremes, one formula might be too inaccurate. import { Feet, Knots } from 'msfs-geo'; -import { MathUtils, Units } from '@flybywiresim/fbw-sdk'; +import { MathUtils } from '@flybywiresim/fbw-sdk'; import { Mmo, VfeF1, VfeF1F, VfeF2, VfeF3, VfeFF, Vmcl, Vmo } from '@shared/PerformanceConstants'; -import { Common } from '@fmgc/guidance/vnav/common'; import { FmgcFlightPhase } from '@shared/flightphase'; - -// Maybe we need bilinear interpolation -const vls = [ - [ - (m: number) => vlsConf0(m), - (m: number) => vlsConf0(m), - (m: number) => vlsConf0(m), - (m: number) => vlsConf0(m), - (m: number) => vlsConf0(m), - (m: number) => vlsConf0(m), - (m: number) => vlsConf0(m), - (m: number) => vlsConf0(m), - ], // Clean Config - [ - () => interpolateForCgAndWeight(null, (cgS) => cgS, 127, 123), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.1 * (m - 600), 127, 123), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.09 * (m - 700), 137, 133), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.09 * (m - 800), 146, 143), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.09 * (m - 900), 155, 151), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.08 * (m - 1000), 164, 159), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.07 * (m - 1100), 172, 167), - () => interpolateForCgAndWeight(null, (cgS) => cgS, 179, 175), - ], // Config 1 + F - [ - () => interpolateForCgAndWeight(null, (cgS) => cgS, 122, 120), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.1 * (m - 600), 122, 120), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.09 * (m - 700), 132, 128), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.08 * (m - 800), 141, 137), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.09 * (m - 900), 149, 146), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.07 * (m - 1000), 158, 153), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.08 * (m - 1100), 165, 161), - () => interpolateForCgAndWeight(null, (cgS) => cgS, 173, 168), - ], // Config 2 - [ - () => interpolateForCgAndWeight(null, (cgS) => cgS, 120, 120), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.08 * (m - 600), 120, 120), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.09 * (m - 700), 128, 124), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.08 * (m - 800), 137, 133), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.08 * (m - 900), 145, 141), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.07 * (m - 1000), 153, 149), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.08 * (m - 1100), 160, 156), - () => interpolateForCgAndWeight(null, (cgS) => cgS, 168, 163), - ], // Config 3 - [ - () => interpolateForCgAndWeight(null, (cgS) => cgS, 120, 120), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.05 * (m - 600), 120, 120), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.08 * (m - 700), 125, 121), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.08 * (m - 800), 133, 130), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.08 * (m - 900), 141, 138), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.08 * (m - 1000), 149, 145), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.07 * (m - 1100), 157, 152), - () => interpolateForCgAndWeight(null, (cgS) => cgS, 164, 159), - ], // Config Full - [ - () => interpolateForCgAndWeight(null, (cgS) => cgS, 133, 130), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.11 * (m - 600), 133, 130), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.1 * (m - 700), 144, 141), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.09 * (m - 800), 154, 150), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.1 * (m - 900), 163, 159), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.08 * (m - 1000), 173, 168), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.09 * (m - 1100), 181, 177), - () => interpolateForCgAndWeight(null, (cgS) => cgS, 190, 185), - ], // Config 1 -]; - -/** - * F2-Speed Table - * calls function(gross weight (1000 lb)) which returns CAS, automatically compensates for cg. - * Indexes: 0 to 9 represent gross weight (1000 lb) in 100k lb steps from 600 to 1200. - */ -const f2 = [ - () => interpolateForCgAndWeight(null, (cgS) => cgS, 143, 140), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.09 * (m - 600), 143, 140), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.09 * (m - 700), 154, 151), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.1 * (m - 800), 165, 161), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.09 * (m - 900), 175, 171), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.09 * (m - 1000), 184, 181), - (m: number) => interpolateForCgAndWeight(m, (cgS) => cgS, 191, 189), - () => interpolateForCgAndWeight(null, (cgS) => cgS, 191, 191), -]; - -/** - * F3-Speed Table - * calls function(gross weight (1000 lb)) which returns CAS, automatically compensates for cg. - * Indexes: 0 to 9 represent gross weight (1000 lb) in 100k lb steps from 600 to 1200. - */ -const f3 = [ - () => interpolateForCgAndWeight(null, (cgS) => cgS, 130, 130), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.07 * (m - 600), 130, 130), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.09 * (m - 700), 137, 134), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.09 * (m - 800), 146, 143), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.08 * (m - 900), 155, 151), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.08 * (m - 1000), 163, 160), - (m: number) => interpolateForCgAndWeight(m, (cgS, m) => cgS + 0.06 * (m - 1100), 171, 167), - () => interpolateForCgAndWeight(null, (cgS) => cgS, 177, 175), -]; - -/** - * S-Speed Table - * calls function(gross weight (1000 lb)) which returns CAS. - * Indexes: 0 to 9 represent gross weight (1000 lb) in 100k lb steps from 600 to 1200. - */ -const s = [ - () => 153, - (m: number) => 153 + 0.12 * (m - 600), - (m: number) => 165 + 0.11 * (m - 700), - (m: number) => 176 + 0.11 * (m - 800), - (m: number) => 187 + 0.1 * (m - 900), - (m: number) => 197 + 0.1 * (m - 1000), - (m: number) => 207 + 0.08 * (m - 1100), - () => 215, -]; - -/** - * Calculate green dot speed depending on altitude and weight - * @param m mass: gross weight in klb - * @param alt altitude: in feet - * @returns green dot speed in knots - */ -function greenDotSpeed(m: number, alt: number = SimVar.GetSimVarValue('PLANE ALTITUDE', 'feet')): number { - const greenDotTable = [ - [0, 0, 10_000, 20_000, 30_000, 40_000], - [600, 167, 167, 168, 196, 210], - [700, 180, 180, 185, 213, 226], - [800, 194, 194, 202, 228, 240], - [900, 207, 207, 222, 244, 252], - [1000, 217, 217, 238, 257, 252], - [1100, 228, 228, 255, 272, 272], - [1200, 238, 238, 266, 262, 262], - ]; - return tableInterpolation(greenDotTable, m, alt); +import { LerpLookupTable } from '@microsoft/msfs-sdk'; + +export enum ApproachConf { + CONF_1 = 1, + CONF_1F, + CONF_2, + CONF_3, + CONF_FULL, } -/** - * Calculate VLS for CONF 0, depending on weight and altitude - * @param m mass: gross weight in 1000 lb - * @param alt altitude: in feet - * @returns green dot speed - */ -function vlsConf0(m: number, alt: Feet = SimVar.GetSimVarValue('PLANE ALTITUDE', 'feet')): Knots { - const vlsTable = [ - [0, 0, 10_000, 15_000, 20_000, 25_000, 30_000, 32_000, 34_000, 36_000, 38_000, 40_000, 43_000], - [600, 155, 155, 155, 156, 160, 165, 166, 168, 169, 171, 174, 178], - [700, 168, 168, 168, 171, 178, 180, 182, 184, 186, 189, 192, 198], - [800, 179, 179, 181, 187, 191, 195, 197, 200, 203, 207, 211, 211], - [900, 190, 191, 195, 201, 205, 210, 213, 216, 220, 224, 224, 227], - [1000, 200, 203, 210, 213, 218, 225, 228, 233, 236, 236, 236, 236], - [1100, 210, 216, 222, 226, 231, 239, 244, 247, 247, 247, 250, 250], - [1200, 219, 229, 233, 238, 244, 254, 258, 258, 257, 262, 262, 262], - ]; - return tableInterpolation(vlsTable, m, alt); +export class SpeedsLookupTables { + /** VLS approach in knots, key is (cg in %MAC, weight in kg) */ + private static readonly VLS_APPR_CONF: Record = { + [ApproachConf.CONF_1]: new LerpLookupTable([ + [128, 29, 250_000], + [140, 29, 300_000], + [151, 29, 350_000], + [162, 29, 400_000], + [172, 29, 450_000], + [182, 29, 500_000], + [191, 29, 550_000], + [200, 29, 600_000], + [126, 43, 250_000], + [137, 43, 300_000], + [148, 43, 350_000], + [158, 43, 400_000], + [168, 43, 450_000], + [177, 43, 500_000], + [186, 43, 550_000], + [195, 43, 600_000], + ]), + [ApproachConf.CONF_1F]: new LerpLookupTable([ + [123, 29, 250_000], + [133, 29, 300_000], + [144, 29, 350_000], + [154, 29, 400_000], + [163, 29, 450_000], + [172, 29, 500_000], + [180, 29, 550_000], + [188, 29, 600_000], + [123, 43, 250_000], + [130, 43, 300_000], + [140, 43, 350_000], + [150, 43, 400_000], + [159, 43, 450_000], + [167, 43, 500_000], + [176, 43, 550_000], + [183, 43, 600_000], + ]), + [ApproachConf.CONF_2]: new LerpLookupTable([ + [123, 29, 250_000], + [128, 29, 300_000], + [138, 29, 350_000], + [148, 29, 400_000], + [157, 29, 450_000], + [165, 29, 500_000], + [173, 29, 550_000], + [181, 29, 600_000], + [123, 43, 250_000], + [125, 43, 300_000], + [135, 43, 350_000], + [144, 43, 400_000], + [153, 43, 450_000], + [161, 43, 500_000], + [169, 43, 550_000], + [176, 43, 600_000], + ]), + [ApproachConf.CONF_3]: new LerpLookupTable([ + [123, 29, 250_000], + [124, 29, 300_000], + [134, 29, 350_000], + [144, 29, 400_000], + [152, 29, 450_000], + [161, 29, 500_000], + [169, 29, 550_000], + [176, 29, 600_000], + [123, 43, 250_000], + [123, 43, 300_000], + [131, 43, 350_000], + [140, 43, 400_000], + [148, 43, 450_000], + [156, 43, 500_000], + [164, 43, 550_000], + [171, 43, 600_000], + ]), + [ApproachConf.CONF_FULL]: new LerpLookupTable([ + [123, 29, 250_000], + [123, 29, 300_000], + [131, 29, 350_000], + [140, 29, 400_000], + [148, 29, 450_000], + [157, 29, 500_000], + [165, 29, 550_000], + [173, 29, 600_000], + [123, 43, 250_000], + [123, 43, 300_000], + [127, 43, 350_000], + [136, 43, 400_000], + [144, 43, 450_000], + [152, 43, 500_000], + [160, 43, 550_000], + [168, 43, 600_000], + ]), + }; + + static getApproachVls(conf: number, cg: number, weight: number): number { + if (conf === 1) { + return SpeedsLookupTables.VLS_CONF_0.get(0, weight); + } else { + return SpeedsLookupTables.VLS_APPR_CONF[conf].get(cg, weight); + } + } + + // cg in %MAC, weight in kg + static readonly S_SPEED: LerpLookupTable = new LerpLookupTable([ + [146, 250_000], + [160, 300_000], + [173, 350_000], + [185, 400_000], + [196, 450_000], + [207, 500_000], + [215, 550_000], + [215, 600_000], + ]); + + // cg in %MAC, weight in kg + static readonly F2_SPEED: LerpLookupTable = new LerpLookupTable([ + [144, 29, 250_000], + [150, 29, 300_000], + [162, 29, 350_000], + [173, 29, 400_000], + [184, 29, 450_000], + [191, 29, 500_000], + [191, 29, 550_000], + [191, 29, 600_000], + [144, 43, 250_000], + [146, 43, 300_000], + [158, 43, 350_000], + [169, 43, 400_000], + [179, 43, 450_000], + [189, 43, 500_000], + [191, 43, 550_000], + [191, 43, 600_000], + ]); + + // cg in %MAC, weight in kg + static readonly F3_SPEED: LerpLookupTable = new LerpLookupTable([ + [133, 29, 250_000], + [133, 29, 300_000], + [143, 29, 350_000], + [153, 29, 400_000], + [163, 29, 450_000], + [171, 29, 500_000], + [177, 29, 550_000], + [177, 29, 600_000], + [133, 43, 250_000], + [133, 43, 300_000], + [139, 43, 350_000], + [149, 43, 400_000], + [158, 43, 450_000], + [167, 43, 500_000], + [175, 43, 550_000], + [177, 43, 600_000], + ]); + + // altitude in ft, weight in kg + static readonly GREEN_DOT: LerpLookupTable = new LerpLookupTable([ + [160, 10_000, 250_000], + [175, 10_000, 300_000], + [190, 10_000, 350_000], + [205, 10_000, 400_000], + [216, 10_000, 450_000], + [228, 10_000, 500_000], + [239, 10_000, 550_000], + [252, 10_000, 600_000], + [161, 20_000, 250_000], + [178, 20_000, 300_000], + [196, 20_000, 350_000], + [219, 20_000, 400_000], + [237, 20_000, 450_000], + [256, 20_000, 500_000], + [267, 20_000, 550_000], + [277, 20_000, 600_000], + [186, 30_000, 250_000], + [208, 30_000, 300_000], + [224, 30_000, 350_000], + [241, 30_000, 400_000], + [256, 30_000, 450_000], + [272, 30_000, 500_000], + [284, 30_000, 550_000], + [292, 30_000, 600_000], + [203, 40_000, 250_000], + [220, 40_000, 300_000], + [236, 40_000, 350_000], + [252, 40_000, 400_000], + [252, 40_000, 450_000], + [260, 40_000, 500_000], + [260, 40_000, 550_000], + [260, 40_000, 600_000], + ]); + + // altitude in ft, weight in kg + static readonly VLS_CONF_0: LerpLookupTable = new LerpLookupTable([ + [149, 0, 250_000], + [163, 0, 300_000], + [176, 0, 350_000], + [188, 0, 400_000], + [199, 0, 450_000], + [210, 0, 500_000], + [220, 0, 550_000], + [231, 0, 600_000], + [149, 10_000, 250_000], + [163, 10_000, 300_000], + [176, 10_000, 350_000], + [189, 10_000, 400_000], + [202, 10_000, 450_000], + [216, 10_000, 500_000], + [231, 10_000, 550_000], + [243, 10_000, 600_000], + [149, 15_000, 250_000], + [163, 15_000, 300_000], + [178, 15_000, 350_000], + [192, 15_000, 400_000], + [209, 15_000, 450_000], + [222, 15_000, 500_000], + [234, 15_000, 550_000], + [246, 15_000, 600_000], + [149, 20_000, 250_000], + [165, 20_000, 300_000], + [183, 20_000, 350_000], + [199, 20_000, 400_000], + [212, 20_000, 450_000], + [226, 20_000, 500_000], + [239, 20_000, 550_000], + [252, 20_000, 600_000], + [151, 25_000, 250_000], + [171, 25_000, 300_000], + [187, 25_000, 350_000], + [202, 25_000, 400_000], + [217, 25_000, 450_000], + [231, 25_000, 500_000], + [246, 25_000, 550_000], + [260, 25_000, 600_000], + [158, 30_000, 250_000], + [174, 30_000, 300_000], + [191, 30_000, 350_000], + [207, 30_000, 400_000], + [224, 30_000, 450_000], + [239, 30_000, 500_000], + [256, 30_000, 550_000], + [270, 30_000, 600_000], + [158, 32_000, 250_000], + [176, 32_000, 300_000], + [193, 32_000, 350_000], + [210, 32_000, 400_000], + [227, 32_000, 450_000], + [244, 32_000, 500_000], + [259, 32_000, 550_000], + [270, 32_000, 600_000], + [159, 34_000, 250_000], + [178, 34_000, 300_000], + [196, 34_000, 350_000], + [213, 34_000, 400_000], + [231, 34_000, 450_000], + [247, 34_000, 500_000], + [259, 34_000, 550_000], + [270, 34_000, 600_000], + [161, 36_000, 250_000], + [180, 36_000, 300_000], + [198, 36_000, 350_000], + [217, 36_000, 400_000], + [235, 36_000, 450_000], + [247, 36_000, 500_000], + [259, 36_000, 550_000], + [275, 36_000, 600_000], + [162, 38_000, 250_000], + [182, 38_000, 300_000], + [202, 38_000, 350_000], + [222, 38_000, 400_000], + [235, 38_000, 450_000], + [247, 38_000, 500_000], + [259, 38_000, 550_000], + [275, 38_000, 600_000], + [164, 40_000, 250_000], + [185, 40_000, 300_000], + [206, 40_000, 350_000], + [222, 40_000, 400_000], + [235, 40_000, 450_000], + [250, 40_000, 500_000], + [265, 40_000, 550_000], + [270, 40_000, 600_000], + [168, 43_000, 250_000], + [191, 43_000, 300_000], + [208, 43_000, 350_000], + [223, 43_000, 400_000], + [235, 43_000, 450_000], + [250, 43_000, 500_000], + [250, 43_000, 550_000], + [250, 43_000, 600_000], + ]); } // FIXME these are from the A320 @@ -204,41 +352,6 @@ const vfeFS = [ VfeF1, // Config 1 ]; -/** - * Correct input function for cg and weight - * @param m gross weight (1000 lb) - * @param weightFn function to be called with weight variable - * @param cg29Value speed for 29%, i.e. lower CG limit - * @param cg43Value speed for 43%, i.e. upper CG limit - * @param cg center of gravity - * @returns cg and weight corrected velocity (CAS) - */ -function interpolateForCgAndWeight( - m: number, - weightFn: (cgSpeed: number, m?: number) => number, - cg29Value: number, - cg43Value: number, - cg: number = SimVar.GetSimVarValue('CG PERCENT', 'percent'), -) { - if (cg < 29) { - return weightFn(cg29Value, m); - } - if (cg > 43) { - return weightFn(cg43Value, m); - } - const cgSpeed = cg29Value + ((cg43Value - cg29Value) / 14) * (cg - 29); - return weightFn(cgSpeed, m); -} - -/** - * Ensure gross weight (mass) is withing valid range - * @param m mass: gross weight in 1000 lb - * @returns index for speed tables - */ -function correctMass(m: number): number { - return Math.ceil(((m > 1200 ? 1200 : m) - 600) / 100); -} - /** * Corrects velocity for mach effect by adding 1kt for every 1000ft above FL200 * @param v velocity in kt (CAS) @@ -334,7 +447,7 @@ export class A380OperatingSpeeds { /** * Computes Vs, Vls, Vapp, F, S and GD - * @param m mass: gross weight in t + * @param m mass: gross weight in kg * @param calibratedAirSpeed CAS in kt * @param fPos flaps position * @param fmgcFlightPhase sic @@ -351,19 +464,23 @@ export class A380OperatingSpeeds { altitude: Feet, wind: Knots = 0, ) { - // Convert mass from tons to klb (1000*lb) - const klb = Math.min(1200, Math.max(Units.kilogramToPound(m * 1_000) / 1_000, 600)); + const cg = SimVar.GetSimVarValue('CG PERCENT', 'percent'); - const cm = correctMass(klb); - this.vls = vls[fPos][cm](klb); + if (fPos === 0) { + this.vls = SpeedsLookupTables.VLS_CONF_0.get(altitude, m); + } else if (fPos === 1 && calibratedAirSpeed > 212) { + this.vls = SpeedsLookupTables.getApproachVls(ApproachConf.CONF_1, cg, m); + } else { + this.vls = SpeedsLookupTables.getApproachVls(fPos + 1, cg, m); + } this.vapp = this.vls + addWindComponent(wind); - this.vref = vls[4][cm](klb); + this.vref = this.vls = SpeedsLookupTables.getApproachVls(ApproachConf.CONF_FULL, cg, m); - this.gd = greenDotSpeed(klb, altitude); + this.gd = SpeedsLookupTables.GREEN_DOT.get(altitude, m); this.vmax = fPos === 0 ? getVmo() : vfeFS[fPos - 1]; this.vfeN = fPos === 4 ? 0 : vfeFS[getVfeNIdx(fPos)]; - this.vs1g = vls[fPos][cm](klb) / 1.23; + this.vs1g = this.vls / 1.23; this.vls = Math.max(1.23 * this.vs1g, Vmcl); if (fmgcFlightPhase <= FmgcFlightPhase.Takeoff) { this.vls = Math.max(1.15 * this.vs1g, 1.05 * Math.min(v2Speed, Vmcl)); @@ -390,11 +507,18 @@ export class A380OperatingSpeeds { this.vls = this.vls + spoilerVlsIncrease[conf] * (spoilers / maxSpoilerExtension[conf]); } - const vs1gConf0 = vls[0][cm](klb) / 1.23; - const vs1gConf1F = vls[1][cm](klb) / 1.23; - this.f2 = fmgcFlightPhase <= FmgcFlightPhase.Takeoff ? Math.max(1.18 * vs1gConf1F, Vmcl + 5) : f2[cm](klb); - this.f3 = fmgcFlightPhase <= FmgcFlightPhase.Takeoff ? Math.max(1.18 * vs1gConf1F, Vmcl + 5) : f3[cm](klb); - this.s = fmgcFlightPhase <= FmgcFlightPhase.Takeoff ? 1.21 * vs1gConf0 : s[cm](klb); + const vs1gConf0 = SpeedsLookupTables.VLS_CONF_0.get(altitude, m) / 1.23; + const vs1gConf1F = SpeedsLookupTables.getApproachVls(ApproachConf.CONF_1, cg, m) / 1.23; + this.f2 = + fmgcFlightPhase <= FmgcFlightPhase.Takeoff + ? Math.max(1.18 * vs1gConf1F, Vmcl + 5) + : SpeedsLookupTables.F2_SPEED.get(altitude, m); + this.f3 = + fmgcFlightPhase <= FmgcFlightPhase.Takeoff + ? Math.max(1.18 * vs1gConf1F, Vmcl + 5) + : SpeedsLookupTables.F3_SPEED.get(altitude, m); + this.s = + fmgcFlightPhase <= FmgcFlightPhase.Takeoff ? 1.21 * vs1gConf0 : SpeedsLookupTables.S_SPEED.get(altitude, m); } } @@ -486,63 +610,24 @@ export class A380SpeedsUtils { /** * Get Vs1g for the given config * - * @param {number} mass mass of the aircraft in tons - * @param {number} conf 0 - Clean config, 1 - Config 1 + F, 2 - Config 2, 3 - Config 3, 4 - Config Full, 5 - Config 1. - * @param {boolean} gearDown true if the gear is down + * @param {number} mass mass of the aircraft in kg + * @param {number} conf 0 - CONF 1, 1 - CONF 1, 2 - CONF 1+F, 3 - CONF 2, 4 - CONF 3, 5 - CONF FULL. + * @param {boolean} takeof if VS1g should be calculated for takeoff */ static getVs1g(mass: number, conf: number, takeoff: boolean): Knots { - const klb = Units.kilogramToPound(mass) / 1000.0; - const weightTableIndex = Math.max(0, Math.min(7, correctMass(klb))); // FIXME rough, dirty hack if (takeoff === true) { - return vls[conf][weightTableIndex](klb) / 1.15; + return SpeedsLookupTables.getApproachVls(conf, SimVar.GetSimVarValue('CG PERCENT', 'percent'), mass) / 1.15; } if (conf === 5) { - return Math.max(vls[conf][weightTableIndex](klb) / 1.18, Vmcl); + return Math.max( + SpeedsLookupTables.getApproachVls(conf, SimVar.GetSimVarValue('CG PERCENT', 'percent'), mass) / 1.18, + Vmcl, + ); } - return Math.max(vls[conf][weightTableIndex](klb) / 1.23, Vmcl); - } -} - -/** - * Placeholder - * @param table - * @param i - * @param j - * @returns - */ -function tableInterpolation(table: number[][], i: number, j: number): number { - const numRows = table.length; - const numCols = table[0].length; - // Iterate through rows to find the upper bound to i - let r: number; - for (r = 1; r < numRows; r++) { - if (table[r][0] > i) { - break; - } - } - // Get lower bound to i - const r1 = Math.max(1, r - 1); - const r2 = Math.min(numRows - 1, r); - // Iterate through rows to find the upper bound to j - let c: number; - for (c = 1; c < numCols; c++) { - if (table[0][c] > j) { - break; - } - } - // Get the lower bound to j - const c1 = Math.max(1, c - 1); - const c2 = Math.min(numCols - 1, c); - - const interpolatedRowAtC1 = - r1 === r2 ? table[r1][c1] : Common.interpolate(i, table[r1][0], table[r2][0], table[r1][c1], table[r2][c1]); - const interpolatedRowAtC2 = - r1 === r2 ? table[r1][c2] : Common.interpolate(i, table[r1][0], table[r2][0], table[r1][c2], table[r2][c2]); - - if (c1 === c2) { - return interpolatedRowAtC1; + return Math.max( + SpeedsLookupTables.getApproachVls(conf, SimVar.GetSimVarValue('CG PERCENT', 'percent'), mass) / 1.23, + Vmcl, + ); } - - return Common.interpolate(j, table[0][c1], table[0][c2], interpolatedRowAtC1, interpolatedRowAtC2); } diff --git a/fbw-a380x/src/systems/shared/src/PerformanceConstants.ts b/fbw-a380x/src/systems/shared/src/PerformanceConstants.ts index 75892166336..182cd0ee6ec 100644 --- a/fbw-a380x/src/systems/shared/src/PerformanceConstants.ts +++ b/fbw-a380x/src/systems/shared/src/PerformanceConstants.ts @@ -7,8 +7,8 @@ export const VfeF2 = 220; // kt, Vmo with FLAPS 2 export const VfeF3 = 196; // kt, Vmo with FLAPS 3 export const VfeFF = 182; // kt, Vmo with FLAPS FULL -export const Vmcl = 120; // kt -export const Vmcl2 = 144; // kt +export const Vmcl = 123; // kt +export const Vmcl2 = 147; // kt export const Vle = 250; // kt, Gear extended export const Mle = 0.55; // mach, Gear extended diff --git a/fbw-a380x/src/wasm/fbw_a380/src/model/FacComputer.h b/fbw-a380x/src/wasm/fbw_a380/src/model/FacComputer.h index b3996ebc9d6..997bcfd7dc7 100644 --- a/fbw-a380x/src/wasm/fbw_a380/src/model/FacComputer.h +++ b/fbw-a380x/src/wasm/fbw_a380/src/model/FacComputer.h @@ -229,9 +229,9 @@ class FacComputer final real_T alphastallwarn_bp01Data[4]; real_T alphastallwarn_bp02Data[6]; real_T Gain2_Gain_d; - real_T uDLookupTable1_tableData[80]; + real_T uDLookupTable1_tableData[96]; real_T uDLookupTable1_bp01Data[8]; - real_T uDLookupTable1_bp02Data[10]; + real_T uDLookupTable1_bp02Data[12]; real_T Gain3_Gain_h; real_T nDLookupTable_tableData[96]; real_T nDLookupTable_bp01Data[8]; @@ -248,18 +248,18 @@ class FacComputer final real_T uDLookupTable_bp02Data[5]; real_T _Value; real_T Gain2_Gain_j; - real_T uDLookupTable1_tableData_j[80]; + real_T uDLookupTable1_tableData_j[96]; real_T uDLookupTable1_bp01Data_p[8]; - real_T uDLookupTable1_bp02Data_n[10]; + real_T uDLookupTable1_bp02Data_n[12]; real_T Gain3_Gain_d; real_T nDLookupTable_tableData_e[96]; real_T nDLookupTable_bp01Data_p[8]; real_T nDLookupTable_bp02Data_b[2]; real_T nDLookupTable_bp03Data_h[6]; real_T Gain2_Gain_o; - real_T uDLookupTable1_tableData_o[80]; + real_T uDLookupTable1_tableData_o[96]; real_T uDLookupTable1_bp01Data_a[8]; - real_T uDLookupTable1_bp02Data_l[10]; + real_T uDLookupTable1_bp02Data_l[12]; real_T Gain3_Gain_n; real_T nDLookupTable_tableData_p[96]; real_T nDLookupTable_bp01Data_a[8]; @@ -267,9 +267,9 @@ class FacComputer final real_T nDLookupTable_bp03Data_m[6]; real_T Switch_Threshold; real_T Gain2_Gain_c; - real_T uDLookupTable1_tableData_i[80]; + real_T uDLookupTable1_tableData_i[96]; real_T uDLookupTable1_bp01Data_l[8]; - real_T uDLookupTable1_bp02Data_p[10]; + real_T uDLookupTable1_bp02Data_p[12]; real_T Constant2_Value_c; real_T Gain3_Gain_a; real_T nDLookupTable_tableData_k[96]; diff --git a/fbw-a380x/src/wasm/fbw_a380/src/model/FacComputer_data.cpp b/fbw-a380x/src/wasm/fbw_a380/src/model/FacComputer_data.cpp index 081ddc46ec0..908fb9e8b76 100644 --- a/fbw-a380x/src/wasm/fbw_a380/src/model/FacComputer_data.cpp +++ b/fbw-a380x/src/wasm/fbw_a380/src/model/FacComputer_data.cpp @@ -1834,20 +1834,21 @@ FacComputer::Parameters_FacComputer_T FacComputer::FacComputer_P{ { 149.0, 163.0, 176.0, 188.0, 199.0, 210.0, 220.0, 231.0, 149.0, 163.0, 176.0, 189.0, 202.0, 216.0, 231.0, 243.0, 149.0, 163.0, 178.0, 193.0, 209.0, 222.0, 234.0, 246.0, 149.0, 165.0, 183.0, 199.0, 212.0, 226.0, 239.0, 252.0, 151.0, 171.0, 187.0, 202.0, 217.0, 231.0, 246.0, 260.0, 158.0, 174.0, 191.0, 207.0, 224.0, 239.0, 256.0, 270.0, - 158.0, 176.0, 193.0, 210.0, 227.0, 244.0, 259.0, 270.0, 161.0, 180.0, 198.0, 217.0, 235.0, 247.0, 259.0, 275.0, - 164.0, 185.0, 206.0, 222.0, 235.0, 250.0, 350.0, 350.0, 168.0, 191.0, 208.0, 223.0, 350.0, 350.0, 350.0, 350.0 }, + 158.0, 176.0, 193.0, 210.0, 227.0, 244.0, 259.0, 270.0, 159.0, 178.0, 196.0, 213.0, 231.0, 247.0, 259.0, 270.0, + 161.0, 180.0, 198.0, 217.0, 235.0, 247.0, 259.0, 275.0, 162.0, 182.0, 202.0, 222.0, 235.0, 247.0, 262.0, 280.0, + 164.0, 185.0, 206.0, 222.0, 235.0, 250.0, 265.0, 270.0, 168.0, 191.0, 208.0, 223.0, 235.0, 250.0, 250.0, 250.0 }, { 250.0, 300.0, 350.0, 400.0, 450.0, 500.0, 550.0, 600.0 }, - { 0.0, 10000.0, 15000.0, 20000.0, 25000.0, 30000.0, 32000.0, 36000.0, 40000.0, 43000.0 }, + { 0.0, 10000.0, 15000.0, 20000.0, 25000.0, 30000.0, 32000.0, 34000.0, 36000.0, 38000.0, 40000.0, 43000.0 }, 100.0, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 128.0, 140.0, 151.0, 162.0, 172.0, - 182.0, 191.0, 200.0, 126.0, 137.0, 148.0, 158.0, 168.0, 177.0, 186.0, 195.0, 121.0, 133.0, 144.0, 154.0, 163.0, - 172.0, 180.0, 188.0, 120.0, 130.0, 140.0, 150.0, 159.0, 167.0, 176.0, 183.0, 120.0, 128.0, 138.0, 148.0, 157.0, - 165.0, 173.0, 181.0, 120.0, 125.0, 135.0, 144.0, 153.0, 161.0, 169.0, 176.0, 120.0, 124.0, 134.0, 144.0, 152.0, - 161.0, 169.0, 176.0, 120.0, 121.0, 131.0, 140.0, 148.0, 156.0, 164.0, 171.0, 120.0, 121.0, 131.0, 140.0, 148.0, - 157.0, 165.0, 173.0, 120.0, 120.0, 127.0, 136.0, 144.0, 152.0, 160.0, 168.0 }, + 182.0, 191.0, 200.0, 126.0, 137.0, 148.0, 158.0, 168.0, 177.0, 186.0, 195.0, 123.0, 133.0, 144.0, 154.0, 163.0, + 172.0, 180.0, 188.0, 123.0, 130.0, 140.0, 150.0, 159.0, 167.0, 176.0, 183.0, 123.0, 128.0, 138.0, 148.0, 157.0, + 165.0, 173.0, 181.0, 123.0, 125.0, 135.0, 144.0, 153.0, 161.0, 169.0, 176.0, 123.0, 124.0, 134.0, 144.0, 152.0, + 161.0, 169.0, 176.0, 123.0, 123.0, 131.0, 140.0, 148.0, 156.0, 164.0, 171.0, 123.0, 123.0, 131.0, 140.0, 148.0, + 157.0, 165.0, 173.0, 123.0, 123.0, 127.0, 136.0, 144.0, 152.0, 160.0, 168.0 }, { 250.0, 300.0, 350.0, 400.0, 450.0, 500.0, 550.0, 600.0 }, @@ -1867,7 +1868,7 @@ FacComputer::Parameters_FacComputer_T FacComputer::FacComputer_P{ { 160.0, 175.0, 190.0, 205.0, 216.0, 228.0, 239.0, 252.0, 160.0, 175.0, 190.0, 205.0, 216.0, 228.0, 239.0, 252.0, 161.0, 178.0, 196.0, 219.0, 237.0, 256.0, 267.0, 277.0, 186.0, 208.0, 224.0, 241.0, 256.0, 272.0, 284.0, 292.0, - 203.0, 220.0, 236.0, 252.0, 252.0, 340.0, 340.0, 340.0 }, + 203.0, 220.0, 236.0, 252.0, 252.0, 260.0, 260.0, 260.0 }, { 250.0, 300.0, 350.0, 400.0, 450.0, 500.0, 550.0, 600.0 }, @@ -1878,20 +1879,21 @@ FacComputer::Parameters_FacComputer_T FacComputer::FacComputer_P{ { 149.0, 163.0, 176.0, 188.0, 199.0, 210.0, 220.0, 231.0, 149.0, 163.0, 176.0, 189.0, 202.0, 216.0, 231.0, 243.0, 149.0, 163.0, 178.0, 193.0, 209.0, 222.0, 234.0, 246.0, 149.0, 165.0, 183.0, 199.0, 212.0, 226.0, 239.0, 252.0, 151.0, 171.0, 187.0, 202.0, 217.0, 231.0, 246.0, 260.0, 158.0, 174.0, 191.0, 207.0, 224.0, 239.0, 256.0, 270.0, - 158.0, 176.0, 193.0, 210.0, 227.0, 244.0, 259.0, 270.0, 161.0, 180.0, 198.0, 217.0, 235.0, 247.0, 259.0, 275.0, - 164.0, 185.0, 206.0, 222.0, 235.0, 250.0, 350.0, 350.0, 168.0, 191.0, 208.0, 223.0, 350.0, 350.0, 350.0, 350.0 }, + 158.0, 176.0, 193.0, 210.0, 227.0, 244.0, 259.0, 270.0, 159.0, 178.0, 196.0, 213.0, 231.0, 247.0, 259.0, 270.0, + 161.0, 180.0, 198.0, 217.0, 235.0, 247.0, 259.0, 275.0, 162.0, 182.0, 202.0, 222.0, 235.0, 247.0, 262.0, 280.0, + 164.0, 185.0, 206.0, 222.0, 235.0, 250.0, 265.0, 270.0, 168.0, 191.0, 208.0, 223.0, 235.0, 250.0, 250.0, 250.0 }, { 250.0, 300.0, 350.0, 400.0, 450.0, 500.0, 550.0, 600.0 }, - { 0.0, 10000.0, 15000.0, 20000.0, 25000.0, 30000.0, 32000.0, 36000.0, 40000.0, 43000.0 }, + { 0.0, 10000.0, 15000.0, 20000.0, 25000.0, 30000.0, 32000.0, 34000.0, 36000.0, 38000.0, 40000.0, 43000.0 }, 100.0, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 128.0, 140.0, 151.0, 162.0, 172.0, - 182.0, 191.0, 200.0, 126.0, 137.0, 148.0, 158.0, 168.0, 177.0, 186.0, 195.0, 121.0, 133.0, 144.0, 154.0, 163.0, - 172.0, 180.0, 188.0, 120.0, 130.0, 140.0, 150.0, 159.0, 167.0, 176.0, 183.0, 120.0, 128.0, 138.0, 148.0, 157.0, - 165.0, 173.0, 181.0, 120.0, 125.0, 135.0, 144.0, 153.0, 161.0, 169.0, 176.0, 120.0, 124.0, 134.0, 144.0, 152.0, - 161.0, 169.0, 176.0, 120.0, 121.0, 131.0, 140.0, 148.0, 156.0, 164.0, 171.0, 120.0, 121.0, 131.0, 140.0, 148.0, - 157.0, 165.0, 173.0, 120.0, 120.0, 127.0, 136.0, 144.0, 152.0, 160.0, 168.0 }, + 182.0, 191.0, 200.0, 126.0, 137.0, 148.0, 158.0, 168.0, 177.0, 186.0, 195.0, 123.0, 133.0, 144.0, 154.0, 163.0, + 172.0, 180.0, 188.0, 123.0, 130.0, 140.0, 150.0, 159.0, 167.0, 176.0, 183.0, 123.0, 128.0, 138.0, 148.0, 157.0, + 165.0, 173.0, 181.0, 123.0, 125.0, 135.0, 144.0, 153.0, 161.0, 169.0, 176.0, 123.0, 124.0, 134.0, 144.0, 152.0, + 161.0, 169.0, 176.0, 123.0, 123.0, 131.0, 140.0, 148.0, 156.0, 164.0, 171.0, 123.0, 123.0, 131.0, 140.0, 148.0, + 157.0, 165.0, 173.0, 123.0, 123.0, 127.0, 136.0, 144.0, 152.0, 160.0, 168.0 }, { 250.0, 300.0, 350.0, 400.0, 450.0, 500.0, 550.0, 600.0 }, @@ -1903,20 +1905,21 @@ FacComputer::Parameters_FacComputer_T FacComputer::FacComputer_P{ { 149.0, 163.0, 176.0, 188.0, 199.0, 210.0, 220.0, 231.0, 149.0, 163.0, 176.0, 189.0, 202.0, 216.0, 231.0, 243.0, 149.0, 163.0, 178.0, 193.0, 209.0, 222.0, 234.0, 246.0, 149.0, 165.0, 183.0, 199.0, 212.0, 226.0, 239.0, 252.0, 151.0, 171.0, 187.0, 202.0, 217.0, 231.0, 246.0, 260.0, 158.0, 174.0, 191.0, 207.0, 224.0, 239.0, 256.0, 270.0, - 158.0, 176.0, 193.0, 210.0, 227.0, 244.0, 259.0, 270.0, 161.0, 180.0, 198.0, 217.0, 235.0, 247.0, 259.0, 275.0, - 164.0, 185.0, 206.0, 222.0, 235.0, 250.0, 350.0, 350.0, 168.0, 191.0, 208.0, 223.0, 350.0, 350.0, 350.0, 350.0 }, + 158.0, 176.0, 193.0, 210.0, 227.0, 244.0, 259.0, 270.0, 159.0, 178.0, 196.0, 213.0, 231.0, 247.0, 259.0, 270.0, + 161.0, 180.0, 198.0, 217.0, 235.0, 247.0, 259.0, 275.0, 162.0, 182.0, 202.0, 222.0, 235.0, 247.0, 262.0, 280.0, + 164.0, 185.0, 206.0, 222.0, 235.0, 250.0, 265.0, 270.0, 168.0, 191.0, 208.0, 223.0, 235.0, 250.0, 250.0, 250.0 }, { 250.0, 300.0, 350.0, 400.0, 450.0, 500.0, 550.0, 600.0 }, - { 0.0, 10000.0, 15000.0, 20000.0, 25000.0, 30000.0, 32000.0, 36000.0, 40000.0, 43000.0 }, + { 0.0, 10000.0, 15000.0, 20000.0, 25000.0, 30000.0, 32000.0, 34000.0, 36000.0, 38000.0, 40000.0, 43000.0 }, 100.0, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 128.0, 140.0, 151.0, 162.0, 172.0, - 182.0, 191.0, 200.0, 126.0, 137.0, 148.0, 158.0, 168.0, 177.0, 186.0, 195.0, 121.0, 133.0, 144.0, 154.0, 163.0, - 172.0, 180.0, 188.0, 120.0, 130.0, 140.0, 150.0, 159.0, 167.0, 176.0, 183.0, 120.0, 128.0, 138.0, 148.0, 157.0, - 165.0, 173.0, 181.0, 120.0, 125.0, 135.0, 144.0, 153.0, 161.0, 169.0, 176.0, 120.0, 124.0, 134.0, 144.0, 152.0, - 161.0, 169.0, 176.0, 120.0, 121.0, 131.0, 140.0, 148.0, 156.0, 164.0, 171.0, 120.0, 121.0, 131.0, 140.0, 148.0, - 157.0, 165.0, 173.0, 120.0, 120.0, 127.0, 136.0, 144.0, 152.0, 160.0, 168.0 }, + 182.0, 191.0, 200.0, 126.0, 137.0, 148.0, 158.0, 168.0, 177.0, 186.0, 195.0, 123.0, 133.0, 144.0, 154.0, 163.0, + 172.0, 180.0, 188.0, 123.0, 130.0, 140.0, 150.0, 159.0, 167.0, 176.0, 183.0, 123.0, 128.0, 138.0, 148.0, 157.0, + 165.0, 173.0, 181.0, 123.0, 125.0, 135.0, 144.0, 153.0, 161.0, 169.0, 176.0, 123.0, 124.0, 134.0, 144.0, 152.0, + 161.0, 169.0, 176.0, 123.0, 123.0, 131.0, 140.0, 148.0, 156.0, 164.0, 171.0, 123.0, 123.0, 131.0, 140.0, 148.0, + 157.0, 165.0, 173.0, 123.0, 123.0, 127.0, 136.0, 144.0, 152.0, 160.0, 168.0 }, { 250.0, 300.0, 350.0, 400.0, 450.0, 500.0, 550.0, 600.0 }, @@ -1929,21 +1932,22 @@ FacComputer::Parameters_FacComputer_T FacComputer::FacComputer_P{ { 149.0, 163.0, 176.0, 188.0, 199.0, 210.0, 220.0, 231.0, 149.0, 163.0, 176.0, 189.0, 202.0, 216.0, 231.0, 243.0, 149.0, 163.0, 178.0, 193.0, 209.0, 222.0, 234.0, 246.0, 149.0, 165.0, 183.0, 199.0, 212.0, 226.0, 239.0, 252.0, 151.0, 171.0, 187.0, 202.0, 217.0, 231.0, 246.0, 260.0, 158.0, 174.0, 191.0, 207.0, 224.0, 239.0, 256.0, 270.0, - 158.0, 176.0, 193.0, 210.0, 227.0, 244.0, 259.0, 270.0, 161.0, 180.0, 198.0, 217.0, 235.0, 247.0, 259.0, 275.0, - 164.0, 185.0, 206.0, 222.0, 235.0, 250.0, 350.0, 350.0, 168.0, 191.0, 208.0, 223.0, 350.0, 350.0, 350.0, 350.0 }, + 158.0, 176.0, 193.0, 210.0, 227.0, 244.0, 259.0, 270.0, 159.0, 178.0, 196.0, 213.0, 231.0, 247.0, 259.0, 270.0, + 161.0, 180.0, 198.0, 217.0, 235.0, 247.0, 259.0, 275.0, 162.0, 182.0, 202.0, 222.0, 235.0, 247.0, 262.0, 280.0, + 164.0, 185.0, 206.0, 222.0, 235.0, 250.0, 265.0, 270.0, 168.0, 191.0, 208.0, 223.0, 235.0, 250.0, 250.0, 250.0 }, { 250.0, 300.0, 350.0, 400.0, 450.0, 500.0, 550.0, 600.0 }, - { 0.0, 10000.0, 15000.0, 20000.0, 25000.0, 30000.0, 32000.0, 36000.0, 40000.0, 43000.0 }, + { 0.0, 10000.0, 15000.0, 20000.0, 25000.0, 30000.0, 32000.0, 34000.0, 36000.0, 38000.0, 40000.0, 43000.0 }, 0.0, 100.0, { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 128.0, 140.0, 151.0, 162.0, 172.0, - 182.0, 191.0, 200.0, 126.0, 137.0, 148.0, 158.0, 168.0, 177.0, 186.0, 195.0, 121.0, 133.0, 144.0, 154.0, 163.0, - 172.0, 180.0, 188.0, 120.0, 130.0, 140.0, 150.0, 159.0, 167.0, 176.0, 183.0, 120.0, 128.0, 138.0, 148.0, 157.0, - 165.0, 173.0, 181.0, 120.0, 125.0, 135.0, 144.0, 153.0, 161.0, 169.0, 176.0, 120.0, 124.0, 134.0, 144.0, 152.0, - 161.0, 169.0, 176.0, 120.0, 121.0, 131.0, 140.0, 148.0, 156.0, 164.0, 171.0, 120.0, 121.0, 131.0, 140.0, 148.0, - 157.0, 165.0, 173.0, 120.0, 120.0, 127.0, 136.0, 144.0, 152.0, 160.0, 168.0 }, + 182.0, 191.0, 200.0, 126.0, 137.0, 148.0, 158.0, 168.0, 177.0, 186.0, 195.0, 123.0, 133.0, 144.0, 154.0, 163.0, + 172.0, 180.0, 188.0, 123.0, 130.0, 140.0, 150.0, 159.0, 167.0, 176.0, 183.0, 123.0, 128.0, 138.0, 148.0, 157.0, + 165.0, 173.0, 181.0, 123.0, 125.0, 135.0, 144.0, 153.0, 161.0, 169.0, 176.0, 123.0, 124.0, 134.0, 144.0, 152.0, + 161.0, 169.0, 176.0, 123.0, 123.0, 131.0, 140.0, 148.0, 156.0, 164.0, 171.0, 123.0, 123.0, 131.0, 140.0, 148.0, + 157.0, 165.0, 173.0, 123.0, 123.0, 127.0, 136.0, 144.0, 152.0, 160.0, 168.0 }, { 250.0, 300.0, 350.0, 400.0, 450.0, 500.0, 550.0, 600.0 }, @@ -1999,7 +2003,7 @@ FacComputer::Parameters_FacComputer_T FacComputer::FacComputer_P{ { 3U, 5U }, - { 7U, 9U }, + { 7U, 11U }, { 7U, 1U, 5U }, @@ -2007,19 +2011,19 @@ FacComputer::Parameters_FacComputer_T FacComputer::FacComputer_P{ { 7U, 4U }, - { 7U, 9U }, + { 7U, 11U }, { 7U, 1U, 5U }, { 1U, 8U, 16U }, - { 7U, 9U }, + { 7U, 11U }, { 7U, 1U, 5U }, { 1U, 8U, 16U }, - { 7U, 9U }, + { 7U, 11U }, { 7U, 1U, 5U }, diff --git a/fbw-a380x/src/wasm/fbw_a380/src/model/FacComputer_types.h b/fbw-a380x/src/wasm/fbw_a380/src/model/FacComputer_types.h index 10721a5074b..96aff7c2da0 100644 --- a/fbw-a380x/src/wasm/fbw_a380/src/model/FacComputer_types.h +++ b/fbw-a380x/src/wasm/fbw_a380/src/model/FacComputer_types.h @@ -14,21 +14,6 @@ enum class SignStatusMatrix #endif -#ifndef DEFINED_TYPEDEF_FOR_base_fac_discrete_outputs_ -#define DEFINED_TYPEDEF_FOR_base_fac_discrete_outputs_ - -struct base_fac_discrete_outputs -{ - boolean_T fac_healthy; - boolean_T yaw_damper_engaged; - boolean_T rudder_trim_engaged; - boolean_T rudder_travel_lim_engaged; - boolean_T rudder_travel_lim_emergency_reset; - boolean_T yaw_damper_avail_for_norm_law; -}; - -#endif - #ifndef DEFINED_TYPEDEF_FOR_base_fac_analog_outputs_ #define DEFINED_TYPEDEF_FOR_base_fac_analog_outputs_ @@ -89,6 +74,21 @@ struct base_fac_bus #endif +#ifndef DEFINED_TYPEDEF_FOR_base_fac_discrete_outputs_ +#define DEFINED_TYPEDEF_FOR_base_fac_discrete_outputs_ + +struct base_fac_discrete_outputs +{ + boolean_T fac_healthy; + boolean_T yaw_damper_engaged; + boolean_T rudder_trim_engaged; + boolean_T rudder_travel_lim_engaged; + boolean_T rudder_travel_lim_emergency_reset; + boolean_T yaw_damper_avail_for_norm_law; +}; + +#endif + #ifndef DEFINED_TYPEDEF_FOR_base_fac_analog_inputs_ #define DEFINED_TYPEDEF_FOR_base_fac_analog_inputs_ From 0480ec67e14df0ac70ad9dd2180ee60a04df446a Mon Sep 17 00:00:00 2001 From: lukecologne Date: Mon, 2 Dec 2024 01:15:30 +0100 Subject: [PATCH 06/14] fix(fcu-api): fix KOHLSMANN_SET and custom baro set events (#9617) * fix: use correct multiplier for KOHLSMANN_SET * fix: add multiplier to custom baro set event for setting hpa decimals --- fbw-a32nx/docs/a320-events.md | 2 +- .../fbw_a320/src/interface/SimConnectInterface.cpp | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fbw-a32nx/docs/a320-events.md b/fbw-a32nx/docs/a320-events.md index e24ea45fe2c..9ea33cb3f77 100644 --- a/fbw-a32nx/docs/a320-events.md +++ b/fbw-a32nx/docs/a320-events.md @@ -152,7 +152,7 @@ - A32NX.FCU_EFIS_{side}_BARO_SET - Triggered to set the baro value on FCU - - Value is expected as the first parameter, in hPa. + - Value is expected as the first parameter, in hPa * 16 (i.e. with a factor 16 applied, same as KOHLSMANN_SET). - side = L, R - A32NX.FCU_EFIS_{side}_BARO_PUSH diff --git a/fbw-a32nx/src/wasm/fbw_a320/src/interface/SimConnectInterface.cpp b/fbw-a32nx/src/wasm/fbw_a320/src/interface/SimConnectInterface.cpp index f9cca670d54..68c39bf1722 100644 --- a/fbw-a32nx/src/wasm/fbw_a320/src/interface/SimConnectInterface.cpp +++ b/fbw-a32nx/src/wasm/fbw_a320/src/interface/SimConnectInterface.cpp @@ -2103,8 +2103,8 @@ void SimConnectInterface::processEvent(const DWORD eventId, const DWORD data0, c case Events::KOHLSMANN_SET: { if (data1 == 0 || data1 == 1) { - simInputAutopilot.baro_left_set = data0; - simInputAutopilot.baro_right_set = data0; + simInputAutopilot.baro_left_set = data0 / 16.; + simInputAutopilot.baro_right_set = data0 / 16.; } if (data1 != 1) { sendEventEx1(KOHLSMANN_SET, SIMCONNECT_GROUP_PRIORITY_STANDARD, data0, data1); @@ -2114,8 +2114,8 @@ void SimConnectInterface::processEvent(const DWORD eventId, const DWORD data0, c } case Events::A32NX_FCU_EFIS_L_BARO_SET: { - simInputAutopilot.baro_left_set = static_cast(data0); - simInputAutopilot.baro_right_set = static_cast(data0); + simInputAutopilot.baro_left_set = static_cast(data0) / 16.; + simInputAutopilot.baro_right_set = static_cast(data0) / 16.; std::cout << "WASM: event triggered: A32NX_FCU_EFIS_L_BARO_SET: " << static_cast(data0) << std::endl; break; } @@ -2210,8 +2210,8 @@ void SimConnectInterface::processEvent(const DWORD eventId, const DWORD data0, c } case Events::A32NX_FCU_EFIS_R_BARO_SET: { - simInputAutopilot.baro_left_set = static_cast(data0); - simInputAutopilot.baro_right_set = static_cast(data0); + simInputAutopilot.baro_left_set = static_cast(data0) / 16.; + simInputAutopilot.baro_right_set = static_cast(data0) / 16.; std::cout << "WASM: event triggered: A32NX_FCU_EFIS_R_BARO_SET: " << static_cast(data0) << std::endl; break; } From 9b045025867e45392bea91fea1f7b616a8faee53 Mon Sep 17 00:00:00 2001 From: Saschl <19493808+Saschl@users.noreply.github.com> Date: Mon, 2 Dec 2024 09:50:50 +0100 Subject: [PATCH 07/14] fix: a380 atc_model string (#9604) * fix: use unique atc_model * also adapt icao model * fix: a320 atc_type and atc_model Co-authored-by: Michael Corcoran * fix a380 atc_type and model Co-authored-by: Michael Corcoran * revert icao --------- Co-authored-by: Michael Corcoran --- .../SimObjects/AirPlanes/FlyByWire_A380_842/aircraft.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/aircraft.cfg b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/aircraft.cfg index 4f4a4983a7c..69eb20d77bc 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/aircraft.cfg +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/aircraft.cfg @@ -7,7 +7,7 @@ minor = 0 [GENERAL] atc_type = "TT:ATCCOM.ATC_NAME AIRBUS.0.text" -atc_model = "TT:ATCCOM.AC_MODEL A388.0.text" +atc_model = "TT:ATCCOM.AC_MODEL A380.0.text" Category = "airplane" performance = "Todo" editable = 1 @@ -126,7 +126,7 @@ ui_fuel_burn_rate = 5300 atc_id = "FBWA380X" icao_airline = "" atc_id_enable = 0 -atc_airline = "" +atc_airline = "FlyByWire" atc_flight_number = "380" atc_heavy = 1 atc_id_color = "0x00000000" From 677284269f45102f6ea75605364ad67a3e5f9ca0 Mon Sep 17 00:00:00 2001 From: heclak <46121009+heclak@users.noreply.github.com> Date: Mon, 2 Dec 2024 21:03:07 +0800 Subject: [PATCH 08/14] fix(A380X/lights): Fix function of FCU brightness knobs (#9588) * left FCU brightness knob now controls the brightness of the FCU windows * right FCU brightness knob controls the integral lights of the glareshield --- .github/CHANGELOG.md | 1 + .../FlyByWire_A380_842/model/A380_COCKPIT.xml | 16 ++++++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 62586caf764..3e0e019f56c 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -81,6 +81,7 @@ 1. [A32NX] Fixed APU fire detection - @tracernz (Mike) 1. [A380X/COND] Fix wasm crash during rapid decompression - @mjuhe (Miquel Juhe) 1. [A380X] Fix EWD avail. thrust fill area & PFD rudder trim visibility on ground - @flogross89 (floridude) +1. [A380X/LIGHTS] Fix function of FCU brightness knobs - @heclak (Heclak) ## 0.12.0 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 46f2224cc21..0a1ada10219 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 @@ -734,12 +734,12 @@ (L:A32NX_ELEC_DC_1_BUS_IS_POWERED, Bool) - + LIGHTING_Knob_Glareshield_2 - TT:COCKPIT.TOOLTIPS.LIGHTING_KNOB_PANEL_DECREASE - TT:COCKPIT.TOOLTIPS.LIGHTING_KNOB_PANEL_INCREASE - 84 + TT:COCKPIT.TOOLTIPS.FD_DISPLAY_BRIGHTNESS_DECREASE + TT:COCKPIT.TOOLTIPS.FD_DISPLAY_BRIGHTNESS_INCREASE + 87 @@ -826,12 +826,12 @@ (L:A32NX_ELEC_AC_1_BUS_IS_POWERED, Bool) - + LIGHTING_Knob_Glareshield_3 - TT:COCKPIT.TOOLTIPS.FD_DISPLAY_BRIGHTNESS_DECREASE - TT:COCKPIT.TOOLTIPS.FD_DISPLAY_BRIGHTNESS_INCREASE - 87 + TT:COCKPIT.TOOLTIPS.LIGHTING_KNOB_PANEL_DECREASE + TT:COCKPIT.TOOLTIPS.LIGHTING_KNOB_PANEL_INCREASE + 84 PA From 5d509b6e62772f627d0d782ab290904b3c98cdc7 Mon Sep 17 00:00:00 2001 From: Chaoz Date: Mon, 2 Dec 2024 20:31:15 +0100 Subject: [PATCH 09/14] fix(sounds): removed old sound restrictions for warning sounds (#9615) removed old sound restrictions --- .../FlyByWire_A320_NEO/sound/sound.xml | 40 ++++---------- .../FlyByWire_A380_842/sound/sound.xml | 52 +++++-------------- 2 files changed, 23 insertions(+), 69 deletions(-) diff --git a/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/sound/sound.xml b/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/sound/sound.xml index d99124c772f..1b5aced6220 100644 --- a/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/sound/sound.xml +++ b/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/SimObjects/AirPlanes/FlyByWire_A320_NEO/sound/sound.xml @@ -2152,9 +2152,7 @@ - - - + @@ -2279,69 +2277,51 @@ - - - + - - - + - - - + - - - + - - - + - - - + - - - + - - - + - - - + diff --git a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/sound/sound.xml b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/sound/sound.xml index 97a7214fa9c..cd13dc58221 100644 --- a/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/sound/sound.xml +++ b/fbw-a380x/src/base/flybywire-aircraft-a380-842/SimObjects/AirPlanes/FlyByWire_A380_842/sound/sound.xml @@ -1085,9 +1085,7 @@ - - - + @@ -1095,9 +1093,7 @@ - - - + @@ -1105,84 +1101,62 @@ - - - + - - - + - - - + - - - + - - - + - - - + - - - + - - - + - - - + - - - + - - - + From f77b5deef240f6fdcea7465f299638ec22d1e0b2 Mon Sep 17 00:00:00 2001 From: floridude <63071941+flogross89@users.noreply.github.com> Date: Tue, 3 Dec 2024 02:45:32 +0100 Subject: [PATCH 10/14] fix(a380x): Fix "NO ZFW OR ZFWCG DATA" after landing (#9623) --- .github/CHANGELOG.md | 1 + .../systems/FlightWarningSystem/FwsAbnormalSensed.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 3e0e019f56c..da109d7bc11 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -82,6 +82,7 @@ 1. [A380X/COND] Fix wasm crash during rapid decompression - @mjuhe (Miquel Juhe) 1. [A380X] Fix EWD avail. thrust fill area & PFD rudder trim visibility on ground - @flogross89 (floridude) 1. [A380X/LIGHTS] Fix function of FCU brightness knobs - @heclak (Heclak) +1. [A380X/FWS] Fix "NO ZFW OR ZFWCG DATA" ECAM alert after landing - @flogross89 (floridude) ## 0.12.0 diff --git a/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsAbnormalSensed.ts b/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsAbnormalSensed.ts index 7fcb4377886..c176a070fd2 100644 --- a/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsAbnormalSensed.ts +++ b/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsAbnormalSensed.ts @@ -2489,7 +2489,7 @@ export class FwsAbnormalSensed { }, 281800076: { // NO ZFW OR ZFWCG DATA - flightPhaseInhib: [1, 3, 4, 5, 6, 7, 9, 10, 12], + flightPhaseInhib: [1, 3, 4, 5, 6, 7, 9, 10, 11, 12], simVarIsActive: this.fws.fmsZfwOrZfwCgNotSet, whichItemsToShow: () => [true], whichItemsChecked: () => [false], From d492c0088b986a9a3dc405aacff122fcb331be6d Mon Sep 17 00:00:00 2001 From: lukecologne Date: Tue, 3 Dec 2024 22:14:53 +0100 Subject: [PATCH 11/14] fix(fcu): set QNH bit to false when in STD (#9625) --- fbw-a32nx/src/wasm/fbw_a320/src/model/FcuComputer.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/fbw-a32nx/src/wasm/fbw_a320/src/model/FcuComputer.cpp b/fbw-a32nx/src/wasm/fbw_a320/src/model/FcuComputer.cpp index c603b2afe54..0b0e0c29f97 100644 --- a/fbw-a32nx/src/wasm/fbw_a320/src/model/FcuComputer.cpp +++ b/fbw-a32nx/src/wasm/fbw_a320/src/model/FcuComputer.cpp @@ -158,10 +158,10 @@ void FcuComputer::FcuComputer_MATLABFunction_e_Reset(rtDW_MATLABFunction_FcuComp void FcuComputer::FcuComputer_MATLABFunction_o(boolean_T rtu_knob_push, boolean_T rtu_knob_pull, boolean_T rtu_qfe_avail, boolean_T *rty_std, boolean_T *rty_qnh, boolean_T *rty_qfe, rtDW_MATLABFunction_FcuComputer_d_T *localDW) { + boolean_T tmp; if (rtu_knob_push && localDW->std_active) { localDW->std_active = false; } else { - boolean_T tmp; tmp = !localDW->std_active; if (rtu_knob_push && tmp) { localDW->qnh_active = !localDW->qnh_active; @@ -177,8 +177,9 @@ void FcuComputer::FcuComputer_MATLABFunction_o(boolean_T rtu_knob_push, boolean_ } *rty_std = localDW->std_active; - *rty_qnh = localDW->qnh_active; - *rty_qfe = localDW->qfe_active; + tmp = !localDW->std_active; + *rty_qnh = (localDW->qnh_active && tmp); + *rty_qfe = (localDW->qfe_active && tmp); } void FcuComputer::FcuComputer_MATLABFunction1_n_Init(rtDW_MATLABFunction1_FcuComputer_j_T *localDW) From 2927b71d4ba68d65d17830fef7703a88d6d794cb Mon Sep 17 00:00:00 2001 From: floridude <63071941+flogross89@users.noreply.github.com> Date: Wed, 4 Dec 2024 11:44:59 +0100 Subject: [PATCH 12/14] fix(a380x): Fix erroneous "T.O SPEEDS TOO LOW" warning (#9622) * remove Vs1g t/o speed check; fix approachVls function in FMS * add T.O ECAM sensed * disable to speeds to low for now --------- Co-authored-by: Saschl <19493808+Saschl@users.noreply.github.com> --- .../src/MFD/FMC/FmcAircraftInterface.ts | 13 +++-------- .../AbnormalSensed/ata21-22-23.tsx | 21 ++++++++++++++++++ .../systems/shared/src/OperatingSpeeds.tsx | 2 +- .../FlightWarningSystem/FwsAbnormalSensed.ts | 22 ++++++++++++++++++- 4 files changed, 46 insertions(+), 12 deletions(-) diff --git a/fbw-a380x/src/systems/instruments/src/MFD/FMC/FmcAircraftInterface.ts b/fbw-a380x/src/systems/instruments/src/MFD/FMC/FmcAircraftInterface.ts index 90db7380c9e..77bbe6f40b8 100644 --- a/fbw-a380x/src/systems/instruments/src/MFD/FMC/FmcAircraftInterface.ts +++ b/fbw-a380x/src/systems/instruments/src/MFD/FMC/FmcAircraftInterface.ts @@ -6,7 +6,7 @@ import { Arinc429SignStatusMatrix, Arinc429Word, FmsOansData } from '@flybywires import { FlapConf } from '@fmgc/guidance/vnav/common'; import { FlightPlanService } from '@fmgc/index'; import { MmrRadioTuningStatus } from '@fmgc/navigation/NavaidTuner'; -import { Vmcl, Vmo, maxCertifiedAlt, maxGw, maxZfw } from '@shared/PerformanceConstants'; +import { Vmcl, Vmo, maxCertifiedAlt, maxZfw } from '@shared/PerformanceConstants'; import { FmgcFlightPhase } from '@shared/flightphase'; import { FmgcDataService } from 'instruments/src/MFD/FMC/fmgc'; import { ADIRS } from 'instruments/src/MFD/shared/Adirs'; @@ -321,17 +321,10 @@ export class FmcAircraftInterface { return false; } - const taxiFuel = this.fmgc.data.taxiFuel.get() ?? 0; - const tow = (this.fmc.fmgc.getGrossWeightKg() ?? maxGw) - (this.fmgc.isAnEngineOn() ? 0 : taxiFuel); - const flapConf = this.fmgc.data.takeoffFlapsSetting.get(); - return ( (this.flightPlanService.active.performanceData.v1 ?? Infinity) < Math.trunc(A380SpeedsUtils.getVmcg(zp)) || (this.flightPlanService.active.performanceData.vr ?? Infinity) < Math.trunc(1.05 * A380SpeedsUtils.getVmca(zp)) || - (this.flightPlanService.active.performanceData.v2 ?? Infinity) < Math.trunc(1.1 * A380SpeedsUtils.getVmca(zp)) || - (Number.isFinite(tow) && - (this.flightPlanService.active.performanceData.v2 ?? Infinity) < - Math.trunc(1.13 * A380SpeedsUtils.getVs1g(tow, flapConf > 1 ? flapConf + 1 : flapConf, true))) + (this.flightPlanService.active.performanceData.v2 ?? Infinity) < Math.trunc(1.1 * A380SpeedsUtils.getVmca(zp)) ); } @@ -370,7 +363,7 @@ export class FmcAircraftInterface { this.toSpeedsNotInserted = toSpeedsNotInserted; } - const toSpeedsTooLow = this.getToSpeedsTooLow(); + const toSpeedsTooLow = false; // FIXME revert once speeds are checked this.getToSpeedsTooLow(); if (toSpeedsTooLow !== this.toSpeedsTooLow) { this.toSpeedsTooLow = toSpeedsTooLow; if (toSpeedsTooLow) { diff --git a/fbw-a380x/src/systems/instruments/src/MsfsAvionicsCommon/EcamMessages/AbnormalSensed/ata21-22-23.tsx b/fbw-a380x/src/systems/instruments/src/MsfsAvionicsCommon/EcamMessages/AbnormalSensed/ata21-22-23.tsx index 0f869ac671f..d7ca1ef2db4 100644 --- a/fbw-a380x/src/systems/instruments/src/MsfsAvionicsCommon/EcamMessages/AbnormalSensed/ata21-22-23.tsx +++ b/fbw-a380x/src/systems/instruments/src/MsfsAvionicsCommon/EcamMessages/AbnormalSensed/ata21-22-23.tsx @@ -1850,6 +1850,27 @@ export const EcamAbnormalSensedAta212223: { [n: number]: AbnormalProcedure } = { sensed: true, items: [], }, + 221800008: { + title: '\x1b<4m\x1b4mT.O\x1bm SPEEDS TOO LOW', + sensed: true, + items: [ + { + name: 'TOW & T.O DATA', + sensed: false, + labelNotCompleted: 'CHECK', + }, + ], + }, + 221800009: { + title: '\x1b<4m\x1b4mT.O\x1bm V1/VR/V2 DISAGREE', + sensed: true, + items: [], + }, + 221800010: { + title: '\x1b<2m\x1b4mT.O\x1bm ACCELERATION DEGRADED', + sensed: true, + items: [], + }, 230800001: { title: '\x1b<4m\x1b4mCAB COM\x1bm CIDS 1+2+3 FAULT', sensed: true, diff --git a/fbw-a380x/src/systems/shared/src/OperatingSpeeds.tsx b/fbw-a380x/src/systems/shared/src/OperatingSpeeds.tsx index 9dad3515864..d5d9974aaf6 100644 --- a/fbw-a380x/src/systems/shared/src/OperatingSpeeds.tsx +++ b/fbw-a380x/src/systems/shared/src/OperatingSpeeds.tsx @@ -116,7 +116,7 @@ export class SpeedsLookupTables { }; static getApproachVls(conf: number, cg: number, weight: number): number { - if (conf === 1) { + if (conf === 0) { return SpeedsLookupTables.VLS_CONF_0.get(0, weight); } else { return SpeedsLookupTables.VLS_APPR_CONF[conf].get(cg, weight); diff --git a/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsAbnormalSensed.ts b/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsAbnormalSensed.ts index c176a070fd2..9e3583db849 100644 --- a/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsAbnormalSensed.ts +++ b/fbw-a380x/src/systems/systems-host/systems/FlightWarningSystem/FwsAbnormalSensed.ts @@ -1550,7 +1550,7 @@ export class FwsAbnormalSensed { }, 221800007: { // TO SPEEDS NOT INSERTED - flightPhaseInhib: [1, 4, 5, 6, 7, 8, 9, 10], + flightPhaseInhib: [1, 4, 5, 6, 7, 8, 9, 10, 12], simVarIsActive: this.fws.toSpeedsNotInsertedWarning, notActiveWhenFaults: [], whichItemsToShow: () => [], @@ -1558,6 +1558,26 @@ export class FwsAbnormalSensed { failure: 2, sysPage: -1, }, + 221800008: { + // TO SPEEDS TOO LOW + flightPhaseInhib: [1, 4, 5, 6, 7, 8, 9, 10, 12], + simVarIsActive: this.fws.toSpeedsTooLowWarning, + notActiveWhenFaults: [], + whichItemsToShow: () => [true], + whichItemsChecked: () => [false], + failure: 2, + sysPage: -1, + }, + 221800009: { + // TO V1/VR/V2 DISAGREE + flightPhaseInhib: [1, 4, 5, 6, 7, 8, 9, 10, 12], + simVarIsActive: this.fws.toV2VRV2DisagreeWarning, + notActiveWhenFaults: [], + whichItemsToShow: () => [], + whichItemsChecked: () => [], + failure: 2, + sysPage: -1, + }, // 23 - COMMUNICATION 230800012: { // RMP 1 FAULT From cacb841249573b2a6b9780f57de5db4112925faf Mon Sep 17 00:00:00 2001 From: BravoMike99 <119708186+BravoMike99@users.noreply.github.com> Date: Thu, 5 Dec 2024 22:13:19 +0000 Subject: [PATCH 13/14] fix(A32NX/EWD): Change fuel flow steps to 20kg/40lb per hour (#9591) fix(ewd): change fuel flow steps to 20kg/40lb per hour --- .github/CHANGELOG.md | 1 + fbw-a32nx/src/systems/instruments/src/EWD/FF.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index da109d7bc11..872219b842c 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -80,6 +80,7 @@ 1. [FMS] Fixed issue with airport loading timing out on MSFS2024 - @tracernz (Mike) 1. [A32NX] Fixed APU fire detection - @tracernz (Mike) 1. [A380X/COND] Fix wasm crash during rapid decompression - @mjuhe (Miquel Juhe) +1. [A32NX/EWD] Corrected fuel flow step to 20kg/40lbs per hour - @BravoMike99 (bruno_pt99) 1. [A380X] Fix EWD avail. thrust fill area & PFD rudder trim visibility on ground - @flogross89 (floridude) 1. [A380X/LIGHTS] Fix function of FCU brightness knobs - @heclak (Heclak) 1. [A380X/FWS] Fix "NO ZFW OR ZFWCG DATA" ECAM alert after landing - @flogross89 (floridude) diff --git a/fbw-a32nx/src/systems/instruments/src/EWD/FF.tsx b/fbw-a32nx/src/systems/instruments/src/EWD/FF.tsx index 8fb90cfc429..18be19811e4 100644 --- a/fbw-a32nx/src/systems/instruments/src/EWD/FF.tsx +++ b/fbw-a32nx/src/systems/instruments/src/EWD/FF.tsx @@ -41,7 +41,7 @@ export class FF extends DisplayComponent { .atFrequency(1) .handle((ff) => { const metric = this.props.metric.get(); - this.ff.set(fuelForDisplay(ff, metric ? '1' : '0')); + this.ff.set(fuelForDisplay(ff, metric ? '1' : '0', 1, 2)); }); } From 5c8071bbb9a43dc5ca6c172ce3c19ee79a68a222 Mon Sep 17 00:00:00 2001 From: heclak <46121009+heclak@users.noreply.github.com> Date: Fri, 6 Dec 2024 08:43:04 +0800 Subject: [PATCH 14/14] feat(A380X/SD): Add brake temperature color change to amber when brakes hot (#9550) * feat(A380X/SD): Add brake temperature color change to amber when exceeding 300 degrees celcius * docs: add changelog --- .github/CHANGELOG.md | 2 ++ .../systems/instruments/src/SD/Pages/Wheel/elements/Wheel.tsx | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 872219b842c..b2ab327b87b 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -84,6 +84,8 @@ 1. [A380X] Fix EWD avail. thrust fill area & PFD rudder trim visibility on ground - @flogross89 (floridude) 1. [A380X/LIGHTS] Fix function of FCU brightness knobs - @heclak (Heclak) 1. [A380X/FWS] Fix "NO ZFW OR ZFWCG DATA" ECAM alert after landing - @flogross89 (floridude) +1. [A380X/SD] Add brake temperature color change to amber when brakes are hot - @heclak (Heclak) + ## 0.12.0 diff --git a/fbw-a380x/src/systems/instruments/src/SD/Pages/Wheel/elements/Wheel.tsx b/fbw-a380x/src/systems/instruments/src/SD/Pages/Wheel/elements/Wheel.tsx index 6fd2fffbeca..154f37b6f03 100644 --- a/fbw-a380x/src/systems/instruments/src/SD/Pages/Wheel/elements/Wheel.tsx +++ b/fbw-a380x/src/systems/instruments/src/SD/Pages/Wheel/elements/Wheel.tsx @@ -37,7 +37,7 @@ export const Wheel: FC = ({ x, y, number, isLeftSide, hasBrake, more d={`m ${negativeSign}15,18 v -36 M ${negativeSign}21,18 v -36 M ${negativeSign}27,18 v -36 M ${negativeSign}33,18 v -36`} /> - + 300 ? 'Amber' : 'Green'}`} x={isLeftSide ? -16 : 72} y={-16}> {roundTemperature(brakeTemp)}