diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 27d3ea96b20..73af12970ea 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -98,6 +98,7 @@ 1. [ELEC] Improved elec system startup behaviour - @Gurgel100 (Pascal) - @saschl 1. [A380X] Improve pilot and copilot camera positions - @heclak (Heclak) 1. [A380X/EFIS] Illuminate ND range and mode selectors during light test - @BravoMike99 (bruno_pt99) +1. [A380X/FCU] Add TRUE indication on FCU when TRUE North reference is selected on AFS CP - @heclak (Heclak) ## 0.12.0 diff --git a/fbw-a380x/src/systems/instruments/src/FCU/Components/FcuDisplay.tsx b/fbw-a380x/src/systems/instruments/src/FCU/Components/FcuDisplay.tsx index 0cedd3f7c53..049b700da4c 100644 --- a/fbw-a380x/src/systems/instruments/src/FCU/Components/FcuDisplay.tsx +++ b/fbw-a380x/src/systems/instruments/src/FCU/Components/FcuDisplay.tsx @@ -22,7 +22,7 @@ export class FcuDisplay extends DisplayComponent {
(v ? 'off' : 'on'))}>
- +
diff --git a/fbw-a380x/src/systems/instruments/src/FCU/Components/Heading.tsx b/fbw-a380x/src/systems/instruments/src/FCU/Components/Heading.tsx index 955d1172902..dece5c269cf 100644 --- a/fbw-a380x/src/systems/instruments/src/FCU/Components/Heading.tsx +++ b/fbw-a380x/src/systems/instruments/src/FCU/Components/Heading.tsx @@ -1,16 +1,58 @@ // Copyright (c) 2023-2024 FlyByWire Simulations // SPDX-License-Identifier: GPL-3.0 -import { DisplayComponent, FSComponent, VNode } from '@microsoft/msfs-sdk'; +import { + ConsumerSubject, + DisplayComponent, + EventBus, + FSComponent, + MappedSubject, + SubscribableMapFunctions, + VNode, +} from '@microsoft/msfs-sdk'; +import { FcuEvents } from 'instruments/src/FCU/Publishers/FcuPublisher'; +import { OverheadEvents } from 'instruments/src/MsfsAvionicsCommon/providers/OverheadPublisher'; -export interface HeadingProps {} +export interface HeadingProps { + readonly bus: EventBus; +} export class Heading extends DisplayComponent { + private readonly sub = this.props.bus.getSubscriber(); + + private readonly isLightTestActive = ConsumerSubject.create(this.sub.on('ovhd_ann_lt_test_active'), false); + private readonly trueRefActive = ConsumerSubject.create(this.sub.on('fcu_push_true_ref'), false); + + private readonly trueIndicatorActive = MappedSubject.create( + ([isLightTest, trueRef]) => { + if (isLightTest) { + return true; + } else { + return trueRef; + } + }, + this.isLightTestActive, + this.trueRefActive, + ); + + onAfterRender(node: VNode): void { + super.onAfterRender(node); + } + render(): VNode | null { return (
- + TRUE diff --git a/fbw-a380x/src/systems/instruments/src/FCU/Managers/HeadingManager.ts b/fbw-a380x/src/systems/instruments/src/FCU/Managers/HeadingManager.ts index f08d9ace0fa..54a4b55d550 100644 --- a/fbw-a380x/src/systems/instruments/src/FCU/Managers/HeadingManager.ts +++ b/fbw-a380x/src/systems/instruments/src/FCU/Managers/HeadingManager.ts @@ -222,12 +222,10 @@ export class HeadingManager extends TemporaryHax implements Instrument { this.isTRKMode = _isTRKMode; this.showSelectedHeading = _showSelectedHeading; this.currentValue = _value; - this.setTextElementActive(this.textTRUE, false); this.setTextElementActive(this.textHDG, !this.isTRKMode); this.setTextElementActive(this.textTRK, !!this.isTRKMode); this.lightsTest = _lightsTest; if (this.lightsTest) { - this.setTextElementActive(this.textTRUE, true); this.setTextElementActive(this.textHDG, true); this.setTextElementActive(this.textTRK, true); this.setElementVisibility(this.signDegrees, true); diff --git a/fbw-a380x/src/systems/instruments/src/FCU/Publishers/FcuPublisher.ts b/fbw-a380x/src/systems/instruments/src/FCU/Publishers/FcuPublisher.ts index 06a6a82ab5c..2d7422ed54d 100644 --- a/fbw-a380x/src/systems/instruments/src/FCU/Publishers/FcuPublisher.ts +++ b/fbw-a380x/src/systems/instruments/src/FCU/Publishers/FcuPublisher.ts @@ -9,6 +9,7 @@ interface FcuBaseEvents { fcu_trk_fpa_active: boolean; fcu_left_navaid_mode: NavAidMode; fcu_right_navaid_mode: NavAidMode; + fcu_push_true_ref: boolean; } type IndexedTopics = 'fcu_left_navaid_mode' | 'fcu_right_navaid_mode'; @@ -36,6 +37,7 @@ export class FcuPublisher extends SimVarPublisher { 'fcu_right_navaid_mode', { name: `L:A32NX_EFIS_R_NAVAID_#index#_MODE`, type: SimVarValueType.Enum, indexed: true }, ], + ['fcu_push_true_ref', { name: `L:A32NX_PUSH_TRUE_REF`, type: SimVarValueType.Bool }], ]); super(simvars, bus, pacer);