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

feat(fms): fms-v2 aircraft specific config / VNAV parameters #8493

Open
wants to merge 13 commits into
base: fms-v2
Choose a base branch
from

Conversation

flogross89
Copy link
Contributor

@flogross89 flogross89 commented Feb 15, 2024

Summary of Changes

  • Introduces A380 specific engine and flight model parameters to enable VNAV (predictions).
  • Includes changes to fms-v2 to enable TS strict mode compliance for the MFD
  • Adds units to JSDoc in FlightPlanPerformanceData

Screenshots (if necessary)

n/a

References

Additional context

Discord username (if different from GitHub): floridude

Testing instructions

For A320: Should behave exactly as before, no change expected. Pay attention to VNAV predictions and vertical guidance, e.g. during approach
For A380: Testing being done separately

How to download the PR for QA

Every new commit to this PR will cause a new A32NX artifact 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, click on the bottom PR tab
  4. Click on the A32NX download link at the bottom of the page

@github-actions github-actions bot added this to 🟡 Code Review: Ready for Review in Quality Assurance Feb 15, 2024
@@ -471,7 +471,7 @@ export class FlightPlan<P extends FlightPlanPerformanceData = FlightPlanPerforma
*
* The union type in the signature is to work around https://github.com/microsoft/TypeScript/issues/28662.
*/
setPerformanceData<k extends(keyof (P & FlightPlanPerformanceDataProperties)) & string>(key: k, value: P[k], notify = true) {
setPerformanceData<k extends(keyof (P & FlightPlanPerformanceDataProperties)) & string>(key: k, value: P[k] | null, notify = true) {
Copy link
Member

Choose a reason for hiding this comment

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

Why can value be null? If anything, it should be undefined I think?

Copy link
Member

Choose a reason for hiding this comment

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

I always prefer null, because it has to be explicit, and more importantly, it avoids bugs with the EventBus.

Copy link
Member

Choose a reason for hiding this comment

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

I agree, but then the performance data properties should also be marked as nullable.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I removed this part, and marked the values themselves as nullable.

@@ -6,25 +6,34 @@
import { MathUtils } from '@flybywiresim/fbw-sdk';

export interface FlightPlanPerformanceData {
/** in knots */
Copy link
Member

Choose a reason for hiding this comment

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

For all of these properties, specify what value they take if not filled in.

Copy link
Member

Choose a reason for hiding this comment

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

And also what they are, not just the unit.

@@ -87,7 +90,7 @@ export class Predictions {
const theta2 = Common.getTheta2(theta, mach);
const delta2 = Common.getDelta2(delta, mach);
const correctedN1 = EngineModel.getCorrectedN1(commandedN1, theta2);
const correctedThrust = EngineModel.tableInterpolation(EngineModel.table1506, correctedN1, mach) * 2 * EngineModel.maxThrust;
const correctedThrust = EngineModel.tableInterpolation(EngineModel.table1506, correctedN1, mach) * 2 * config.engineModelParameters.maxThrust;
Copy link
Member

Choose a reason for hiding this comment

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

What do you intend to do with the tables in EngineModel? They should also be aircraft-specific.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would want to wait for the A380 engine model to decide where to put these tables. Maybe we would have to use a completely different approach. Refactoring it later on should be easy.

@@ -79,7 +79,7 @@ export class Navigation implements NavigationProvider {
facility: null,
}));

constructor(private flightPlanService: FlightPlanService, private readonly facLoader: FacilityLoader) {
constructor(private flightPlanService: FlightPlanService, private readonly facLoader?: FacilityLoader) {
Copy link
Member

Choose a reason for hiding this comment

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

Why can facLoader be optional?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As far as I can see, it's currently not used in this class?

Copy link
Member

Choose a reason for hiding this comment

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

I see. In this case, we should probably just remove facLoader as an argument.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right. Just pushed that in the latest commit.

fbw-a32nx/src/systems/fmgc/src/efis/EfisSymbols.ts Outdated Show resolved Hide resolved
Quality Assurance automation moved this from 🟡 Code Review: Ready for Review to 🔴 Code Review: In progress Feb 16, 2024
Copy link
Member

@BlueberryKing BlueberryKing left a comment

Choose a reason for hiding this comment

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

LGTM!

Quality Assurance automation moved this from 🔴 Code Review: In progress to 🟣 QA Team Review: Ready to Test Mar 2, 2024
@flogross89 flogross89 added Not Ready For Testing Not ready for testing as still being discussed or developed. and removed QA Tier 2 QA Ready to Test labels Apr 2, 2024
@flogross89 flogross89 moved this from 🟣 QA Team Review: Ready to Test to ⌛ Awaiting Actions in Quality Assurance Apr 2, 2024
@flogross89 flogross89 force-pushed the feat-fms-v2-aircraft-config-2 branch from 0077126 to 4923dcd Compare April 16, 2024 23:52
@flogross89 flogross89 force-pushed the feat-fms-v2-aircraft-config-2 branch from bea2f6b to 4741730 Compare April 21, 2024 18:47
@flogross89 flogross89 force-pushed the feat-fms-v2-aircraft-config-2 branch from 08e840c to 68f50ff Compare April 21, 2024 20:18
@2hwk
Copy link
Member

2hwk commented Apr 25, 2024

Will be impacted by the potential future merge freeze. #8466 will be required to be merged into this PR at some point.

…-v2-aircraft-config-2

# Conflicts:
#	fbw-a32nx/src/systems/fmgc/src/guidance/GuidanceController.ts
…-v2-aircraft-config-2

# Conflicts:
#	fbw-a32nx/src/systems/fmgc/src/efis/EfisSymbols.ts
#	fbw-a32nx/src/systems/fmgc/src/flightplanning/new/FlightPlanService.ts
#	fbw-a32nx/src/systems/fmgc/src/flightplanning/new/WaypointEntryUtils.ts
#	fbw-a32nx/src/systems/fmgc/src/flightplanning/new/interface/DisplayInterface.ts
#	fbw-a32nx/src/systems/fmgc/src/flightplanning/new/plans/BaseFlightPlan.ts
#	fbw-a32nx/src/systems/fmgc/src/flightplanning/new/plans/FlightPlan.ts
#	fbw-a32nx/src/systems/fmgc/src/flightplanning/new/plans/performance/FlightPlanPerformanceData.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/GuidanceController.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/lnav/LnavDriver.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/vnav/CostIndex.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/vnav/CruiseToDescentCoordinator.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/vnav/EngineModel.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/vnav/FlightModel.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/vnav/Predictions.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/vnav/VerticalProfileManager.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/vnav/VnavDriver.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/vnav/climb/ClimbPathBuilder.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/vnav/climb/ClimbStrategy.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/vnav/cruise/CruisePathBuilder.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/vnav/descent/ApproachPathBuilder.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/vnav/descent/DescentPathBuilder.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/vnav/descent/DescentStrategy.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/vnav/descent/GeometricPathBuilder.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/vnav/descent/TacticalDescentPathBuilder.ts
#	fbw-a32nx/src/systems/fmgc/src/guidance/vnav/takeoff/TakeoffPathBuilder.ts
#	fbw-a32nx/src/systems/fmgc/src/index.ts
#	fbw-a32nx/src/systems/fmgc/src/navigation/Navigation.ts
@flogross89
Copy link
Contributor Author

lint-fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Do Not Merge Not Ready For Testing Not ready for testing as still being discussed or developed.
Projects
Quality Assurance
⌛ Awaiting Actions
Development

Successfully merging this pull request may close these issues.

None yet

4 participants