diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index e6fcd8ae2f6..5d4f465d22e 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -107,6 +107,7 @@ 1. [A380X/ENGINES] Adjust climb thrust to be more accurate - @BlueberryKing (BlueberryKing) 1. [A380X/EWD] Show THR limit in EWD instead of N1 - @flogross89 (floridude) 1. [A380X/FLIGHT MODEL] Fix pitchup and unrecoverable stall - - @donstim (donbikes#4084) +1. [PFD] Add LS button reminder - @BravoMike99 (bruno_pt99) ## 0.12.0 diff --git a/fbw-a32nx/src/systems/instruments/src/PFD/LandingSystemIndicator.tsx b/fbw-a32nx/src/systems/instruments/src/PFD/LandingSystemIndicator.tsx index 8de2a9b9640..9cead80f4db 100644 --- a/fbw-a32nx/src/systems/instruments/src/PFD/LandingSystemIndicator.tsx +++ b/fbw-a32nx/src/systems/instruments/src/PFD/LandingSystemIndicator.tsx @@ -15,13 +15,16 @@ import { Subscription, VNode, } from '@microsoft/msfs-sdk'; -import { ArincEventBus, Arinc429RegisterSubject, MathUtils } from '@flybywiresim/fbw-sdk'; +import { ArincEventBus, Arinc429RegisterSubject, MathUtils, Arinc429ConsumerSubject } from '@flybywiresim/fbw-sdk'; import { getDisplayIndex } from 'instruments/src/PFD/PFD'; import { FcuBus } from 'instruments/src/PFD/shared/FcuBusProvider'; import { Arinc429Values } from './shared/ArincValueProvider'; import { PFDSimvars } from './shared/PFDSimvarPublisher'; import { LagFilter } from './PFDUtils'; +import { FmgcFlightPhase } from '@shared/flightphase'; +import { FlashOneHertz } from '../MsfsAvionicsCommon/FlashingElementUtils'; +import { FgBus } from './shared/FgBusProvider'; // FIXME true ref export class LandingSystem extends DisplayComponent<{ bus: ArincEventBus; instrument: BaseInstrument }> { @@ -92,6 +95,9 @@ export class LandingSystem extends DisplayComponent<{ bus: ArincEventBus; instru d="m 114.84887,80.06669 v 1.51188 h -8.43284 v -1.51188 z" /> + + + @@ -741,3 +747,59 @@ class MarkerBeaconIndicator extends DisplayComponent<{ bus: ArincEventBus }> { ); } } + +class LsReminderIndicator extends DisplayComponent<{ bus: ArincEventBus }> { + private readonly sub = this.props.bus.getSubscriber(); + + private readonly glsMlsFlsOrLocVnavInstalled = Subject.create(false); + + private readonly fwcFlightPhase = ConsumerSubject.create(this.sub.on('fwcFlightPhase'), 0); + + private readonly fmgcFlightPhase = ConsumerSubject.create(this.sub.on('fmgcFlightPhase'), FmgcFlightPhase.Preflight); + + private readonly fmgcDiscreteWord2 = Arinc429ConsumerSubject.create(this.sub.on('fmgcDiscreteWord3')); + + private readonly fmgcDiscreteWord4 = Arinc429ConsumerSubject.create(this.sub.on('fmgcDiscreteWord4')); + + private readonly landModeArmedOrActive = MappedSubject.create( + ([fmgcDiscreteWord2, fmgcDiscreteWord4]) => + fmgcDiscreteWord4.bitValueOr(14, false) || fmgcDiscreteWord2.bitValueOr(20, false), + this.fmgcDiscreteWord2, + this.fmgcDiscreteWord4, + ); + + private readonly fcuEisDiscreteWord2 = Arinc429ConsumerSubject.create(this.sub.on('fcuEisDiscreteWord2')); + + private readonly lsPushed = this.fcuEisDiscreteWord2.map((w) => w.bitValueOr(22, false)); + + private readonly lsReminderVisible = MappedSubject.create( + ([fwcPhase, fmgcPhase, landModeArmedOrActive, lsPushed]) => { + return ( + landModeArmedOrActive && + fmgcPhase === FmgcFlightPhase.Approach && + !lsPushed && // TODO Check if LOC or G/S scales are invalid + fwcPhase !== 8 && + fwcPhase !== 9 && + fwcPhase !== 10 + ); + }, + this.fwcFlightPhase, + this.fmgcFlightPhase, + this.landModeArmedOrActive, + this.lsPushed, + ); + + onAfterRender(node: VNode): void { + super.onAfterRender(node); + } + + render(): VNode { + return ( + + + {this.glsMlsFlsOrLocVnavInstalled.map((v) => (v ? 'LS' : 'ILS'))} + + + ); + } +} diff --git a/fbw-a380x/src/systems/instruments/src/PFD/LandingSystemIndicator.tsx b/fbw-a380x/src/systems/instruments/src/PFD/LandingSystemIndicator.tsx index ffb26b26731..7a7d6b2fa50 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/LandingSystemIndicator.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/LandingSystemIndicator.tsx @@ -13,6 +13,7 @@ import { Arinc429Word } from '@flybywiresim/fbw-sdk'; import { Arinc429Values } from './shared/ArincValueProvider'; import { PFDSimvars } from './shared/PFDSimvarPublisher'; import { LagFilter } from './PFDUtils'; +import { FmgcFlightPhase } from '@shared/flightphase'; export class LandingSystem extends DisplayComponent<{ bus: EventBus; instrument: BaseInstrument }> { private lsButtonPressedVisibility = false; @@ -95,11 +96,14 @@ export class LandingSystem extends DisplayComponent<{ bus: EventBus; instrument: - + - + + + +