diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index b53279b3882..971f22d4efd 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -125,7 +125,8 @@ 1. [A380X/FCU] Add TRUE indication on FCU when TRUE North reference is selected on AFS CP - @heclak (Heclak) 1. [A380X/MFD] Add airport data page into the MFD (DATA > AIRPORT) - @bulenteroglu (senolitam) 1. [A380X/EFB] Adds PRIM/SEC/FCDC failures to EFB - @flogross89 (floridude) - +1. [A380X/PFD] Fix precision of pitch trim indicator - @flogross89 (floridude) +1. [A380X/MFD] Add leading zero to altitude prediction and track from last waypoint on FPLN page - @bulenteroglu (senolitam) ## 0.12.0 diff --git a/fbw-a32nx/src/systems/shared/src/performance/a32nx_takeoff.ts b/fbw-a32nx/src/systems/shared/src/performance/a32nx_takeoff.ts index 6a56f4802c4..2bf31ac5377 100644 --- a/fbw-a32nx/src/systems/shared/src/performance/a32nx_takeoff.ts +++ b/fbw-a32nx/src/systems/shared/src/performance/a32nx_takeoff.ts @@ -82,7 +82,7 @@ export class A320251NTakeoffPerformanceCalculator implements TakeoffPerformanceC /** CONF 1+F runway limited weights at sea level/ISA/0 slope/no bleed/fwd cg/no wind/dry, MTOW [kg], runway length [metres] => lookup key = (runway length) */ private static readonly runwayPerfLimitConf1 = new LerpLookupTable([ - [54_000, 1000], + [53_950, 1000], [59_300, 1219], [68_700, 1604], [75_700, 1959], @@ -914,31 +914,31 @@ export class A320251NTakeoffPerformanceCalculator implements TakeoffPerformanceC }; private static readonly v2SecondSegBrakeThresholds: Record = { - 1: [-0.009368, 186.79], + 1: [-0.011031, 189.0], 2: [0.02346, 68.33], - 3: [0.022112, 83.141], + 3: [0.014175, 106.14], }; private static readonly v2SecondSegBrakeBaseTable1: Record = { 1: [0.72637, 101.077], - 2: [0.74005, 97.073], + 2: [0.74005, 97.048], 3: [0.3746, 130.078], }; private static readonly v2SecondSegBrakeBaseTable2: Record = { - 1: [0.63964, 102.127], - 2: [0.692636, 92.9863], + 1: [0.868263, 85.8], + 2: [0.46666, 111.0], 3: [0.859926, 82.4377], }; private static readonly v2SecondSegBrakeRunwayTable1: Record = { 1: [3180, -0.015997], - 2: [3180, -0.014862], + 2: [3180, -0.012], 3: [3180, -0.019296], }; private static readonly v2SecondSegBrakeRunwayTable2: Record = { - 1: [3180, -0.003612], + 1: [3180, -0.007], 2: [3180, -0.007], 3: [3180, -0.013], }; diff --git a/fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/F-PLN/MfdFmsFpln.tsx b/fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/F-PLN/MfdFmsFpln.tsx index a08180e3e91..fb97bdbdb41 100644 --- a/fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/F-PLN/MfdFmsFpln.tsx +++ b/fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/F-PLN/MfdFmsFpln.tsx @@ -1304,7 +1304,7 @@ class FplnLegLine extends DisplayComponent { this.fpaRef.instance.innerText = ''; } else { this.trackRef.instance.innerText = data.trackFromLastWpt - ? `${data.trackFromLastWpt.toFixed(0)}°${this.props.trueTrack.get() ? 'T' : ''}` + ? `${data.trackFromLastWpt.toFixed(0).padStart(3, '0')}°${this.props.trueTrack.get() ? 'T' : ''}` : ''; this.distRef.instance.innerText = data.distFromLastWpt?.toFixed(0) ?? ''; this.fpaRef.instance.innerText = data.fpa ? data.fpa.toFixed(1) : ''; @@ -1445,7 +1445,11 @@ class FplnLegLine extends DisplayComponent { ) { altStr = "; } else if (!isBelowTransAlt) { - altStr = {`FL${Math.round(data.altitudePrediction / 100).toString()}`}; + altStr = ( + {`FL${Math.round(data.altitudePrediction / 100) + .toString() + .padStart(3, '0')}`} + ); } else { const roundedAltitude = MathUtils.round(data.altitudePrediction, 10).toFixed(0); altStr = {roundedAltitude}; diff --git a/fbw-a380x/src/systems/instruments/src/PFD/PFD.tsx b/fbw-a380x/src/systems/instruments/src/PFD/PFD.tsx index 385b8be4864..46e53d877a5 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/PFD.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/PFD.tsx @@ -1,4 +1,3 @@ -import { A380Failure } from '@flybywiresim/failures'; import { ClockEvents, ComponentProps, @@ -103,8 +102,6 @@ export class PFDComponent extends DisplayComponent { public onAfterRender(node: VNode): void { super.onAfterRender(node); - this.failuresConsumer.register(getDisplayIndex() === 1 ? A380Failure.LeftPfdDisplay : A380Failure.RightPfdDisplay); - this.sub.on('headingAr').handle((h) => { if (this.headingFailed.get() !== h.isNormalOperation()) { this.headingFailed.set(!h.isNormalOperation()); @@ -124,11 +121,6 @@ export class PFDComponent extends DisplayComponent { .atFrequency(1) .handle((_t) => { this.failuresConsumer.update(); - this.displayFailed.set( - this.failuresConsumer.isActive( - getDisplayIndex() === 1 ? A380Failure.LeftPfdDisplay : A380Failure.RightPfdDisplay, - ), - ); if ( !this.isAttExcessive.get() && ((this.pitch.isNormalOperation() && (this.pitch.value > 25 || this.pitch.value < -13)) || diff --git a/fbw-a380x/src/systems/instruments/src/PFD/PitchTrimDisplay.tsx b/fbw-a380x/src/systems/instruments/src/PFD/PitchTrimDisplay.tsx index f10a16d143d..5966a11206a 100644 --- a/fbw-a380x/src/systems/instruments/src/PFD/PitchTrimDisplay.tsx +++ b/fbw-a380x/src/systems/instruments/src/PFD/PitchTrimDisplay.tsx @@ -41,7 +41,7 @@ export class PitchTrimDisplay extends DisplayComponent<{ bus: EventBus; visible: private readonly fwcFlightPhase = ConsumerSubject.create(this.sub.on('fwcFlightPhase'), 0); - private readonly cgPercent = ConsumerSubject.create(this.sub.on('cgPercent').withPrecision(2), 0).map( + private readonly cgPercent = ConsumerSubject.create(this.sub.on('cgPercent').withPrecision(4), 0).map( (it) => it * 100, ); diff --git a/fbw-a380x/src/systems/shared/src/OperatingSpeeds.tsx b/fbw-a380x/src/systems/shared/src/OperatingSpeeds.tsx index f5fcd90d7c3..c8fd7d26b9a 100644 --- a/fbw-a380x/src/systems/shared/src/OperatingSpeeds.tsx +++ b/fbw-a380x/src/systems/shared/src/OperatingSpeeds.tsx @@ -402,29 +402,14 @@ function getVfeNIdx(fi: number): number { } } -/** - * Convert degrees Celsius into Kelvin - * @param T degrees Celsius - * @returns degrees Kelvin - */ -function convertCtoK(T: number): number { - return T + 273.15; -} - /** * Get correct Vmax for Vmo and Mmo in knots * @returns Min(Vmo, Mmo) * @private */ function getVmo() { - return Math.min( - Vmo, - MathUtils.convertMachToKCas( - Mmo, - convertCtoK(Simplane.getAmbientTemperature()), - SimVar.GetSimVarValue('AMBIENT PRESSURE', 'millibar'), - ), - ); + // FIXME use ADR corrected average static pressure + return Math.min(Vmo, MathUtils.convertMachToKCas(Mmo, SimVar.GetSimVarValue('AMBIENT PRESSURE', 'millibar'))); } export class A380OperatingSpeeds { diff --git a/fbw-common/src/systems/shared/src/MathUtils.spec.ts b/fbw-common/src/systems/shared/src/MathUtils.spec.ts index 5ff140552f5..51600fc9239 100644 --- a/fbw-common/src/systems/shared/src/MathUtils.spec.ts +++ b/fbw-common/src/systems/shared/src/MathUtils.spec.ts @@ -143,4 +143,14 @@ describe('MathUtils.correctMsfsLocaliserError', () => { expect(MathUtils.correctMsfsLocaliserError(177.5)).toBeCloseTo(2.5); expect(MathUtils.correctMsfsLocaliserError(90.1)).toBeCloseTo(89.9); }); + + describe('MathUtils.convertMachToKCas', () => { + it('correctly converts mach to CAS', () => { + expect(MathUtils.convertMachToKCas(0, 1013.25)).toBeCloseTo(0); + expect(MathUtils.convertMachToKCas(0.84, 1013.25)).toBeCloseTo(555.634); + // FL350 = 238.423 hPa + expect(MathUtils.convertMachToKCas(0, 238.423)).toBeCloseTo(0); + expect(MathUtils.convertMachToKCas(0.84, 238.423)).toBeCloseTo(287.097); + }); + }); }); diff --git a/fbw-common/src/systems/shared/src/MathUtils.ts b/fbw-common/src/systems/shared/src/MathUtils.ts index a835dee0608..1ecf06db53a 100644 --- a/fbw-common/src/systems/shared/src/MathUtils.ts +++ b/fbw-common/src/systems/shared/src/MathUtils.ts @@ -289,7 +289,7 @@ export class MathUtils { return ( 1479.1 * Math.sqrt( - ((pressure / 1013) * ((1 + (1 / (oat / 288.15)) * (tas / 1479.1) ** 2) ** 3.5 - 1) + 1) ** (1 / 3.5) - 1, + ((pressure / 1013.25) * ((1 + (1 / (oat / 288.15)) * (tas / 1479.1) ** 2) ** 3.5 - 1) + 1) ** (1 / 3.5) - 1, ) ); } @@ -306,7 +306,7 @@ export class MathUtils { 1479.1 * Math.sqrt( (oat / 288.15) * - (((1 / (pressure / 1013)) * ((1 + 0.2 * (kcas / 661.4786) ** 2) ** 3.5 - 1) + 1) ** (1 / 3.5) - 1), + (((1 / (pressure / 1013.25)) * ((1 + 0.2 * (kcas / 661.4786) ** 2) ** 3.5 - 1) + 1) ** (1 / 3.5) - 1), ) ); } @@ -318,8 +318,11 @@ export class MathUtils { * @param pressure current pressure hpa * @returns Calibrated Air Speed */ - public static convertMachToKCas(mach: number, oat: number, pressure: number): number { - return MathUtils.convertTasToKCas(MathUtils.convertMachToKTas(mach, oat), oat, pressure); + public static convertMachToKCas(mach: number, pressure: number): number { + // Formula from Jet Transport Performance Methods 2009. + return ( + 1479.1 * Math.sqrt(Math.pow((pressure / 1013.25) * (Math.pow(0.2 * mach * mach + 1, 3.5) - 1) + 1, 1 / 3.5) - 1) + ); } /**