-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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(a380x/fms): Add (auto) step climbs; Allow CLB/DES constraint selection #9804
feat(a380x/fms): Add (auto) step climbs; Allow CLB/DES constraint selection #9804
Conversation
Just a small question, does optimum step point take into account wind? Or just based on gross weight? |
@aadee9940 In the real aircraft, winds are taken into account. However, the optimum step point calculation won't be implemented as part of this PR. Furthermore, wind import needs bigger adaptions to the FMS, so this will likely take some time. |
Could you also hook up the "STEP DELETED" MFD message? Should be as simple as listening to the |
Good point, thanks! Just pushed the changes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work 💯
fbw-a380x/src/systems/instruments/src/MFD/FMC/FlightManagementComputer.ts
Outdated
Show resolved
Hide resolved
if (revWptIdx && this.props.fmcService.master?.revisedWaypointIndex.get() !== undefined) { | ||
this.selectedWaypointIndex.set(revWptIdx - activeLegIndex - 1); | ||
const revWptIdx = this.props.fmcService.master?.revisedWaypointLegIndex.get(); | ||
if (revWptIdx !== null && revWptIdx !== undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When would revWptIdx
be null or undefined? In this case, we should probably also set selectedLegIndex
to null or undefined. Otherwise we may get into a bit of an awkward state where revWptIdx
is falsy but selectedLegIndex
is not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, selectedLegIndex should also be changed.
revisedLegIndex can be undefined if there's no FMC present or not yet initialized (i.e. this.props.fmcService.master resolves to undefined), and null if no leg is currently being revised
fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/F-PLN/MfdFmsFplnVertRev.tsx
Outdated
Show resolved
Hide resolved
fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/F-PLN/MfdFmsFplnVertRev.tsx
Outdated
Show resolved
Hide resolved
this.props.fmcService.master.flightPlanService.setPilotEnteredSpeedConstraintAt( | ||
this.selectedLegIndex, | ||
this.spdConstraintTypeRadioSelected.get() === 1, | ||
newSpeed ?? 250, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the reason for this default value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No reason, I somehow thought that setPilotEnteredSpeedConstraintAt always expects a speed constraint but this makes it impossible to delete them. Removed the default value.
fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/F-PLN/MfdFmsFplnVertRev.tsx
Outdated
Show resolved
Hide resolved
} | ||
} | ||
|
||
private tryDeleteCruiseStep(lineIndex: number, dropdownIndex: number, altitude: number | null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need altitude
here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If either the waypoint field or the altitude field is un-set, the cruise step shall be deleted (that's how I think it works). But it's better to do this check in the input field which calls the method, not here. So I moved it.
document.getElementById(`${this.props.idPrefix}_label_${idx}`)?.classList.remove('white'); | ||
|
||
document.getElementById(`${this.props.idPrefix}_label_${idx}`)?.classList.add(v); | ||
document |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we store a ref to the element rather than fetching it with getElementById
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea! Changed the whole class to refs instead of getElementById
|
||
private tmpyInsertButtonDiv = FSComponent.createRef<HTMLDivElement>(); | ||
set selectedLegIndex(legIndex: number | null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something I don't understand about the avionics framework. You have a lot of derived state in this component. For example selectedLegIndex
can be derived immediately from dropdownMenuSelectedWaypointIndex
and availableWaypointsToLegIndex
. This means you have quite a bit of code to keep these state variables in-sync. Would it make more sense to derive e.g selectedLegIndex
at render time or is this the proper way to do it with the framework?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Usually you would used MappedSubjects for that. You don't invalidate an entire component and rebuild the whole DOM for it like react because that's incredibly expensive, and why react instruments cause stutter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We talked on Discord about that. Ideally you would also use MappedSubjects for e.g. selectedLegIndex, but in this case the dependencies are kind of convoluted and not fully subject-ified (for example the flight plan data), so I think it's better to stick with the function approach for now. But I'm having another look over it right now, maybe that might change.
42b3fe0
to
6cbb0b4
Compare
Quick question @flogross89. Is there a way to fully automate the auto-step climb like the PMDG? The FMS already calculates the OPT FL and can predict when it should climb. Just a thought. |
In principle that's possible, we would need optimum step climb calculation for that though, which is out of scope of this PR. But can be added in the future. |
fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/F-PLN/MfdFmsFplnVertRev.tsx
Outdated
Show resolved
Hide resolved
fbw-a380x/src/systems/instruments/src/MFD/pages/FMS/F-PLN/MfdFmsFplnVertRev.tsx
Outdated
Show resolved
Hide resolved
Quality Assurance Trainee Report Discord Username : utkrishtm Testing Process:
Route: HAROB6 HQM DCT SEDAR DCT 43N131W 40N136W 37N140W DCT HELOP A332 AUNTI R463 APACK MAGGI3 Testing Results: Negatives:
After the third step climb, it successfully reached FL 400; however, it removed the next point at 37N140W, which was a S/D to FL 380. I tried to edit the point; however, when I tried to change HELOP to 37N140W, it wouldn't let me (see the Video Attached). I had to delete the entire point and then add 37N140W again. I'm not sure if that behavior is intended.
Conclusions:
Media: Original Programming of Step Climbs Please do let me know if anything is confusing here. Sorry if I dumped everything here. |
Quality Assurance Trainee Report Discord Username : utkrishtm Testing Process:
Route: HAROB6 HQM DCT SEDAR DCT 43N131W 40N136W 37N140W DCT HELOP A332 AUNTI R463 APACK MAGGI3 Testing Results: Negatives:
Media: |
Hi to all! |
It's currently being tested, however you will be able to install it via the installer (when choosing development version) after this has merged. |
Quality Assurance Report Discord Username : floridude Testing Process:
Testing Results: |
hi there, i am in no means a IT guy but wanted to try this one out but it bugs out with navigraph charts, therefore i cant connect due to "insufficient .env file |
@cheddar22 this has already been merged, use the installer as per normal. |
now i use develop version, bit step climb not avail... |
Did you update the version via the installer? Could take a few hours to refresh |
Also, did you Enable "Auto Step Climb" in EFB Realism Settings? |
Fixes #9486
Summary of Changes
Adds step climbs to A380X.
Changes:
Out of scope (i.e. not implemented):
Changelog will be added shortly before merge.
Screenshots (if necessary)
References
Additional context
Discord username (if different from GitHub):
Testing instructions
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.