feat(A380X/mfd): improved compute lrc#10470
feat(A380X/mfd): improved compute lrc#10470Lucas-IQ21 wants to merge 3 commits intoflybywiresim:masterfrom
Conversation
…aircraft into feat_add_compute_lrc
| const crzFL = pd?.cruiseFlightLevel?.get(); | ||
| const grossWeightKg = SimVar.GetSimVarValue('TOTAL WEIGHT', 'pounds') * 0.453592; | ||
| const isaDev = | ||
| SimVar.GetSimVarValue('AMBIENT TEMPERATURE', 'celsius') - |
There was a problem hiding this comment.
Values from the ADIRS should be used, not magic sim values.
| // Compute LRC | ||
| const pd = this.loadedFlightPlan?.performanceData; | ||
| const crzFL = pd?.cruiseFlightLevel?.get(); | ||
| const grossWeightKg = SimVar.GetSimVarValue('TOTAL WEIGHT', 'pounds') * 0.453592; |
There was a problem hiding this comment.
I think we may have a system that computes gross weight. Also, avoid conversions using magic numbers. @tracernz what's the conversion utilities we should use here?
There was a problem hiding this comment.
The FMS indeed calculates GW itself already and that should be used.
For future: when reading a simvar you can specify the units you want and the sim will do the conversion for you. If you need to do manual conversions in instruments with msfs-sdk you can use UnitType to do the conversion.
| SimVar.GetSimVarValue('AMBIENT TEMPERATURE', 'celsius') - | ||
| SimVar.GetSimVarValue('STANDARD ATM TEMPERATURE', 'celsius'); | ||
| if (this.activeFlightPhase.get() >= FmgcFlightPhase.Cruise && crzFL > 0) { | ||
| const lrc = new Lrc({ |
There was a problem hiding this comment.
We shouldn’t need to allocate new objects all the time for things like this. We want to avoid allocations as much as reasonably possible.
|
Could you perhaps also set the calculated value as the managed speed target, when the active cost index mode is LRC? |
|
More information is needed on exactly what you are using for lift, drag, and fuel flow parameters as a function of weight, altitude, temperature, and speed. |
Fixes #[issue_no]
Summary of Changes
Improved LRC compute FMS perf cuize page.
Screenshots (if necessary)
References
https://www.fzt.haw-hamburg.de/pers/Scholz/arbeiten/HAW-TextCaers.pdf -> 2.1.4 Long-Range Cruise Speed
https://ansperformance.eu/library/airbus-fuel-economy.pdf
FCOM :

Additional context
Previously, the LCR speed was simply specified as a fixed value, but now it is calculated based on ISA temp, the weight, and the altitude of the aircraft.
Discord username (if different from GitHub): Lucas-IQ
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.