diff --git a/fbw-a32nx/docs/a320-simvars.md b/fbw-a32nx/docs/a320-simvars.md index fb66673b25d..aacf895737c 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 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 4a18487a602..00000000000 --- a/fbw-a32nx/src/systems/fmgc/src/components/EfisLabels.ts +++ /dev/null @@ -1,34 +0,0 @@ -// Copyright (c) 2021-2023 FlyByWire Simulations -// -// SPDX-License-Identifier: GPL-3.0 - -import { FlightPlanManager } from '@fmgc/wtsdk'; -import { FmgcComponent } from './FmgcComponent'; - -export class EfisLabels implements FmgcComponent { - private lastTransitionAltitude: Feet; - - private lastTransitionLevel: FlightLevel; - - 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; - - // FIXME ARINC429 when the PR adding a TS impl. lands... - if (transitionAltitude !== this.lastTransitionAltitude) { - SimVar.SetSimVarValue('L:AIRLINER_TRANS_ALT', 'Number', transitionAltitude ?? 0); - this.lastTransitionAltitude = transitionAltitude; - } - - if (transitionLevel !== this.lastTransitionLevel) { - SimVar.SetSimVarValue('L:AIRLINER_APPR_TRANS_ALT', 'Number', (transitionLevel ?? 0) * 100); - 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 dda4afa1818..01c2ccaaa59 100644 --- a/fbw-a32nx/src/systems/fmgc/src/flightplanning/FlightPlanManager.ts +++ b/fbw-a32nx/src/systems/fmgc/src/flightplanning/FlightPlanManager.ts @@ -1815,7 +1815,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 { @@ -1827,7 +1827,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); } /** @@ -1855,7 +1855,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 { @@ -1867,7 +1867,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); } /** diff --git a/fbw-a32nx/src/systems/instruments/src/PFD/AltitudeIndicator.tsx b/fbw-a32nx/src/systems/instruments/src/PFD/AltitudeIndicator.tsx index 39c3d77bcb8..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 transAlt = 0; + private transAltAr = Arinc429Register.empty(); - private transAltAppr = 0; + private transLvlAr = Arinc429Register.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.set(ta); this.handleBlink(); this.getText(); }); - sub.on('transAltAppr').whenChanged().handle((ta) => { - this.transAltAppr = ta; + sub.on('fmTransLvlRaw').whenChanged().handle((tl) => { + this.transLvlAr.set(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..545566ca58b 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 transAlt = 0; + private transAltAr = Arinc429Register.empty(); - private transAltAppr = 0; + private transLvlAr = Arinc429Register.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.set(ta); }); - sub.on('transAltAppr').whenChanged().handle((ta) => { - this.transAltAppr = ta; + sub.on('fmTransLvlRaw').whenChanged().handle((tl) => { + this.transLvlAr.set(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.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) {