From 4e0a203bef7112a077b839ba75fb53904d76dc4e Mon Sep 17 00:00:00 2001 From: BBK <22713769+BlueberryKing@users.noreply.github.com> Date: Wed, 13 Sep 2023 21:12:34 +0200 Subject: [PATCH 1/6] Move trans alt/lvl to FMGC bus --- .../systems/fmgc/src/components/EfisLabels.ts | 21 ++++++++++++++----- .../instruments/src/PFD/AltitudeIndicator.tsx | 18 ++++++++-------- .../src/PFD/AttitudeIndicatorHorizon.tsx | 18 +++++++++------- .../src/PFD/shared/ArincValueProvider.ts | 6 ++++++ .../src/PFD/shared/PFDSimvarPublisher.tsx | 18 ++++++++++------ 5 files changed, 53 insertions(+), 28 deletions(-) diff --git a/fbw-a32nx/src/systems/fmgc/src/components/EfisLabels.ts b/fbw-a32nx/src/systems/fmgc/src/components/EfisLabels.ts index ecc77056fa4..32249e36fa5 100644 --- a/fbw-a32nx/src/systems/fmgc/src/components/EfisLabels.ts +++ b/fbw-a32nx/src/systems/fmgc/src/components/EfisLabels.ts @@ -1,11 +1,11 @@ -import { FlightLevel } from '@fmgc/guidance/vnav/verticalFlightPlan/VerticalFlightPlan'; import { FlightPlanManager } from '@fmgc/wtsdk'; +import { Arinc429SignStatusMatrix, Arinc429Word } from '@flybywiresim/fbw-sdk'; import { FmgcComponent } from './FmgcComponent'; export class EfisLabels implements FmgcComponent { private lastTransitionAltitude: Feet; - private lastTransitionLevel: FlightLevel; + private lastTransitionLevel: number; private flightPlanManager: FlightPlanManager; @@ -17,14 +17,25 @@ export class EfisLabels implements FmgcComponent { const transitionAltitude = this.flightPlanManager.originTransitionAltitude; const transitionLevel = this.flightPlanManager.destinationTransitionLevel; - // FIXME ARINC429 when the PR adding a TS impl. lands... if (transitionAltitude !== this.lastTransitionAltitude) { - SimVar.SetSimVarValue('L:AIRLINER_TRANS_ALT', 'Number', transitionAltitude ?? 0); + Arinc429Word.toSimVarValue( + 'L:A32NX_FM1_TRANS_ALT', transitionAltitude ?? 0, transitionAltitude !== undefined ? Arinc429SignStatusMatrix.NormalOperation : Arinc429SignStatusMatrix.NoComputedData, + ); + Arinc429Word.toSimVarValue( + 'L:A32NX_FM2_TRANS_ALT', transitionAltitude ?? 0, transitionAltitude !== undefined ? Arinc429SignStatusMatrix.NormalOperation : Arinc429SignStatusMatrix.NoComputedData, + ); + this.lastTransitionAltitude = transitionAltitude; } if (transitionLevel !== this.lastTransitionLevel) { - SimVar.SetSimVarValue('L:AIRLINER_APPR_TRANS_ALT', 'Number', (transitionLevel ?? 0) * 100); + Arinc429Word.toSimVarValue( + 'L:A32NX_FM1_TRANS_LVL', transitionLevel ?? 0, transitionLevel !== undefined ? Arinc429SignStatusMatrix.NormalOperation : Arinc429SignStatusMatrix.NoComputedData, + ); + Arinc429Word.toSimVarValue( + 'L:A32NX_FM2_TRANS_LVL', transitionLevel ?? 0, transitionLevel !== undefined ? Arinc429SignStatusMatrix.NormalOperation : Arinc429SignStatusMatrix.NoComputedData, + ); + this.lastTransitionLevel = transitionLevel; } } diff --git a/fbw-a32nx/src/systems/instruments/src/PFD/AltitudeIndicator.tsx b/fbw-a32nx/src/systems/instruments/src/PFD/AltitudeIndicator.tsx index 39c3d77bcb8..d6332fd7669 100644 --- a/fbw-a32nx/src/systems/instruments/src/PFD/AltitudeIndicator.tsx +++ b/fbw-a32nx/src/systems/instruments/src/PFD/AltitudeIndicator.tsx @@ -541,9 +541,9 @@ class AltimeterIndicator extends DisplayComponent { private unit = ''; - private transAlt = 0; + private transAltAr = Arinc429Word.empty(); - private transAltAppr = 0; + private transLvlAr = Arinc429Word.empty(); private flightPhase = 0; @@ -556,7 +556,7 @@ class AltimeterIndicator extends DisplayComponent { onAfterRender(node: VNode): void { super.onAfterRender(node); - const sub = this.props.bus.getSubscriber(); + const sub = this.props.bus.getArincSubscriber(); sub.on('baroMode').whenChanged().handle((m) => { if (m === 'QFE') { @@ -589,15 +589,15 @@ class AltimeterIndicator extends DisplayComponent { this.handleBlink(); }); - sub.on('transAlt').whenChanged().handle((ta) => { - this.transAlt = ta; + sub.on('fmTransAltRaw').whenChanged().handle((ta) => { + this.transAltAr = new Arinc429Word(ta); this.handleBlink(); this.getText(); }); - sub.on('transAltAppr').whenChanged().handle((ta) => { - this.transAltAppr = ta; + sub.on('fmTransLvlRaw').whenChanged().handle((tl) => { + this.transLvlAr = new Arinc429Word(tl); this.handleBlink(); this.getText(); @@ -620,12 +620,12 @@ class AltimeterIndicator extends DisplayComponent { private handleBlink() { if (this.mode.get() === 'STD') { - if (this.flightPhase > 3 && this.transAltAppr > this.props.altitude.get() && this.transAltAppr !== 0) { + if (this.flightPhase > 3 && this.transLvlAr.isNormalOperation() && 100 * this.transLvlAr.value > this.props.altitude.get()) { this.stdGroup.instance.classList.add('BlinkInfinite'); } else { this.stdGroup.instance.classList.remove('BlinkInfinite'); } - } else if (this.flightPhase <= 3 && this.transAlt < this.props.altitude.get() && this.transAlt !== 0) { + } else if (this.flightPhase <= 3 && this.transAltAr.isNormalOperation() && this.transAltAr.value < this.props.altitude.get()) { this.qfeGroup.instance.classList.add('BlinkInfinite'); } else { this.qfeGroup.instance.classList.remove('BlinkInfinite'); diff --git a/fbw-a32nx/src/systems/instruments/src/PFD/AttitudeIndicatorHorizon.tsx b/fbw-a32nx/src/systems/instruments/src/PFD/AttitudeIndicatorHorizon.tsx index 74578b4bb7a..9c5bf3b6909 100644 --- a/fbw-a32nx/src/systems/instruments/src/PFD/AttitudeIndicatorHorizon.tsx +++ b/fbw-a32nx/src/systems/instruments/src/PFD/AttitudeIndicatorHorizon.tsx @@ -309,9 +309,9 @@ class RadioAltAndDH extends DisplayComponent<{ bus: ArincEventBus, filteredRadio private radioAltitude = new Arinc429Word(0); - private transAlt = 0; + private transAltAr = Arinc429Word.empty(); - private transAltAppr = 0; + private transLvlAr = Arinc429Word.empty(); private fmgcFlightPhase = 0; @@ -334,12 +334,12 @@ class RadioAltAndDH extends DisplayComponent<{ bus: ArincEventBus, filteredRadio this.roll = roll; }); - sub.on('transAlt').whenChanged().handle((ta) => { - this.transAlt = ta; + sub.on('fmTransAltRaw').whenChanged().handle((ta) => { + this.transAltAr = new Arinc429Word(ta); }); - sub.on('transAltAppr').whenChanged().handle((ta) => { - this.transAltAppr = ta; + sub.on('fmTransLvlRaw').whenChanged().handle((tl) => { + this.transLvlAr = new Arinc429Word(tl); }); sub.on('fmgcFlightPhase').whenChanged().handle((fp) => { @@ -357,8 +357,10 @@ class RadioAltAndDH extends DisplayComponent<{ bus: ArincEventBus, filteredRadio const raHasData = !this.radioAltitude.isNoComputedData(); const raValue = this.filteredRadioAltitude; const verticalOffset = calculateVerticalOffsetFromRoll(this.roll.value); - const chosenTransalt = this.fmgcFlightPhase <= 3 ? this.transAlt : this.transAltAppr; - const belowTransitionAltitude = chosenTransalt !== 0 && (!this.altitude.isNoComputedData() && !this.altitude.isNoComputedData()) && this.altitude.value < chosenTransalt; + const useTransAltVsLvl = this.fmgcFlightPhase <= 3; + const chosenTransalt = useTransAltVsLvl ? this.transAltAr : this.transLvlAr; + const belowTransitionAltitude = chosenTransalt.isNormalOperation() && (!this.altitude.isNoComputedData() && !this.altitude.isNoComputedData()) + && this.altitude.value < (useTransAltVsLvl ? chosenTransalt.value : chosenTransalt.value * 100); let size = 'FontLarge'; const dh = this.dh.get(); const DHValid = dh.value >= 0 && (!dh.isNoComputedData() && !dh.isFailureWarning()); diff --git a/fbw-a32nx/src/systems/instruments/src/PFD/shared/ArincValueProvider.ts b/fbw-a32nx/src/systems/instruments/src/PFD/shared/ArincValueProvider.ts index 03fe5a6fb83..c61ad02605a 100644 --- a/fbw-a32nx/src/systems/instruments/src/PFD/shared/ArincValueProvider.ts +++ b/fbw-a32nx/src/systems/instruments/src/PFD/shared/ArincValueProvider.ts @@ -52,6 +52,8 @@ export interface Arinc429Values { fmEisDiscreteWord2Raw: number; fmMdaRaw: number; fmDhRaw: number; + fmTransAltRaw: number; + fmTransLvlRaw: number; } export class ArincValueProvider { private roll = new Arinc429Word(0); @@ -502,6 +504,10 @@ export class ArincValueProvider { this.fm2Subs.push(subscriber.on('fm2MdaRaw').handle((raw) => publisher.pub('fmMdaRaw', raw), true)); this.fm1Subs.push(subscriber.on('fm1DhRaw').handle((raw) => publisher.pub('fmDhRaw', raw), true)); this.fm2Subs.push(subscriber.on('fm2DhRaw').handle((raw) => publisher.pub('fmDhRaw', raw), true)); + this.fm1Subs.push(subscriber.on('fm1TransAltRaw').handle((raw) => publisher.pub('fmTransAltRaw', raw), true)); + this.fm2Subs.push(subscriber.on('fm2TransAltRaw').handle((raw) => publisher.pub('fmTransAltRaw', raw), true)); + this.fm1Subs.push(subscriber.on('fm1TransLvlRaw').handle((raw) => publisher.pub('fmTransLvlRaw', raw), true)); + this.fm2Subs.push(subscriber.on('fm2TransLvlRaw').handle((raw) => publisher.pub('fmTransLvlRaw', raw), true)); this.fm1Healthy.setConsumer(subscriber.on('fm1HealthyDiscrete')); this.fm2Healthy.setConsumer(subscriber.on('fm2HealthyDiscrete')); diff --git a/fbw-a32nx/src/systems/instruments/src/PFD/shared/PFDSimvarPublisher.tsx b/fbw-a32nx/src/systems/instruments/src/PFD/shared/PFDSimvarPublisher.tsx index 794b3145cf3..df9d5dee5f5 100644 --- a/fbw-a32nx/src/systems/instruments/src/PFD/shared/PFDSimvarPublisher.tsx +++ b/fbw-a32nx/src/systems/instruments/src/PFD/shared/PFDSimvarPublisher.tsx @@ -62,8 +62,6 @@ export type PFDSimvars = AdirsSimVars & SwitchingPanelVSimVars & { isAltManaged: boolean; targetSpeedManaged: number; flapHandleIndex: number; - transAlt: number; - transAltAppr: number; selectedHeading: number; showSelectedHeading: number; altConstraint: number; @@ -156,6 +154,10 @@ export type PFDSimvars = AdirsSimVars & SwitchingPanelVSimVars & { fm2DhRaw: number; fm1HealthyDiscrete: number; fm2HealthyDiscrete: number; + fm1TransAltRaw: number; + fm2TransAltRaw: number; + fm1TransLvlRaw: number; + fm2TransLvlRaw: number } export enum PFDVars { @@ -214,8 +216,6 @@ export enum PFDVars { targetSpeedManaged = 'L:A32NX_SPEEDS_MANAGED_PFD', mach = 'L:A32NX_ADIRS_ADR_1_MACH', flapHandleIndex = 'L:A32NX_FLAPS_HANDLE_INDEX', - transAlt = 'L:AIRLINER_TRANS_ALT', - transAltAppr = 'L:AIRLINER_APPR_TRANS_ALT', magTrackRaw = 'L:A32NX_ADIRS_IR_1_TRACK', selectedHeading = 'L:A32NX_FCU_HEADING_SELECTED', showSelectedHeading = 'L:A320_FCU_SHOW_SELECTED_HEADING', @@ -310,6 +310,10 @@ export enum PFDVars { fm2DhRaw = 'L:A32NX_FM1_DECISION_HEIGHT', fm1HealthyDiscrete = 'L:A32NX_FM1_HEALTHY_DISCRETE', fm2HealthyDiscrete = 'L:A32NX_FM2_HEALTHY_DISCRETE', + fm1TransAltRaw = 'L:A32NX_FM1_TRANS_ALT', + fm2TransAltRaw = 'L:A32NX_FM2_TRANS_ALT', + fm1TransLvlRaw = 'L:A32NX_FM1_TRANS_LVL', + fm2TransLvlRaw = 'L:A32NX_FM2_TRANS_LVL', } /** A publisher to poll and publish nav/com simvars. */ @@ -371,8 +375,6 @@ export class PFDSimvarPublisher extends UpdatableSimVarPublisher { ['targetSpeedManaged', { name: PFDVars.targetSpeedManaged, type: SimVarValueType.Knots }], ['mach', { name: PFDVars.mach, type: SimVarValueType.Number }], ['flapHandleIndex', { name: PFDVars.flapHandleIndex, type: SimVarValueType.Number }], - ['transAlt', { name: PFDVars.transAlt, type: SimVarValueType.Number }], - ['transAltAppr', { name: PFDVars.transAltAppr, type: SimVarValueType.Number }], ['magTrackRaw', { name: PFDVars.magTrackRaw, type: SimVarValueType.Number }], ['selectedHeading', { name: PFDVars.selectedHeading, type: SimVarValueType.Degree }], ['showSelectedHeading', { name: PFDVars.showSelectedHeading, type: SimVarValueType.Number }], @@ -465,6 +467,10 @@ export class PFDSimvarPublisher extends UpdatableSimVarPublisher { ['fm2DhRaw', { name: PFDVars.fm2DhRaw, type: SimVarValueType.Number }], ['fm1HealthyDiscrete', { name: PFDVars.fm1HealthyDiscrete, type: SimVarValueType.Number }], ['fm2HealthyDiscrete', { name: PFDVars.fm2HealthyDiscrete, type: SimVarValueType.Number }], + ['fm1TransAltRaw', { name: PFDVars.fm1TransAltRaw, type: SimVarValueType.Number }], + ['fm2TransAltRaw', { name: PFDVars.fm2TransAltRaw, type: SimVarValueType.Number }], + ['fm1TransLvlRaw', { name: PFDVars.fm1TransLvlRaw, type: SimVarValueType.Number }], + ['fm2TransLvlRaw', { name: PFDVars.fm2TransLvlRaw, type: SimVarValueType.Number }], ]) public constructor(bus: ArincEventBus) { From 26abbc271d43166d06ec75c67b4aa2a4a279de01 Mon Sep 17 00:00:00 2001 From: BBK <22713769+BlueberryKing@users.noreply.github.com> Date: Thu, 14 Sep 2023 09:17:39 +0200 Subject: [PATCH 2/6] Document new simvars --- fbw-a32nx/docs/a320-simvars.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/fbw-a32nx/docs/a320-simvars.md b/fbw-a32nx/docs/a320-simvars.md index 2a37660ce71..0104a27202f 100644 --- a/fbw-a32nx/docs/a320-simvars.md +++ b/fbw-a32nx/docs/a320-simvars.md @@ -1949,7 +1949,7 @@ In the variables below, {number} should be replaced with one item in the set: { - 1 - captain's side FMGC - 2 - f/o's side FMGC - - A32NX_FM{number}_DECISION_HEIGHT +- A32NX_FM{number}_DECISION_HEIGHT - ARINC429 - The decision height for an approach in feet, as entered on the PERF page. - Value | Meaning @@ -1961,13 +1961,27 @@ In the variables below, {number} should be replaced with one item in the set: { - 1 - captain's side FMGC - 2 - f/o's side FMGC - - A32NX_FM{number}_MINIMUM_DESCENT_ALTITUDE +- A32NX_FM{number}_MINIMUM_DESCENT_ALTITUDE - ARINC429 - The minimum descent altitude for a non-precision approach in feet, as entered on the PERF page. - {number} - 1 - captain's side FMGC - 2 - f/o's side FMGC +- A32NX_FM{number}_TRANS_ALT + - Arinc429 + - The transition altitude at the origin in feet + - {number} + - 1 - captain's side FMGC + - 2 - f/o's side FMGC + +- A32NX_FM{number}_TRANS_LVL + - Arinc429 + - The transition level the destination as a flight level + - {number} + - 1 - captain's side FMGC + - 2 - f/o's side FMGC + - A32NX_FM_VNAV_TRIGGER_STEP_DELETED - Bool - Indicates whether to trigger a step deleted message on the MCDU From 4a0084066f8ac6f2854924d94a8fd146a877004f Mon Sep 17 00:00:00 2001 From: BBK <22713769+BlueberryKing@users.noreply.github.com> Date: Wed, 27 Sep 2023 22:04:42 +0200 Subject: [PATCH 3/6] Move transmission to JS --- .../FMC/A32NX_FMCMainDisplay.js | 25 +++++++++++ .../systems/fmgc/src/components/EfisLabels.ts | 42 ------------------- .../src/systems/fmgc/src/components/index.ts | 2 - .../src/flightplanning/FlightPlanManager.ts | 6 +-- .../instruments/src/PFD/AltitudeIndicator.tsx | 10 ++--- 5 files changed, 33 insertions(+), 52 deletions(-) delete mode 100644 fbw-a32nx/src/systems/fmgc/src/components/EfisLabels.ts diff --git a/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/FMC/A32NX_FMCMainDisplay.js b/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/FMC/A32NX_FMCMainDisplay.js index 969411a986c..fc8403851b5 100644 --- a/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/FMC/A32NX_FMCMainDisplay.js +++ b/fbw-a32nx/src/base/flybywire-aircraft-a320-neo/html_ui/Pages/VCockpit/Instruments/Airliners/FlyByWire_A320_Neo/FMC/A32NX_FMCMainDisplay.js @@ -185,6 +185,8 @@ class FMCMainDisplay extends BaseAirliners { this.arincMissedThrustReductionAltitude = FmArinc429OutputWord.empty("MISSED_THR_RED_ALT"); this.arincMissedAccelerationAltitude = FmArinc429OutputWord.empty("MISSED_ACC_ALT"); this.arincMissedEoAccelerationAltitude = FmArinc429OutputWord.empty("MISSED_EO_ACC_ALT"); + this.arincTransitionAltitude = FmArinc429OutputWord.empty("TRANS_ALT"); + this.arincTransitionLevel = FmArinc429OutputWord.empty("TRANS_LVL"); /** contains fm messages (not yet implemented) and nodh bit */ this.arincEisWord2 = FmArinc429OutputWord.empty("EIS_DISCRETE_WORD_2"); @@ -204,6 +206,8 @@ class FMCMainDisplay extends BaseAirliners { this.arincMissedThrustReductionAltitude, this.arincMissedAccelerationAltitude, this.arincMissedEoAccelerationAltitude, + this.arincTransitionAltitude, + this.arincTransitionLevel, this.arincEisWord2, ]; } @@ -598,6 +602,7 @@ class FMCMainDisplay extends BaseAirliners { this.toSpeedsChecks(); this.thrustReductionAccelerationChecks(); this.updateThrustReductionAcceleration(); + this.updateTransitionAltitudeLevel(); this.updateMinimums(); this.updateIlsCourse(); } @@ -2926,6 +2931,7 @@ class FMCMainDisplay extends BaseAirliners { if (s === FMCMainDisplay.clrValue) { // TODO when possible fetch default from database this.flightPlanManager.setOriginTransitionAltitude(); + this.updateTransitionAltitudeLevel(); return true; } @@ -2942,6 +2948,7 @@ class FMCMainDisplay extends BaseAirliners { } this.flightPlanManager.setOriginTransitionAltitude(value); + this.updateTransitionAltitudeLevel(); return true; } @@ -3202,6 +3209,22 @@ class FMCMainDisplay extends BaseAirliners { ); } + updateTransitionAltitudeLevel() { + const originTransitionAltitude = this.flightPlanManager.originTransitionAltitude; + this.arincTransitionAltitude.setBnrValue( + originTransitionAltitude !== undefined ? originTransitionAltitude : 0, + originTransitionAltitude !== undefined ? Arinc429Word.SignStatusMatrix.NormalOperation : Arinc429Word.SignStatusMatrix.NoComputedData, + 17, 131072, 0, + ) + + const destinationTansitionLevel = this.flightPlanManager.destinationTransitionLevel; + this.arincTransitionLevel.setBnrValue( + destinationTansitionLevel !== undefined ? destinationTansitionLevel : 0, + destinationTansitionLevel !== undefined ? Arinc429Word.SignStatusMatrix.NormalOperation : Arinc429Word.SignStatusMatrix.NoComputedData, + 9, 512, 0, + ) + } + //Needs PR Merge #3082 //TODO: with FADEC no longer needed setPerfTOFlexTemp(s) { @@ -3830,6 +3853,7 @@ class FMCMainDisplay extends BaseAirliners { setPerfApprTransAlt(s) { if (s === FMCMainDisplay.clrValue) { this.flightPlanManager.setDestinationTransitionLevel(); + this.updateTransitionAltitudeLevel(); return true; } @@ -3844,6 +3868,7 @@ class FMCMainDisplay extends BaseAirliners { } this.flightPlanManager.setDestinationTransitionLevel(Math.round(value / 100)); + this.updateTransitionAltitudeLevel(); return true; } diff --git a/fbw-a32nx/src/systems/fmgc/src/components/EfisLabels.ts b/fbw-a32nx/src/systems/fmgc/src/components/EfisLabels.ts deleted file mode 100644 index 32249e36fa5..00000000000 --- a/fbw-a32nx/src/systems/fmgc/src/components/EfisLabels.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { FlightPlanManager } from '@fmgc/wtsdk'; -import { Arinc429SignStatusMatrix, Arinc429Word } from '@flybywiresim/fbw-sdk'; -import { FmgcComponent } from './FmgcComponent'; - -export class EfisLabels implements FmgcComponent { - private lastTransitionAltitude: Feet; - - private lastTransitionLevel: number; - - private flightPlanManager: FlightPlanManager; - - init(_baseInstrument: BaseInstrument, flightPlanManager: FlightPlanManager): void { - this.flightPlanManager = flightPlanManager; - } - - update(_deltaTime: number): void { - const transitionAltitude = this.flightPlanManager.originTransitionAltitude; - const transitionLevel = this.flightPlanManager.destinationTransitionLevel; - - if (transitionAltitude !== this.lastTransitionAltitude) { - Arinc429Word.toSimVarValue( - 'L:A32NX_FM1_TRANS_ALT', transitionAltitude ?? 0, transitionAltitude !== undefined ? Arinc429SignStatusMatrix.NormalOperation : Arinc429SignStatusMatrix.NoComputedData, - ); - Arinc429Word.toSimVarValue( - 'L:A32NX_FM2_TRANS_ALT', transitionAltitude ?? 0, transitionAltitude !== undefined ? Arinc429SignStatusMatrix.NormalOperation : Arinc429SignStatusMatrix.NoComputedData, - ); - - this.lastTransitionAltitude = transitionAltitude; - } - - if (transitionLevel !== this.lastTransitionLevel) { - Arinc429Word.toSimVarValue( - 'L:A32NX_FM1_TRANS_LVL', transitionLevel ?? 0, transitionLevel !== undefined ? Arinc429SignStatusMatrix.NormalOperation : Arinc429SignStatusMatrix.NoComputedData, - ); - Arinc429Word.toSimVarValue( - 'L:A32NX_FM2_TRANS_LVL', transitionLevel ?? 0, transitionLevel !== undefined ? Arinc429SignStatusMatrix.NormalOperation : Arinc429SignStatusMatrix.NoComputedData, - ); - - this.lastTransitionLevel = transitionLevel; - } - } -} diff --git a/fbw-a32nx/src/systems/fmgc/src/components/index.ts b/fbw-a32nx/src/systems/fmgc/src/components/index.ts index 61eae3fa8e8..ac5c31c31c7 100644 --- a/fbw-a32nx/src/systems/fmgc/src/components/index.ts +++ b/fbw-a32nx/src/systems/fmgc/src/components/index.ts @@ -1,7 +1,6 @@ import { FcuSync } from '@fmgc/components/FcuSync'; import { ReadySignal } from '@fmgc/components/ReadySignal'; import { FlightPlanManager } from '@fmgc/wtsdk'; -import { EfisLabels } from './EfisLabels'; import { FmgcComponent } from './FmgcComponent'; import { FmsMessages } from './fms-messages'; @@ -9,7 +8,6 @@ const fmsMessages = new FmsMessages(); const components: FmgcComponent[] = [ fmsMessages, - new EfisLabels(), new ReadySignal(), new FcuSync(), ]; diff --git a/fbw-a32nx/src/systems/fmgc/src/flightplanning/FlightPlanManager.ts b/fbw-a32nx/src/systems/fmgc/src/flightplanning/FlightPlanManager.ts index f7ea42e238a..a4b6c265e76 100644 --- a/fbw-a32nx/src/systems/fmgc/src/flightplanning/FlightPlanManager.ts +++ b/fbw-a32nx/src/systems/fmgc/src/flightplanning/FlightPlanManager.ts @@ -1853,7 +1853,7 @@ export class FlightPlanManager { * The transition altitude for the origin in the *active* flight plan */ get originTransitionAltitude(): number | undefined { - return this.getOriginTransitionAltitude(0); + return this.getOriginTransitionAltitude(FlightPlans.Active); } public getOriginTransitionAltitudeIsFromDb(flightPlanIndex: number = 0): boolean { @@ -1865,7 +1865,7 @@ export class FlightPlanManager { * Is the transition altitude for the origin in the *active* flight plan from the database? */ get originTransitionAltitudeIsFromDb(): boolean { - return this.getOriginTransitionAltitudeIsFromDb(0); + return this.getOriginTransitionAltitudeIsFromDb(FlightPlans.Active); } /** @@ -1893,7 +1893,7 @@ export class FlightPlanManager { * The transition level for the destination in the *active* flight plan */ get destinationTransitionLevel(): FlightLevel | undefined { - return this.getDestinationTransitionLevel(0); + return this.getDestinationTransitionLevel(FlightPlans.Active); } public getDestinationTransitionLevelIsFromDb(flightPlanIndex: number = this._currentFlightPlanIndex): boolean { diff --git a/fbw-a32nx/src/systems/instruments/src/PFD/AltitudeIndicator.tsx b/fbw-a32nx/src/systems/instruments/src/PFD/AltitudeIndicator.tsx index d6332fd7669..c8bd37c07e1 100644 --- a/fbw-a32nx/src/systems/instruments/src/PFD/AltitudeIndicator.tsx +++ b/fbw-a32nx/src/systems/instruments/src/PFD/AltitudeIndicator.tsx @@ -3,7 +3,7 @@ // SPDX-License-Identifier: GPL-3.0 import { ClockEvents, DisplayComponent, FSComponent, Subject, Subscribable, VNode } from '@microsoft/msfs-sdk'; -import { Arinc429Word, Arinc429WordData } from '@flybywiresim/fbw-sdk'; +import { Arinc429Register, Arinc429Word, Arinc429WordData } from '@flybywiresim/fbw-sdk'; import { VerticalMode } from '@shared/autopilot'; import { Arinc429RegisterSubject } from 'instruments/src/MsfsAvionicsCommon/Arinc429RegisterSubject'; import { PFDSimvars } from './shared/PFDSimvarPublisher'; @@ -541,9 +541,9 @@ class AltimeterIndicator extends DisplayComponent { private unit = ''; - private transAltAr = Arinc429Word.empty(); + private transAltAr = Arinc429Register.empty(); - private transLvlAr = Arinc429Word.empty(); + private transLvlAr = Arinc429Register.empty(); private flightPhase = 0; @@ -590,14 +590,14 @@ class AltimeterIndicator extends DisplayComponent { }); sub.on('fmTransAltRaw').whenChanged().handle((ta) => { - this.transAltAr = new Arinc429Word(ta); + this.transAltAr.set(ta); this.handleBlink(); this.getText(); }); sub.on('fmTransLvlRaw').whenChanged().handle((tl) => { - this.transLvlAr = new Arinc429Word(tl); + this.transLvlAr.set(tl); this.handleBlink(); this.getText(); From f93ae56cc42476c320e70c29be68c5d5c0094188 Mon Sep 17 00:00:00 2001 From: BBK <22713769+BlueberryKing@users.noreply.github.com> Date: Wed, 27 Sep 2023 22:09:26 +0200 Subject: [PATCH 4/6] Use `FlightPlans.Active` instead of `0` --- .../src/systems/fmgc/src/flightplanning/FlightPlanManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fbw-a32nx/src/systems/fmgc/src/flightplanning/FlightPlanManager.ts b/fbw-a32nx/src/systems/fmgc/src/flightplanning/FlightPlanManager.ts index a4b6c265e76..70f252dd54f 100644 --- a/fbw-a32nx/src/systems/fmgc/src/flightplanning/FlightPlanManager.ts +++ b/fbw-a32nx/src/systems/fmgc/src/flightplanning/FlightPlanManager.ts @@ -1905,7 +1905,7 @@ export class FlightPlanManager { * Is the transition level for the destination in the *active* flight plan from the database? */ get destinationTransitionLevelIsFromDb(): boolean { - return this.getDestinationTransitionLevelIsFromDb(0); + return this.getDestinationTransitionLevelIsFromDb(FlightPlans.Active); } /** From 3e246cd3f3478751501b02acc6f7dcd2c986e9d7 Mon Sep 17 00:00:00 2001 From: BBK <22713769+BlueberryKing@users.noreply.github.com> Date: Wed, 27 Sep 2023 22:11:11 +0200 Subject: [PATCH 5/6] Use `Arinc429Register` everywhere --- .../instruments/src/PFD/AttitudeIndicatorHorizon.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fbw-a32nx/src/systems/instruments/src/PFD/AttitudeIndicatorHorizon.tsx b/fbw-a32nx/src/systems/instruments/src/PFD/AttitudeIndicatorHorizon.tsx index 9c5bf3b6909..8ff35a83088 100644 --- a/fbw-a32nx/src/systems/instruments/src/PFD/AttitudeIndicatorHorizon.tsx +++ b/fbw-a32nx/src/systems/instruments/src/PFD/AttitudeIndicatorHorizon.tsx @@ -3,7 +3,7 @@ // SPDX-License-Identifier: GPL-3.0 import { ClockEvents, ConsumerSubject, DisplayComponent, FSComponent, MappedSubject, Subject, Subscribable, VNode } from '@microsoft/msfs-sdk'; -import { Arinc429Word, Arinc429WordData } from '@flybywiresim/fbw-sdk'; +import { Arinc429Register, Arinc429Word, Arinc429WordData } from '@flybywiresim/fbw-sdk'; import { Arinc429RegisterSubject } from 'instruments/src/MsfsAvionicsCommon/Arinc429RegisterSubject'; import { DmcLogicEvents } from '../MsfsAvionicsCommon/providers/DmcPublisher'; @@ -309,9 +309,9 @@ class RadioAltAndDH extends DisplayComponent<{ bus: ArincEventBus, filteredRadio private radioAltitude = new Arinc429Word(0); - private transAltAr = Arinc429Word.empty(); + private transAltAr = Arinc429Register.empty(); - private transLvlAr = Arinc429Word.empty(); + private transLvlAr = Arinc429Register.empty(); private fmgcFlightPhase = 0; @@ -335,11 +335,11 @@ class RadioAltAndDH extends DisplayComponent<{ bus: ArincEventBus, filteredRadio }); sub.on('fmTransAltRaw').whenChanged().handle((ta) => { - this.transAltAr = new Arinc429Word(ta); + this.transAltAr.set(ta); }); sub.on('fmTransLvlRaw').whenChanged().handle((tl) => { - this.transLvlAr = new Arinc429Word(tl); + this.transLvlAr.set(tl); }); sub.on('fmgcFlightPhase').whenChanged().handle((fp) => { From 5bfb7f9ee22477224b7ab6c67b1da3b000fb0cc3 Mon Sep 17 00:00:00 2001 From: BBK <22713769+BlueberryKing@users.noreply.github.com> Date: Fri, 20 Oct 2023 15:56:29 +0200 Subject: [PATCH 6/6] Fix duplicate condition --- .../systems/instruments/src/PFD/AttitudeIndicatorHorizon.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fbw-a32nx/src/systems/instruments/src/PFD/AttitudeIndicatorHorizon.tsx b/fbw-a32nx/src/systems/instruments/src/PFD/AttitudeIndicatorHorizon.tsx index 8ff35a83088..545566ca58b 100644 --- a/fbw-a32nx/src/systems/instruments/src/PFD/AttitudeIndicatorHorizon.tsx +++ b/fbw-a32nx/src/systems/instruments/src/PFD/AttitudeIndicatorHorizon.tsx @@ -359,7 +359,7 @@ class RadioAltAndDH extends DisplayComponent<{ bus: ArincEventBus, filteredRadio const verticalOffset = calculateVerticalOffsetFromRoll(this.roll.value); const useTransAltVsLvl = this.fmgcFlightPhase <= 3; const chosenTransalt = useTransAltVsLvl ? this.transAltAr : this.transLvlAr; - const belowTransitionAltitude = chosenTransalt.isNormalOperation() && (!this.altitude.isNoComputedData() && !this.altitude.isNoComputedData()) + const belowTransitionAltitude = chosenTransalt.isNormalOperation() && !this.altitude.isNoComputedData() && this.altitude.value < (useTransAltVsLvl ? chosenTransalt.value : chosenTransalt.value * 100); let size = 'FontLarge'; const dh = this.dh.get();