Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(380x/mfd): enter dest data message not clearing automatically #9896

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

BravoMike99
Copy link
Contributor

@BravoMike99 BravoMike99 commented Mar 8, 2025

Fixes #9836

Summary of Changes

Fixes destination data message not automatically clearing after the required data is inserted.

Screenshots (if necessary)

References

Additional context

Discord username (if different from GitHub):
bruno_pt99

Testing instructions

A380X:
Program a flight plan of your choice and be at less than 180NM from the destination in the cruise phase without any data entered on the PERF APPR page. Verify "ENTER DEST DATA" amber message appears.
Insert Wind, QNH & temperature on the PERF APPR page and verify the message automatically disappears after doing so.
A32NX (regression testing):
Verify you can update & clear the winds in the approach performance page and that the VAPP is updated accordingly.
Check that ENTER DEST DATA message works (same instructions as the a380x ones)

How to download the PR for QA

Every new commit to this PR will cause new A32NX and A380X artifacts to be created, built, and uploaded.

  1. Make sure you are signed in to GitHub
  2. Click on the Checks tab on the PR
  3. On the left side, find and click on the PR Build tab
  4. Click on either flybywire-aircraft-a320-neo, flybywire-aircraft-a380-842 (4K) or flybywire-aircraft-a380-842 (8K) download link at the bottom of the page

@BravoMike99 BravoMike99 added the A380X Related to the A380X aircraft label Mar 8, 2025
@BravoMike99 BravoMike99 force-pushed the fix-380-mfd-dest-data-auto-clear branch from 0d1897f to 1d21406 Compare March 8, 2025 16:52
@BravoMike99 BravoMike99 marked this pull request as draft March 8, 2025 17:05
@BravoMike99 BravoMike99 marked this pull request as ready for review March 8, 2025 17:24
Copy link
Member

@tracernz tracernz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Just some nits for strict type safety.

const activePlan = this.currFlightPlanService.active;
const destination = activePlan.destinationAirport;

if (!destination || !destination.location || !isFinite(this.perfApprWindHeading)) {
return { direction: 0, speed: 0 };
if (!destination || !destination.location || this.perfApprWindHeading == null || this.perfApprWindSpeed == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!destination || !destination.location || this.perfApprWindHeading == null || this.perfApprWindSpeed == null) {
if (!destination || !destination.location || this.perfApprWindHeading === null || this.perfApprWindSpeed === null) {

@@ -4391,7 +4392,7 @@ export abstract class FMCMainDisplay implements FmsDataInterface, FmsDisplayInte
}

public updateTowerHeadwind() {
if (isFinite(this.perfApprWindSpeed) && isFinite(this.perfApprWindHeading)) {
if (this.perfApprWindHeading != null && this.perfApprWindSpeed != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (this.perfApprWindHeading != null && this.perfApprWindSpeed != null) {
if (this.perfApprWindHeading !== null && this.perfApprWindSpeed !== null) {

@@ -4040,7 +4041,7 @@ export abstract class FMCMainDisplay implements FmsDataInterface, FmsDisplayInte
*/
private getVAppGsMini() {
let vAppTarget = this.getVApp();
if (isFinite(this.perfApprWindSpeed) && isFinite(this.perfApprWindHeading)) {
if (this.perfApprWindSpeed !== null && this.perfApprWindHeading != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (this.perfApprWindSpeed !== null && this.perfApprWindHeading != null) {
if (this.perfApprWindSpeed !== null && this.perfApprWindHeading !== null) {

Comment on lines 2037 to 2038
this.perfApprWindHeading != null &&
this.perfApprWindSpeed != null
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
this.perfApprWindHeading != null &&
this.perfApprWindSpeed != null
this.perfApprWindHeading !== null &&
this.perfApprWindSpeed !== null

@@ -1515,7 +1516,7 @@ export abstract class FMCMainDisplay implements FmsDataInterface, FmsDisplayInte
weight = this.zeroFuelWeight + Math.max(0, (vnavPrediction.estimatedFuelOnBoard * 0.4535934) / 1000);
}
// if pilot has set approach wind in MCDU we use it, otherwise fall back to current measured wind
if (isFinite(this.perfApprWindSpeed) && isFinite(this.perfApprWindHeading)) {
if (this.perfApprWindSpeed != null && this.perfApprWindHeading != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (this.perfApprWindSpeed != null && this.perfApprWindHeading != null) {
if (this.perfApprWindSpeed !== null && this.perfApprWindHeading !== null) {

magWindHeadingCell = ('' + mcdu.perfApprWindHeading.toFixed(0)).padStart(3, '0');
}
let magWindSpeedCell = '[\xa0]';
if (isFinite(mcdu.perfApprWindSpeed)) {
if (mcdu.perfApprWindSpeed != null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (mcdu.perfApprWindSpeed != null) {
if (mcdu.perfApprWindSpeed !== null) {

@@ -205,6 +205,15 @@ export class FlightManagementComputer implements FmcInterface {

private wasReset = false;

private readonly destDataEntered = MappedSubject.create(
([qnh, temperature, wind]) => qnh !== null && temperature != null && wind !== null,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
([qnh, temperature, wind]) => qnh !== null && temperature != null && wind !== null,
([qnh, temperature, wind]) => qnh !== null && temperature !== null && wind !== null,

@@ -979,7 +979,7 @@ export class FmcAircraftInterface {
let towerHeadwind = 0;
const appWind = this.fmgc.data.approachWind.get();
const destRwy = this.fmgc.getDestinationRunway();
if (appWind && Number.isFinite(appWind.speed) && Number.isFinite(appWind.direction)) {
if (appWind) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (appWind) {
if (appWind !== null) {

@@ -1196,7 +1196,7 @@ export class FmcAircraftInterface {
// if pilot has set approach wind in MCDU we use it, otherwise fall back to current measured wind
const appWind = this.fmgc.data.approachWind.get();
let towerHeadwind = 0;
if (appWind && Number.isFinite(appWind.speed) && Number.isFinite(appWind.direction)) {
if (appWind) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (appWind) {
if (appWind !== null) {

public readonly approachWindSpeed = Subject.create<number | null>(null);

public readonly approachWind: MappedSubject<number[], FmcWindVector | null> = MappedSubject.create(
([direction, speed]) => (direction != null && speed !== null ? { direction: direction, speed: speed } : null),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
([direction, speed]) => (direction != null && speed !== null ? { direction: direction, speed: speed } : null),
([direction, speed]) => (direction !== null && speed !== null ? { direction: direction, speed: speed } : null),

@BravoMike99 BravoMike99 force-pushed the fix-380-mfd-dest-data-auto-clear branch from 15c6f59 to 97b75ff Compare March 9, 2025 12:36
@BravoMike99
Copy link
Contributor Author

Nice. Just some nits for strict type safety.

Thanks, should be sorted now if I didn't miss any.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A380X Related to the A380X aircraft
Projects
Status: 🟡 Code Review: Ready for Review
Development

Successfully merging this pull request may close these issues.

The label ENTER TEST DATA on the APPR tab
2 participants