From b02ebb0e15a34299cd8697ac7dc9d82f24af922b Mon Sep 17 00:00:00 2001 From: Florian Gross <63071941+flogross89@users.noreply.github.com> Date: Sat, 3 Feb 2024 06:32:07 +0100 Subject: [PATCH] - import Arinc429Word from fbw-sdk (remove copy from @shared) - match slats+flaps position dots to actual positions - remove speed tape outline right - remove spaces in FMA E2 cell (i.e. 1FD2 instead of 1 FD 2) - fix LS info box position (push a little bit upwards) - integrate PR #8235 (FMA pos. update) & #8214 (move trans alt/lvl to arinc bus) - make tens of digital altitude readout font smaller & push to right - altitude tape now listens to baro corrected altitude --- .../instruments/src/Common/arinc429.tsx | 2 +- .../src/EWD/elements/PseudoFWC.tsx | 2 +- .../src/EWD/elements/ThrustRatingMode.tsx | 2 +- .../instruments/src/PFD/AltitudeIndicator.tsx | 125 +++++++++++++-- .../src/PFD/AttitudeIndicatorFixed.tsx | 2 +- .../src/PFD/AttitudeIndicatorHorizon.tsx | 23 +-- .../src/PFD/DigitalAltitudeReadout.tsx | 10 +- .../src/systems/instruments/src/PFD/FMA.tsx | 71 +++++---- .../src/PFD/FlightPathDirector.tsx | 2 +- .../instruments/src/PFD/FlightPathVector.tsx | 2 +- .../src/PFD/LandingSystemIndicator.tsx | 12 +- .../systems/instruments/src/PFD/LowerArea.tsx | 10 +- .../src/systems/instruments/src/PFD/PFD.tsx | 3 +- .../instruments/src/PFD/SpeedIndicator.tsx | 5 +- .../src/PFD/VerticalSpeedIndicator.tsx | 3 +- .../src/PFD/shared/AdirsValueProvider.tsx | 2 +- .../src/PFD/shared/ArincValueProvider.ts | 78 ++++++++- .../src/PFD/shared/PFDSimvarPublisher.tsx | 56 ++++++- .../systems/instruments/src/PFD/style.scss | 8 + fbw-a380x/src/systems/shared/src/arinc429.ts | 148 ------------------ .../tcas/src/components/TcasComputer.ts | 2 +- 21 files changed, 322 insertions(+), 246 deletions(-) delete mode 100644 fbw-a380x/src/systems/shared/src/arinc429.ts diff --git a/fbw-a380x/src/systems/instruments/src/Common/arinc429.tsx b/fbw-a380x/src/systems/instruments/src/Common/arinc429.tsx index 10ec4cf2636..2976b4925b6 100644 --- a/fbw-a380x/src/systems/instruments/src/Common/arinc429.tsx +++ b/fbw-a380x/src/systems/instruments/src/Common/arinc429.tsx @@ -1,4 +1,4 @@ -import { Arinc429Word } from '@shared/arinc429'; +import { Arinc429Word } from '@flybywiresim/fbw-sdk'; import { useSimVar } from './simVars'; export const useArinc429Var = ( diff --git a/fbw-a380x/src/systems/instruments/src/EWD/elements/PseudoFWC.tsx b/fbw-a380x/src/systems/instruments/src/EWD/elements/PseudoFWC.tsx index a481b0e721b..c2cb74c995c 100644 --- a/fbw-a380x/src/systems/instruments/src/EWD/elements/PseudoFWC.tsx +++ b/fbw-a380x/src/systems/instruments/src/EWD/elements/PseudoFWC.tsx @@ -5,7 +5,7 @@ import { usePersistentProperty } from '@instruments/common/persistence'; import { useUpdate } from '@instruments/common/hooks'; import { NXLogicConfirmNode, NXLogicClockNode, NXLogicMemoryNode } from '@instruments/common/NXLogic'; import { useArinc429Var } from '@instruments/common/arinc429'; -import { Arinc429Word } from '@shared/arinc429'; +import { Arinc429Word } from '@flybywiresim/fbw-sdk'; const mapOrder = (array, order) => { array.sort((a, b) => { diff --git a/fbw-a380x/src/systems/instruments/src/EWD/elements/ThrustRatingMode.tsx b/fbw-a380x/src/systems/instruments/src/EWD/elements/ThrustRatingMode.tsx index 7eaf817bcaf..e0ae5d6fb94 100644 --- a/fbw-a380x/src/systems/instruments/src/EWD/elements/ThrustRatingMode.tsx +++ b/fbw-a380x/src/systems/instruments/src/EWD/elements/ThrustRatingMode.tsx @@ -1,7 +1,7 @@ +import { Arinc429Word } from '@flybywiresim/fbw-sdk'; import { useArinc429Var } from '@instruments/common/arinc429'; import { splitDecimals } from '@instruments/common/gauges'; import { useSimVar } from '@instruments/common/simVars'; -import { Arinc429Word } from '@shared/arinc429'; import React from 'react'; type N1LimitProps = { diff --git a/fbw-a380x/src/systems/instruments/src/PFD/AltitudeIndicator.tsx b/fbw-a380x/src/systems/instruments/src/PFD/AltitudeIndicator.tsx index b0944df0d02..f7e7f3ec9df 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/AltitudeIndicator.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/AltitudeIndicator.tsx @@ -1,33 +1,33 @@ import { ClockEvents, DisplayComponent, EventBus, FSComponent, Subject, Subscribable, VNode } from '@microsoft/msfs-sdk'; -import { Arinc429Word } from '@shared/arinc429'; import { VerticalMode } from '@shared/autopilot'; import { PFDSimvars } from './shared/PFDSimvarPublisher'; import { DigitalAltitudeReadout } from './DigitalAltitudeReadout'; import { SimplaneValues } from './shared/SimplaneValueProvider'; import { VerticalTape } from './VerticalTape'; import { Arinc429Values } from './shared/ArincValueProvider'; -import { ArincEventBus } from "@flybywiresim/fbw-sdk"; +import { Arinc429Register, Arinc429RegisterSubject, Arinc429Word, ArincEventBus } from "@flybywiresim/fbw-sdk"; const DisplayRange = 600; const ValueSpacing = 100; const DistanceSpacing = 7.5; -class LandingElevationIndicator extends DisplayComponent<{bus: EventBus}> { +class LandingElevationIndicator extends DisplayComponent<{bus: ArincEventBus}> { private landingElevationIndicator = FSComponent.createRef(); private altitude = 0; - private landingElevation = 0; + private landingElevation = new Arinc429Word(0); private flightPhase = 0; private delta = 0; private handleLandingElevation() { - const delta = this.altitude - this.landingElevation; + const landingElevationValid = !this.landingElevation.isFailureWarning() && !this.landingElevation.isNoComputedData(); + const delta = this.altitude - this.landingElevation.value; const offset = (delta - DisplayRange) * DistanceSpacing / ValueSpacing; this.delta = delta; - if (delta > DisplayRange || (this.flightPhase !== 7 && this.flightPhase !== 8)) { + if (delta > DisplayRange || (this.flightPhase !== 7 && this.flightPhase !== 8) || !landingElevationValid) { this.landingElevationIndicator.instance.classList.add('HiddenElement'); } else { this.landingElevationIndicator.instance.classList.remove('HiddenElement'); @@ -107,9 +107,99 @@ class RadioAltIndicator extends DisplayComponent<{ bus: EventBus, filteredRadioA } } +class MinimumDescentAltitudeIndicator extends DisplayComponent<{ bus: ArincEventBus }> { + private visibility = Subject.create('hidden'); + + private path = Subject.create(''); + + private altitude = 0; + + private radioAltitudeValid = false; + + private qnhLandingAltValid = false; + + private qfeLandingAltValid = false; + + private inLandingPhases = false; + + private altMode: 'STD' | 'QNH' | 'QFE' = 'STD'; + + private readonly mda = Arinc429RegisterSubject.createEmpty(); + + private landingElevation = new Arinc429Word(0); + + private updateIndication(): void { + this.qnhLandingAltValid = !this.landingElevation.isFailureWarning() + && !this.landingElevation.isNoComputedData() + && this.inLandingPhases + && this.altMode === 'QNH'; + + this.qfeLandingAltValid = this.inLandingPhases + && this.altMode === 'QFE'; + + const altDelta = this.mda.get().value - this.altitude; + + const showMda = (this.radioAltitudeValid || this.qnhLandingAltValid || this.qfeLandingAltValid) + && Math.abs(altDelta) <= 570 + && !this.mda.get().isFailureWarning() + && !this.mda.get().isNoComputedData(); + + if (!showMda) { + this.visibility.set('hidden'); + return; + } + + const offset = altDelta * DistanceSpacing / ValueSpacing; + this.path.set(`m 127.9276,${80.249604 - offset} h 5.80948 v 1.124908 h -5.80948 z`); + this.visibility.set('visible'); + } + + onAfterRender(node: VNode): void { + super.onAfterRender(node); + + const sub = this.props.bus.getArincSubscriber(); + + sub.on('chosenRa').whenArinc429SsmChanged().handle((ra) => { + this.radioAltitudeValid = !ra.isFailureWarning() && !ra.isNoComputedData(); + this.updateIndication(); + }); + + sub.on('landingElevation').withArinc429Precision(0).handle((landingElevation) => { + this.landingElevation = landingElevation; + this.updateIndication(); + }); + + sub.on('baroMode').whenChanged().handle((m) => { + this.altMode = m; + this.updateIndication(); + }); + + sub.on('altitudeAr').withArinc429Precision(0).handle((a) => { + // TODO filtered alt + this.altitude = a.value; + this.updateIndication(); + }); + + this.mda.sub(this.updateIndication.bind(this)); + + sub.on('fwcFlightPhase').whenChanged().handle((fp) => { + this.inLandingPhases = fp === 7 || fp === 8; + this.updateIndication(); + }); + + sub.on('fmMdaRaw').handle(this.mda.setWord.bind(this.mda)); + } + + render(): VNode { + return ( + + ); + } +} + interface AltitudeIndicatorProps { - bus: EventBus; + bus: ArincEventBus; } export class AltitudeIndicator extends DisplayComponent { @@ -219,6 +309,7 @@ export class AltitudeIndicatorOfftape extends DisplayComponent + @@ -469,7 +560,7 @@ class SelectedAltIndicator extends DisplayComponent { interface AltimeterIndicatorProps { altitude: Subscribable, - bus: EventBus, + bus: ArincEventBus, } class AltimeterIndicator extends DisplayComponent { @@ -481,9 +572,9 @@ class AltimeterIndicator extends DisplayComponent { private unit = ''; - private transAlt = 0; + private transAltAr = Arinc429Register.empty(); - private transAltAppr = 0; + private transLvlAr = Arinc429Register.empty(); private flightPhase = 0; @@ -496,7 +587,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') { @@ -529,15 +620,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(); @@ -560,12 +651,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-a380x/src/systems/instruments/src/PFD/AttitudeIndicatorFixed.tsx b/fbw-a380x/src/systems/instruments/src/PFD/AttitudeIndicatorFixed.tsx index fdb55757a56..d4102da165b 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/AttitudeIndicatorFixed.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/AttitudeIndicatorFixed.tsx @@ -1,10 +1,10 @@ import { DisplayComponent, EventBus, FSComponent, Subject, Subscribable, VNode } from '@microsoft/msfs-sdk'; -import { Arinc429Word } from '@shared/arinc429'; import { getDisplayIndex } from 'instruments/src/PFD/PFD'; import { FlightPathDirector } from './FlightPathDirector'; import { FlightPathVector } from './FlightPathVector'; import { Arinc429Values } from './shared/ArincValueProvider'; import { PFDSimvars } from './shared/PFDSimvarPublisher'; +import { Arinc429Word } from '@flybywiresim/fbw-sdk'; interface AttitudeIndicatorFixedUpperProps { bus: EventBus; diff --git a/fbw-a380x/src/systems/instruments/src/PFD/AttitudeIndicatorHorizon.tsx b/fbw-a380x/src/systems/instruments/src/PFD/AttitudeIndicatorHorizon.tsx index f5797d1a1b0..3afbd7d798e 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/AttitudeIndicatorHorizon.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/AttitudeIndicatorHorizon.tsx @@ -1,5 +1,4 @@ import { ClockEvents, DisplayComponent, EventBus, FSComponent, Subject, Subscribable, VNode } from '@microsoft/msfs-sdk'; -import { Arinc429Word } from '@shared/arinc429'; import { calculateHorizonOffsetFromPitch, @@ -12,7 +11,7 @@ import { Arinc429Values } from './shared/ArincValueProvider'; import { HorizontalTape } from './HorizontalTape'; import { SimplaneValues } from './shared/SimplaneValueProvider'; import { getDisplayIndex } from './PFD'; -import { ArincEventBus } from "@flybywiresim/fbw-sdk"; +import { Arinc429Register, Arinc429Word, ArincEventBus } from "@flybywiresim/fbw-sdk"; const DisplayRange = 35; const DistanceSpacing = 15; @@ -300,7 +299,7 @@ class TailstrikeIndicator extends DisplayComponent<{bus: EventBus}> { } } -class RadioAltAndDH extends DisplayComponent<{ bus: EventBus, filteredRadioAltitude: Subscribable, attExcessive: Subscribable }> { +class RadioAltAndDH extends DisplayComponent<{ bus: ArincEventBus, filteredRadioAltitude: Subscribable, attExcessive: Subscribable }> { private daRaGroup = FSComponent.createRef(); private roll = new Arinc429Word(0); @@ -311,9 +310,9 @@ class RadioAltAndDH extends DisplayComponent<{ bus: EventBus, filteredRadioAltit private radioAltitude = new Arinc429Word(0); - private transAlt = 0; + private transAltAr = Arinc429Register.empty(); - private transAltAppr = 0; + private transLvlAr = Arinc429Register.empty(); private fmgcFlightPhase = 0; @@ -340,12 +339,12 @@ class RadioAltAndDH extends DisplayComponent<{ bus: EventBus, filteredRadioAltit this.dh = dh; }); - 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) => { @@ -363,8 +362,10 @@ class RadioAltAndDH extends DisplayComponent<{ bus: EventBus, filteredRadioAltit 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 DHValid = this.dh >= 0; diff --git a/fbw-a380x/src/systems/instruments/src/PFD/DigitalAltitudeReadout.tsx b/fbw-a380x/src/systems/instruments/src/PFD/DigitalAltitudeReadout.tsx index 66ec206d106..efadb989c16 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/DigitalAltitudeReadout.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/DigitalAltitudeReadout.tsx @@ -134,7 +134,7 @@ export class DigitalAltitudeReadout extends DisplayComponent - + { const digitRef = FSComponent.createRef(); if (this.props.type === 'hundreds') { - graduationElements.push(); + graduationElements.push(); } else if (this.props.type === 'thousands') { - graduationElements.push(); + graduationElements.push(); } else if (this.props.type === 'ten-thousands') { - graduationElements.push(); + graduationElements.push(); } else if (this.props.type === 'tens') { - graduationElements.push(); + graduationElements.push(); } this.digitRefElements.push(digitRef); } diff --git a/fbw-a380x/src/systems/instruments/src/PFD/FMA.tsx b/fbw-a380x/src/systems/instruments/src/PFD/FMA.tsx index 270e8842327..38c251b343a 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/FMA.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/FMA.tsx @@ -1,8 +1,8 @@ import { ComponentProps, DisplayComponent, EventBus, FSComponent, Subject, Subscribable, VNode } from '@microsoft/msfs-sdk'; import { ArmedLateralMode, ArmedVerticalMode, isArmed, LateralMode, VerticalMode } from '@shared/autopilot'; -import { Arinc429Word } from '@shared/arinc429'; import { Arinc429Values } from './shared/ArincValueProvider'; import { PFDSimvars } from './shared/PFDSimvarPublisher'; +import { Arinc429Word } from '@flybywiresim/fbw-sdk'; abstract class ShowForSecondsComponent extends DisplayComponent { private timeout: number = 0; @@ -227,7 +227,7 @@ class Row2 extends DisplayComponent<{bus:EventBus, isAttExcessive: Subscribable< class A2Cell extends DisplayComponent<{ bus:EventBus }> { private text = Subject.create(''); - private className = Subject.create('FontMedium MiddleAlign Cyan'); + private className = Subject.create('FontMediumSmaller MiddleAlign Cyan'); private autoBrkRef = FSComponent.createRef(); @@ -339,7 +339,7 @@ class A1A2Cell extends ShowForSecondsComponent { this.displayModeChangedPath(true); text = ` - MAN + MAN TOGA `; break; @@ -347,7 +347,7 @@ class A1A2Cell extends ShowForSecondsComponent { this.displayModeChangedPath(true); text = ` - MAN + MAN GA SOFT `; break; @@ -356,11 +356,11 @@ class A1A2Cell extends ShowForSecondsComponent { const FlexTemp = Math.round(this.flexTemp); const FlexText = FlexTemp >= 0 ? (`+${FlexTemp}`) : FlexTemp.toString(); text = ` - - MAN - - FLX - ${FlexText} + + MAN + FLX + + ${FlexText} `; @@ -369,7 +369,7 @@ class A1A2Cell extends ShowForSecondsComponent { this.displayModeChangedPath(true); text = ` - MAN + MAN DTO `; break; @@ -377,7 +377,7 @@ class A1A2Cell extends ShowForSecondsComponent { this.displayModeChangedPath(true); text = ` - MAN + MAN MCT `; break; @@ -385,7 +385,7 @@ class A1A2Cell extends ShowForSecondsComponent { this.displayModeChangedPath(true); text = ` - MAN + MAN THR `; break; @@ -410,7 +410,7 @@ class A1A2Cell extends ShowForSecondsComponent { this.displayModeChangedPath(); break; case 12: - text = 'THR IDLE'; + text = 'THR IDLE'; this.displayModeChangedPath(); break; case 13: @@ -485,7 +485,7 @@ class A1A2Cell extends ShowForSecondsComponent { render(): VNode { return ( <> - + ); @@ -540,7 +540,7 @@ class A3Cell extends DisplayComponent { private handleAutobrakeMode() { if (this.autobrakeMode === 3 && !this.AB3Message) { this.textSub.set('BRK MAX'); - this.classSub.set('FontMedium MiddleAlign Cyan'); + this.classSub.set('FontMediumSmaller MiddleAlign Cyan'); } else { this.textSub.set(''); } @@ -630,6 +630,8 @@ class B1Cell extends ShowForSecondsComponent { private activeVerticalModeSub = Subject.create(0); + private activeVerticalModeClassSub = Subject.create(''); + private speedProtectionPathRef = FSComponent.createRef(); private inModeReversionPathRef = FSComponent.createRef(); @@ -722,14 +724,18 @@ class B1Cell extends ShowForSecondsComponent { text = 'ALT CRZ'; break; */ case VerticalMode.FPA: { - const FPAText = `${(this.FPA >= 0 ? '+' : '')}${(Math.round(this.FPA * 10) / 10).toFixed(1)}°`; + const FPAText = `${(this.FPA > 0 ? '+' : '')}${(Math.round(this.FPA * 10) / 10).toFixed(1)}°`; text = 'FPA'; + // if FPA is 0 give it an empty space for where the '+' and '-' will be. + if (this.FPA === 0) { + text += ' '; + } additionalText = FPAText; break; } case VerticalMode.VS: { - const VSText = `${(this.selectedVS >= 0 ? '+' : '')}${Math.round(this.selectedVS).toString()}`.padStart(5, ' '); + const VSText = `${(this.selectedVS > 0 ? '+' : '')}${Math.round(this.selectedVS).toString()}`.padStart(5, ' '); text = 'V/S'; @@ -756,10 +762,15 @@ class B1Cell extends ShowForSecondsComponent { this.speedProtectionPathRef.instance.setAttribute('visibility', 'hidden'); } - const boxPathString = this.activeVerticalModeSub.get() === 50 && this.tcasModeDisarmed ? 'm34.656 1.8143h29.918v13.506h-29.918z' : 'm34.656 1.8143h29.918v6.0476h-29.918z'; + const boxPathString = this.activeVerticalModeSub.get() === 50 && this.tcasModeDisarmed ? 'm35.756 1.8143h27.918v13.506h-27.918z' : 'm35.756 1.8143h27.918v6.0476h-27.918z'; this.boxPathStringSub.set(boxPathString); + // VS FPA has a smaller font than the other active modes + const VsFPA = this.activeVerticalModeSub.get() === 14 || this.activeVerticalModeSub.get() === 15; + + this.activeVerticalModeClassSub.set(VsFPA ? 'FontMediumSmaller MiddleAlign Green' : 'FontMedium MiddleAlign Green'); + this.fmaTextRef.instance.innerHTML = `${text}${additionalText}`; return text.length > 0; @@ -823,10 +834,10 @@ class B1Cell extends ShowForSecondsComponent { - - + + - + {/* set directly via innerhtml as tspan was invisble for some reason when set here */} @@ -859,7 +870,7 @@ class B2Cell extends DisplayComponent { let text1: string; let color1 = 'Cyan'; if (clbArmed) { - text1 = 'CLB'; + text1 = ' CLB'; // spaces added to center armed FMA as per newer DMC stnadards } else if (desArmed) { text1 = 'DES'; } else if (altCstArmed) { @@ -882,15 +893,15 @@ class B2Cell extends DisplayComponent { this.text1Sub.set(text1); this.text2Sub.set(text2); - this.classSub.set(`FontMedium MiddleAlign ${color1}`); + this.classSub.set(`FontMediumSmaller MiddleAlign ${color1}`); }); } render(): VNode { return ( - {this.text1Sub} - {this.text2Sub} + {this.text1Sub} + {this.text2Sub} ); } @@ -1011,7 +1022,7 @@ class C1Cell extends ShowForSecondsComponent { return ( - + {this.textSub} ); @@ -1073,7 +1084,7 @@ class C2Cell extends DisplayComponent { render(): VNode { return ( - {this.textSub} + {this.textSub} ); } } @@ -1155,8 +1166,8 @@ const getBC3Message = (isAttExcessive: boolean, armedVerticalMode: number, setHo text = 'FOR GA: SET TOGA'; className = 'PulseAmber9Seconds Amber'; } else if (TCASArmed && !isAttExcessive) { - text = ' TCAS '; - className = 'Cyan'; + text = 'TCAS '; + className = 'FontMediumSmaller Cyan'; } else if (false) { text = 'DISCONNECT AP FOR LDG'; className = 'PulseAmber9Seconds Amber'; @@ -1466,7 +1477,7 @@ class E2Cell extends ShowForSecondsComponent { this.isShown = false; this.textSub.set(''); } else { - const text = `${this.fd1Active ? '1' : '-'} FD ${this.fd2Active ? '2' : '-'}`; + const text = `${this.fd1Active ? '1' : '-'}FD${this.fd2Active ? '2' : '-'}`; this.textSub.set(text); } } diff --git a/fbw-a380x/src/systems/instruments/src/PFD/FlightPathDirector.tsx b/fbw-a380x/src/systems/instruments/src/PFD/FlightPathDirector.tsx index 287e9e12bea..1aaf6749a32 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/FlightPathDirector.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/FlightPathDirector.tsx @@ -1,9 +1,9 @@ import { ClockEvents, DisplayComponent, EventBus, FSComponent, Subscribable, VNode } from '@microsoft/msfs-sdk'; -import { Arinc429Word } from '@shared/arinc429'; import { getDisplayIndex } from './PFD'; import { calculateHorizonOffsetFromPitch } from './PFDUtils'; import { Arinc429Values } from './shared/ArincValueProvider'; import { PFDSimvars } from './shared/PFDSimvarPublisher'; +import { Arinc429Word } from '@flybywiresim/fbw-sdk'; const DistanceSpacing = 15; const ValueSpacing = 10; diff --git a/fbw-a380x/src/systems/instruments/src/PFD/FlightPathVector.tsx b/fbw-a380x/src/systems/instruments/src/PFD/FlightPathVector.tsx index b235b08d59a..060d7297eea 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/FlightPathVector.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/FlightPathVector.tsx @@ -1,8 +1,8 @@ import { ClockEvents, DisplayComponent, EventBus, FSComponent, VNode } from '@microsoft/msfs-sdk'; -import { Arinc429Word } from '@shared/arinc429'; import { calculateHorizonOffsetFromPitch } from './PFDUtils'; import { Arinc429Values } from './shared/ArincValueProvider'; import { PFDSimvars } from './shared/PFDSimvarPublisher'; +import { Arinc429Word } from '@flybywiresim/fbw-sdk'; const DistanceSpacing = 15; const ValueSpacing = 10; diff --git a/fbw-a380x/src/systems/instruments/src/PFD/LandingSystemIndicator.tsx b/fbw-a380x/src/systems/instruments/src/PFD/LandingSystemIndicator.tsx index 3fd9070522e..e05211ab490 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/LandingSystemIndicator.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/LandingSystemIndicator.tsx @@ -1,9 +1,9 @@ import { DisplayComponent, EventBus, FSComponent, HEvent, Subject, VNode } from '@microsoft/msfs-sdk'; import { getDisplayIndex } from 'instruments/src/PFD/PFD'; -import { Arinc429Word } from '@shared/arinc429'; import { Arinc429Values } from './shared/ArincValueProvider'; import { PFDSimvars } from './shared/PFDSimvarPublisher'; import { LagFilter } from './PFDUtils'; +import { Arinc429Word } from '@flybywiresim/fbw-sdk'; export class LandingSystem extends DisplayComponent<{ bus: EventBus, instrument: BaseInstrument }> { private lsButtonPressedVisibility = false; @@ -193,13 +193,13 @@ class LandingSystemInfo extends DisplayComponent<{ bus: EventBus }> { render(): VNode { return ( - {this.identText} - {this.freqTextLeading} - {this.freqTextTrailing} + {this.identText} + {this.freqTextLeading} + {this.freqTextTrailing} - - NM + + NM diff --git a/fbw-a380x/src/systems/instruments/src/PFD/LowerArea.tsx b/fbw-a380x/src/systems/instruments/src/PFD/LowerArea.tsx index be25253739e..efa3b55472a 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/LowerArea.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/LowerArea.tsx @@ -110,8 +110,8 @@ class FlapsIndicator extends DisplayComponent<{ bus: EventBus }> { this.slatsOut = slats > 6.1; - const xFactor = -0.43; - const yFactor = 0.09; + const xFactor = -0.63; + const yFactor = 0.15; const synchroFactor = 0.081; let synchroOffset = 0; @@ -218,9 +218,9 @@ class FlapsIndicator extends DisplayComponent<{ bus: EventBus }> { (i == 2 ? 'NormalStroke Stroke Fill Cyan' : 'NormalStroke White'))} /> (i == 0 ? 'visible' : 'hidden'))} /> - (i == 1 ? 'Fill Stroke NormalStroke Cyan CornerRound' : 'Fill Stroke NormalStroke White CornerRound'))} /> - (i == 2 ? 'Fill Stroke NormalStroke Cyan CornerRound' : 'Fill Stroke NormalStroke White CornerRound'))} /> - (i == 3 ? 'Fill Stroke NormalStroke Cyan CornerRound' : 'Fill Stroke NormalStroke White CornerRound'))} /> + (i == 1 ? 'Fill Stroke NormalStroke Cyan CornerRound' : 'Fill Stroke NormalStroke White CornerRound'))} /> + (i == 2 ? 'Fill Stroke NormalStroke Cyan CornerRound' : 'Fill Stroke NormalStroke White CornerRound'))} /> + (i == 3 ? 'Fill Stroke NormalStroke Cyan CornerRound' : 'Fill Stroke NormalStroke White CornerRound'))} /> (i == 4 ? 'Fill Stroke NormalStroke Cyan CornerRound' : 'Fill Stroke NormalStroke White CornerRound'))} /> {this.targetText} diff --git a/fbw-a380x/src/systems/instruments/src/PFD/PFD.tsx b/fbw-a380x/src/systems/instruments/src/PFD/PFD.tsx index 485b2b6fa9f..ed381fcfd41 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/PFD.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/PFD.tsx @@ -1,7 +1,6 @@ import { A320Failure, FailuresConsumer } from '@flybywiresim/failures'; // eslint-disable-next-line @typescript-eslint/no-unused-vars import { ClockEvents, ComponentProps, DisplayComponent, FSComponent, Subject, VNode } from '@microsoft/msfs-sdk'; -import { Arinc429Word } from '@shared/arinc429'; import { CdsDisplayUnit, DisplayUnitID } from '../MsfsAvionicsCommon/CdsDisplayUnit'; import { LagFilter } from './PFDUtils'; import { Arinc429Values } from './shared/ArincValueProvider'; @@ -14,7 +13,7 @@ import { LandingSystem } from './LandingSystemIndicator'; import { AirspeedIndicator, AirspeedIndicatorOfftape, MachNumber } from './SpeedIndicator'; import { VerticalSpeedIndicator } from './VerticalSpeedIndicator'; import { LowerArea } from 'instruments/src/PFD/LowerArea'; -import { ArincEventBus } from "@flybywiresim/fbw-sdk"; +import { Arinc429Word, ArincEventBus } from "@flybywiresim/fbw-sdk"; import './style.scss'; diff --git a/fbw-a380x/src/systems/instruments/src/PFD/SpeedIndicator.tsx b/fbw-a380x/src/systems/instruments/src/PFD/SpeedIndicator.tsx index 395142769a0..5e0eddcadf3 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/SpeedIndicator.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/SpeedIndicator.tsx @@ -1,11 +1,10 @@ import { ClockEvents, DisplayComponent, EventBus, FSComponent, NodeReference, Subject, Subscribable, VNode } from '@microsoft/msfs-sdk'; -import { Arinc429Word } from '@shared/arinc429'; import { LagFilter, RateLimiter, SmoothSin } from './PFDUtils'; import { PFDSimvars } from './shared/PFDSimvarPublisher'; import { VerticalTape } from './VerticalTape'; import { SimplaneValues } from './shared/SimplaneValueProvider'; import { Arinc429Values } from './shared/ArincValueProvider'; -import { ArincEventBus } from "@flybywiresim/fbw-sdk"; +import { Arinc429Word, ArincEventBus } from "@flybywiresim/fbw-sdk"; const ValueSpacing = 10; const DistanceSpacing = 10; @@ -562,14 +561,12 @@ export class AirspeedIndicator extends DisplayComponent SPD - {/* Outline */} - { + subscriber.on('baroCorrectedAltitude').handle((a) => { this.altitude = new Arinc429Word(a); publisher.pub('altitudeAr', this.altitude); }); @@ -177,6 +196,15 @@ export class ArincValueProvider { publisher.pub('da', this.da); }); + subscriber.on('landingElevation1Raw').handle((elevation) => { + if (getDisplayIndex() === 1) { + this.ownLandingElevation = new Arinc429Word(elevation); + } else { + this.oppLandingElevation = new Arinc429Word(elevation); + } + this.determineAndPublishChosenLandingElevation(publisher); + }); + subscriber.on('staticPressureRaw').handle((sp) => { this.staticPressure = new Arinc429Word(sp); publisher.pub('staticPressure', this.staticPressure); @@ -370,6 +398,22 @@ export class ArincValueProvider { publisher.pub('fcdcDiscreteWord1', new Arinc429Word(pitchRollNormalLawNOWord)); publisher.pub('fcdc1DiscreteWord1', new Arinc429Word(pitchRollNormalLawNOWord)); publisher.pub('fcdc2DiscreteWord1', new Arinc429Word(pitchRollNormalLawNOWord)); + + this.fm1Subs.push(subscriber.on('fm1EisDiscrete2Raw').handle((raw) => publisher.pub('fmEisDiscreteWord2Raw', raw), true)); + this.fm2Subs.push(subscriber.on('fm2EisDiscrete2Raw').handle((raw) => publisher.pub('fmEisDiscreteWord2Raw', raw), true)); + this.fm1Subs.push(subscriber.on('fm1MdaRaw').handle((raw) => publisher.pub('fmMdaRaw', raw), true)); + 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')); + this.fm1Healthy.sub(this.determineFmToUse.bind(this)); + this.fm2Healthy.sub(this.determineFmToUse.bind(this), true); } private determineAndPublishChosenRadioAltitude(publisher: Publisher) { @@ -451,6 +495,19 @@ export class ArincValueProvider { publisher.pub('chosenRa', getDisplayIndex() === 1 ? chosenRas[0] : chosenRas[1]); } + private determineAndPublishChosenLandingElevation(publisher: Publisher) { + const useOpposite = (this.ownLandingElevation.isFailureWarning() + || this.ownLandingElevation.isNoComputedData()) + && !this.oppLandingElevation.isFailureWarning() + && !this.oppLandingElevation.isNoComputedData(); + + if (useOpposite) { + publisher.pub('landingElevation', this.oppLandingElevation); + } else { + publisher.pub('landingElevation', this.ownLandingElevation); + } + } + // Determine which FAC bus to use for FE function. If FAC HEALTHY discrete is low or any word is coded FW, // declare FAC as invalid. For simplicty reasons, only check SSM of words that use the same data, so all failure cases are // handled while minimizing the words that have to be checked. @@ -473,4 +530,19 @@ export class ArincValueProvider { publisher.pub('facToUse', this.facToUse); } + + private determineFmToUse(): void { + const onSideIndex = MathUtils.clamp(getDisplayIndex(), 1, 2); + + const onlyFm1Healthy = this.fm1Healthy.get() && !this.fm2Healthy.get(); + const onlyFm2Healthy = this.fm2Healthy.get() && !this.fm1Healthy.get(); + + if ((onSideIndex === 1 && !onlyFm2Healthy) || onlyFm1Healthy) { + this.fm2Subs.forEach((sub) => sub.pause()); + this.fm1Subs.forEach((sub) => sub.resume(true)); + } else if ((onSideIndex === 2 && !onlyFm1Healthy) || onlyFm2Healthy) { + this.fm1Subs.forEach((sub) => sub.pause()); + this.fm2Subs.forEach((sub) => sub.resume(true)); + } + } } diff --git a/fbw-a380x/src/systems/instruments/src/PFD/shared/PFDSimvarPublisher.tsx b/fbw-a380x/src/systems/instruments/src/PFD/shared/PFDSimvarPublisher.tsx index 909eaf9763f..31e65dbc22f 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/shared/PFDSimvarPublisher.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/shared/PFDSimvarPublisher.tsx @@ -13,7 +13,8 @@ export interface PFDSimvars { pitch: number; roll: number; heading: number; - altitude: number; + baroCorrectedAltitude: number; + pressureAltitude: number; speed: number; staticPressureRaw: number; noseGearCompressed: boolean; @@ -113,6 +114,8 @@ export interface PFDSimvars { xtk: number; ldevRequestLeft: boolean; ldevRequestRight: boolean; + landingElevation1Raw: number; + landingElevation2Raw: number; fac1Healthy: boolean; fac2Healthy: boolean; fac1VAlphaProtRaw: number; @@ -139,6 +142,19 @@ export interface PFDSimvars { fac2EstimatedBetaRaw: number; fac1BetaTargetRaw: number; fac2BetaTargetRaw: number; + fm1NavDiscrete: number; + fm1EisDiscrete2Raw: number; + fm2EisDiscrete2Raw: number; + fm1MdaRaw: number; + fm2MdaRaw: number; + fm1DhRaw: number; + fm2DhRaw: number; + fm1HealthyDiscrete: number; + fm2HealthyDiscrete: number; + fm1TransAltRaw: number; + fm2TransAltRaw: number; + fm1TransLvlRaw: number; + fm2TransLvlRaw: number; } export enum PFDVars { @@ -153,7 +169,8 @@ export enum PFDVars { pitch = 'L:A32NX_ADIRS_IR_1_PITCH', roll = 'L:A32NX_ADIRS_IR_1_ROLL', heading = 'L:A32NX_ADIRS_IR_1_HEADING', - altitude = 'L:A32NX_ADIRS_ADR_1_ALTITUDE', + baroCorrectedAltitude1 = 'L:A32NX_ADIRS_ADR_1_BARO_CORRECTED_ALTITUDE_1', + pressureAltitude = 'L:A32NX_ADIRS_ADR_1_ALTITUDE', speed = 'L:A32NX_ADIRS_ADR_1_COMPUTED_AIRSPEED', staticPressureRaw = 'L:A32NX_ADIRS_ADR_1_CORRECTED_AVERAGE_STATIC_PRESSURE', noseGearCompressed = 'L:A32NX_LGCIU_1_NOSE_GEAR_COMPRESSED', @@ -218,7 +235,6 @@ export enum PFDVars { metricAltToggle = 'L:A32NX_METRIC_ALT_TOGGLE', tla1 = 'L:A32NX_AUTOTHRUST_TLA:1', tla2 = 'L:A32NX_AUTOTHRUST_TLA:2', - landingElevation = 'L:A32NX_PRESS_AUTO_LANDING_ELEVATION', tcasState = 'L:A32NX_TCAS_STATE', tcasCorrective = 'L:A32NX_TCAS_RA_CORRECTIVE', tcasRedZoneL = 'L:A32NX_TCAS_VSPEED_RED:1', @@ -253,6 +269,8 @@ export enum PFDVars { xtk = 'L:A32NX_FG_CROSS_TRACK_ERROR', ldevLeft = 'L:A32NX_FMGC_L_LDEV_REQUEST', ldevRight = 'L:A32NX_FMGC_R_LDEV_REQUEST', + landingElevation1Raw = 'L:A32NX_FM1_LANDING_ELEVATION', + landingElevation2Raw = 'L:A32NX_FM2_LANDING_ELEVATION', fac1Healthy = 'L:A32NX_FAC_1_HEALTHY', fac2Healthy = 'L:A32NX_FAC_2_HEALTHY', fac1VAlphaProtRaw = 'L:A32NX_FAC_1_V_ALPHA_PROT', @@ -279,6 +297,19 @@ export enum PFDVars { fac2EstimatedBetaRaw = 'L:A32NX_FAC_2_ESTIMATED_SIDESLIP', fac1BetaTargetRaw = 'L:A32NX_FAC_1_SIDESLIP_TARGET', fac2BetaTargetRaw = 'L:A32NX_FAC_2_SIDESLIP_TARGET', + fm1NavDiscrete = 'L:A32NX_FM1_NAV_DISCRETE', + fm1EisDiscrete2 = 'L:A32NX_FM1_EIS_DISCRETE_WORD_2', + fm2EisDiscrete2 = 'L:A32NX_FM2_EIS_DISCRETE_WORD_2', + fm1MdaRaw = 'L:A32NX_FM1_MINIMUM_DESCENT_ALTITUDE', + fm2MdaRaw = 'L:A32NX_FM2_MINIMUM_DESCENT_ALTITUDE', + fm1DhRaw = 'L:A32NX_FM1_DECISION_HEIGHT', + 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. */ @@ -295,7 +326,8 @@ export class PFDSimvarPublisher extends UpdatableSimVarPublisher { ['pitch', { name: PFDVars.pitch, type: SimVarValueType.Number }], ['roll', { name: PFDVars.roll, type: SimVarValueType.Number }], ['heading', { name: PFDVars.heading, type: SimVarValueType.Number }], - ['altitude', { name: PFDVars.altitude, type: SimVarValueType.Number }], + ['baroCorrectedAltitude', { name: PFDVars.baroCorrectedAltitude1, type: SimVarValueType.Number }], + ['pressureAltitude', { name: PFDVars.pressureAltitude, type: SimVarValueType.Number }], ['speed', { name: PFDVars.speed, type: SimVarValueType.Number }], ['staticPressureRaw', { name: PFDVars.staticPressureRaw, type: SimVarValueType.Number }], ['noseGearCompressed', { name: PFDVars.noseGearCompressed, type: SimVarValueType.Bool }], @@ -360,7 +392,6 @@ export class PFDSimvarPublisher extends UpdatableSimVarPublisher { ['metricAltToggle', { name: PFDVars.metricAltToggle, type: SimVarValueType.Bool }], ['tla1', { name: PFDVars.tla1, type: SimVarValueType.Number }], ['tla2', { name: PFDVars.tla2, type: SimVarValueType.Number }], - ['landingElevation', { name: PFDVars.landingElevation, type: SimVarValueType.Feet }], ['tcasState', { name: PFDVars.tcasState, type: SimVarValueType.Enum }], ['tcasCorrective', { name: PFDVars.tcasCorrective, type: SimVarValueType.Bool }], ['tcasRedZoneL', { name: PFDVars.tcasRedZoneL, type: SimVarValueType.Number }], @@ -395,6 +426,8 @@ export class PFDSimvarPublisher extends UpdatableSimVarPublisher { ['xtk', { name: PFDVars.xtk, type: SimVarValueType.NM }], ['ldevRequestLeft', { name: PFDVars.ldevLeft, type: SimVarValueType.Bool }], ['ldevRequestRight', { name: PFDVars.ldevRight, type: SimVarValueType.Bool }], + ['landingElevation1Raw', { name: PFDVars.landingElevation1Raw, type: SimVarValueType.Number }], + ['landingElevation2Raw', { name: PFDVars.landingElevation2Raw, type: SimVarValueType.Number }], ['fac1Healthy', { name: PFDVars.fac1Healthy, type: SimVarValueType.Bool }], ['fac2Healthy', { name: PFDVars.fac2Healthy, type: SimVarValueType.Bool }], ['fac1VAlphaProtRaw', { name: PFDVars.fac1VAlphaProtRaw, type: SimVarValueType.Number }], @@ -421,6 +454,19 @@ export class PFDSimvarPublisher extends UpdatableSimVarPublisher { ['fac2EstimatedBetaRaw', { name: PFDVars.fac2EstimatedBetaRaw, type: SimVarValueType.Number }], ['fac1BetaTargetRaw', { name: PFDVars.fac1BetaTargetRaw, type: SimVarValueType.Number }], ['fac2BetaTargetRaw', { name: PFDVars.fac2BetaTargetRaw, type: SimVarValueType.Number }], + ['fm1NavDiscrete', { name: PFDVars.fm1NavDiscrete, type: SimVarValueType.Number }], + ['fm1EisDiscrete2Raw', { name: PFDVars.fm1EisDiscrete2, type: SimVarValueType.Number }], + ['fm2EisDiscrete2Raw', { name: PFDVars.fm2EisDiscrete2, type: SimVarValueType.Number }], + ['fm1MdaRaw', { name: PFDVars.fm1MdaRaw, type: SimVarValueType.Number }], + ['fm2MdaRaw', { name: PFDVars.fm2MdaRaw, type: SimVarValueType.Number }], + ['fm1DhRaw', { name: PFDVars.fm1DhRaw, type: SimVarValueType.Number }], + ['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: EventBus) { diff --git a/fbw-a380x/src/systems/instruments/src/PFD/style.scss b/fbw-a380x/src/systems/instruments/src/PFD/style.scss index d3a8dcb0db5..12a0e396317 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/style.scss +++ b/fbw-a380x/src/systems/instruments/src/PFD/style.scss @@ -111,6 +111,10 @@ font-size: 5.5px; } +.FontMediumSmaller { + font-size: 5.4px; +} + .FontSmall { font-size: 5px; } @@ -119,6 +123,10 @@ font-size: 4.5px; } +.FontTinyToSmallest { + font-size: 4.3px; +} + .FontTiny { font-size: 4px; } diff --git a/fbw-a380x/src/systems/shared/src/arinc429.ts b/fbw-a380x/src/systems/shared/src/arinc429.ts deleted file mode 100644 index 91f3b1fcde8..00000000000 --- a/fbw-a380x/src/systems/shared/src/arinc429.ts +++ /dev/null @@ -1,148 +0,0 @@ -export enum Arinc429SignStatusMatrix { - FailureWarning = 0b00, - NoComputedData = 0b01, - FunctionalTest = 0b10, - NormalOperation = 0b11, -} - -export interface Arinc429WordData { - ssm: Arinc429SignStatusMatrix, - - value: number, - - isFailureWarning(): boolean, - - isNoComputedData(): boolean, - - isFunctionalTest(): boolean, - - isNormalOperation(): boolean, -} - -export class Arinc429Word implements Arinc429WordData { - static u32View = new Uint32Array(1); - - static f32View = new Float32Array(Arinc429Word.u32View.buffer); - - ssm: Arinc429SignStatusMatrix; - - value: number; - - constructor(word: number) { - Arinc429Word.u32View[0] = (word & 0xffffffff) >>> 0; - this.ssm = (Math.trunc(word / 2 ** 32) & 0b11) as Arinc429SignStatusMatrix; - this.value = Arinc429Word.f32View[0]; - } - - static empty(): Arinc429Word { - return new Arinc429Word(0); - } - - static fromSimVarValue(name: string): Arinc429Word { - return new Arinc429Word(SimVar.GetSimVarValue(name, 'number')); - } - - static async toSimVarValue(name: string, value: number, ssm: Arinc429SignStatusMatrix) { - Arinc429Word.f32View[0] = value; - const simVal = Arinc429Word.u32View[0] + Math.trunc(ssm) * 2 ** 32; - return SimVar.SetSimVarValue(name, 'string', simVal.toString()); - } - - isFailureWarning() { - return this.ssm === Arinc429SignStatusMatrix.FailureWarning; - } - - isNoComputedData() { - return this.ssm === Arinc429SignStatusMatrix.NoComputedData; - } - - isFunctionalTest() { - return this.ssm === Arinc429SignStatusMatrix.FunctionalTest; - } - - isNormalOperation() { - return this.ssm === Arinc429SignStatusMatrix.NormalOperation; - } - - /** - * Returns the value when normal operation, the supplied default value otherwise. - */ - valueOr(defaultValue: number | undefined | null) { - return this.isNormalOperation() ? this.value : defaultValue; - } - - getBitValue(bit: number): boolean { - return ((this.value >> (bit - 1)) & 1) !== 0; - } - - getBitValueOr(bit: number, defaultValue: boolean | undefined | null): boolean { - return this.isNormalOperation() ? ((this.value >> (bit - 1)) & 1) !== 0 : defaultValue; - } - - setBitValue(bit: number, value: boolean): void { - if (value) { - this.value |= 1 << (bit - 1); - } else { - this.value &= ~(1 << (bit - 1)); - } - } -} - -export class Arinc429Register implements Arinc429WordData { - u32View = new Uint32Array(1); - - f32View = new Float32Array(this.u32View.buffer); - - ssm: Arinc429SignStatusMatrix; - - value: number; - - static empty() { - return new Arinc429Register(); - } - - private constructor() { - this.set(0); - } - - set(word: number) { - this.u32View[0] = (word & 0xffffffff) >>> 0; - this.ssm = (Math.trunc(word / 2 ** 32) & 0b11) as Arinc429SignStatusMatrix; - this.value = this.f32View[0]; - } - - setFromSimVar(name: string): void { - this.set(SimVar.GetSimVarValue(name, 'number')); - } - - isFailureWarning() { - return this.ssm === Arinc429SignStatusMatrix.FailureWarning; - } - - isNoComputedData() { - return this.ssm === Arinc429SignStatusMatrix.NoComputedData; - } - - isFunctionalTest() { - return this.ssm === Arinc429SignStatusMatrix.FunctionalTest; - } - - isNormalOperation() { - return this.ssm === Arinc429SignStatusMatrix.NormalOperation; - } - - /** - * Returns the value when normal operation, the supplied default value otherwise. - */ - valueOr(defaultValue: number | undefined | null) { - return this.isNormalOperation() ? this.value : defaultValue; - } - - bitValue(bit: number): boolean { - return ((this.value >> (bit - 1)) & 1) !== 0; - } - - bitValueOr(bit: number, defaultValue: boolean | undefined | null): boolean { - return this.isNormalOperation() ? ((this.value >> (bit - 1)) & 1) !== 0 : defaultValue; - } -} diff --git a/fbw-a380x/src/systems/tcas/src/components/TcasComputer.ts b/fbw-a380x/src/systems/tcas/src/components/TcasComputer.ts index c0466267ed6..f29431b8190 100644 --- a/fbw-a380x/src/systems/tcas/src/components/TcasComputer.ts +++ b/fbw-a380x/src/systems/tcas/src/components/TcasComputer.ts @@ -4,7 +4,7 @@ /* eslint-disable no-underscore-dangle */ import { UpdateThrottler } from '@shared/UpdateThrottler'; import { MathUtils } from '@shared/MathUtils'; -import { Arinc429Word } from '@shared/arinc429'; +import { Arinc429Word } from '@flybywiresim/fbw-sdk'; import { TcasComponent } from '@tcas/lib/TcasComponent'; import { LatLongData } from '@typings/fs-base-ui/html_ui/JS/Types'; import { LocalSimVar } from '@shared/simvar';