diff --git a/src/instruments/src/PFD/AttitudeIndicatorHorizon.tsx b/src/instruments/src/PFD/AttitudeIndicatorHorizon.tsx index bed75bfc1990..3d03ab482d0c 100644 --- a/src/instruments/src/PFD/AttitudeIndicatorHorizon.tsx +++ b/src/instruments/src/PFD/AttitudeIndicatorHorizon.tsx @@ -1,6 +1,7 @@ import { ClockEvents, DisplayComponent, EventBus, FSComponent, Subject, Subscribable, VNode } from 'msfssdk'; import { Arinc429Word } from '@shared/arinc429'; +import { DisplayManagementComputerEvents } from 'instruments/src/PFD/shared/DisplayManagementComputer'; import { calculateHorizonOffsetFromPitch, calculateVerticalOffsetFromRoll, @@ -44,7 +45,7 @@ class HeadingBug extends DisplayComponent<{bus: EventBus, isCaptainSide: boolean onAfterRender(node: VNode): void { super.onAfterRender(node); - const sub = this.props.bus.getSubscriber(); + const sub = this.props.bus.getSubscriber(); sub.on('selectedHeading').whenChanged().handle((s) => { this.selectedHeading = s; @@ -53,7 +54,7 @@ class HeadingBug extends DisplayComponent<{bus: EventBus, isCaptainSide: boolean } }); - sub.on('headingAr').handle((h) => { + sub.on('heading').handle((h) => { this.heading = h; if (this.isActive) { this.calculateAndSetOffset(); diff --git a/src/instruments/src/PFD/HeadingIndicator.tsx b/src/instruments/src/PFD/HeadingIndicator.tsx index f7d00bf78c5c..8f2d09b41cb5 100644 --- a/src/instruments/src/PFD/HeadingIndicator.tsx +++ b/src/instruments/src/PFD/HeadingIndicator.tsx @@ -1,4 +1,5 @@ import { DisplayComponent, EventBus, FSComponent, HEvent, Subject, Subscribable, VNode } from 'msfssdk'; +import { DisplayManagementComputerEvents } from 'instruments/src/PFD/shared/DisplayManagementComputer'; import { HorizontalTape } from './HorizontalTape'; import { getSmallestAngle } from './PFDUtils'; import { PFDSimvars } from './shared/PFDSimvarPublisher'; @@ -60,9 +61,9 @@ export class HeadingOfftape extends DisplayComponent<{ bus: EventBus, failed: Su onAfterRender(node: VNode): void { super.onAfterRender(node); - const sub = this.props.bus.getSubscriber(); + const sub = this.props.bus.getSubscriber(); - sub.on('headingAr').handle((h) => { + sub.on('heading').handle((h) => { this.heading.set(h.value); if (h.isNormalOperation()) { @@ -99,6 +100,7 @@ export class HeadingOfftape extends DisplayComponent<{ bus: EventBus, failed: Su + ); @@ -207,9 +209,9 @@ class GroundTrackBug extends DisplayComponent { onAfterRender(node: VNode): void { super.onAfterRender(node); - const sub = this.props.bus.getSubscriber(); + const sub = this.props.bus.getSubscriber(); - sub.on('groundTrackAr').handle((groundTrack) => { + sub.on('track').handle((groundTrack) => { // if (groundTrack.isNormalOperation()) { const offset = getSmallestAngle(groundTrack.value, this.props.heading.get()) * DistanceSpacing / ValueSpacing; this.trackIndicator.instance.style.display = 'inline'; @@ -339,3 +341,27 @@ class QFUIndicator extends DisplayComponent<{ ILSCourse: Subscribable, h ); } } + +interface TrueFlagProps { + bus: EventBus; +} + +class TrueFlag extends DisplayComponent { + private trueRefActive = Subject.create(false); + + /** @inheritdoc */ + // eslint-disable-next-line @typescript-eslint/no-unused-vars + onAfterRender(node: VNode): void { + this.props.bus.getSubscriber().on('trueRefActive').whenChanged().handle((v) => this.trueRefActive.set(v)); + } + + /** @inheritdoc */ + render(): VNode { + return ( + + + TRUE + + ); + } +} diff --git a/src/instruments/src/PFD/HorizontalTape.tsx b/src/instruments/src/PFD/HorizontalTape.tsx index 07bba69d2613..72cd6f08a055 100644 --- a/src/instruments/src/PFD/HorizontalTape.tsx +++ b/src/instruments/src/PFD/HorizontalTape.tsx @@ -1,3 +1,4 @@ +import { DisplayManagementComputerEvents } from 'instruments/src/PFD/shared/DisplayManagementComputer'; import { EventBus, DisplayComponent, FSComponent, NodeReference, VNode, Subscribable } from 'msfssdk'; import { Arinc429Values } from './shared/ArincValueProvider'; @@ -118,14 +119,14 @@ export class HorizontalTape extends DisplayComponent { onAfterRender(node: VNode): void { super.onAfterRender(node); - const pf = this.props.bus.getSubscriber(); + const pf = this.props.bus.getSubscriber(); this.props.yOffset?.sub((yOffset) => { this.yOffset = yOffset; this.refElement.instance.style.transform = `translate3d(${this.tapeOffset}px, ${yOffset}px, 0px)`; }); - pf.on('headingAr').handle((newVal) => { + pf.on('heading').handle((newVal) => { const multiplier = 100; const currentValueAtPrecision = Math.round(newVal.value * multiplier) / multiplier; const tapeOffset = -currentValueAtPrecision % 10 * this.props.distanceSpacing / this.props.valueSpacing; diff --git a/src/instruments/src/PFD/LandingSystemIndicator.tsx b/src/instruments/src/PFD/LandingSystemIndicator.tsx index 96c87d480d7f..08822d2acb46 100644 --- a/src/instruments/src/PFD/LandingSystemIndicator.tsx +++ b/src/instruments/src/PFD/LandingSystemIndicator.tsx @@ -5,6 +5,7 @@ import { Arinc429Values } from './shared/ArincValueProvider'; import { PFDSimvars } from './shared/PFDSimvarPublisher'; import { LagFilter } from './PFDUtils'; +// TODO true ref export class LandingSystem extends DisplayComponent<{ bus: EventBus, instrument: BaseInstrument }> { private lsButtonPressedVisibility = false; diff --git a/src/instruments/src/PFD/PFD.svg b/src/instruments/src/PFD/PFD.svg index e3624420549e..e99d3577ad37 100644 --- a/src/instruments/src/PFD/PFD.svg +++ b/src/instruments/src/PFD/PFD.svg @@ -13,7 +13,7 @@ version="1.1" id="svg1876" sodipodi:docname="PFD.svg" - inkscape:version="1.0.2-2 (e86c870879, 2021-01-15)"> + inkscape:version="1.0.2 (e86c870879, 2021-01-15, custom)">