Suggestion: Auto-load aircraft performance profile based on path
JT8D-17 opened this issue · comments
It would be a minor quality of life improvement if LittleNavMap stored paths to aircraft in its aircraft performance profiles and automatically loaded them if the associated aircraft in was loaded in the simulator.
Here's a suggested design outline for such a feature for X-Plane (I'm sure there's similar methods in other simulators):
-
Reading the path to the user aircraft can be done with XPLMGetNthAircraftModel, with "inIndex" = 0. "outPath" returns the path to the ACF file.
-
LittleXPConnect would read the path at every aircraft reload or flight start event and then either:
- iterate through all ".lnmperf" files to find a matching path
or - access a database file that contains the path to an ACF file and its associated .lnmperf file (to avoid iterating through files).
- iterate through all ".lnmperf" files to find a matching path
-
Upon finding a matching lnmperf file, said file would be loaded. No match naturally would of course not do anything.
-
This would be done at LNM startup or aircraft reloads (changes) triggered in X-Plane.
-
Adding a path would be done in the aircraft performance editor by clicking an "Add Path" button or filling in the text field manually.
-
Supporting multiple paths per performance files would also be possible so that different ACF files for the same aircraft (e.g. passenger and cargo variants) can access the same data.
Already on the list.
The aircraft model (ICAO model) is already read from .acf or aircraft.cfg files as well as the model path. The latter one is not needed since the ICAO model is enough.
I'd rather scan through a path defined by the user or all files in the history.
Also do this on demand and in background since it would delay the startup.
Didn't some old release of LNM auto-load the profile or am I misremembering something? I think shortly after the introduction of this feature.
ICAO is bit of a weak identifier as, for example on the A320 and 747 families, it does not discriminate between engine types which all have different fuel consumption characteristics. "A320" is for both CFM and IAE engines, while "B742" is for RR, GE and PW engines. Hence the request to use a complete path.
In any case, good to know it's already on the list. Thanks.
Nope. LNM did never auto-load the profiles.
Thinking of this, it does not make much sense IMO since normally one creates a plan before sitting in the cockpit at the departure. There is no ICAO aircraft type transferred to LNM before.
Taking into account engine differences is not possible at all, as LNM cannot detect them in any simulator.
I think the better solution is to load it manually.
Thinking of this, it does not make much sense IMO since normally one creates a plan before sitting in the cockpit at the departure. There is no ICAO aircraft type transferred to LNM before.
Not necessarily. I mostly let the flight load at the departure airport and only then decide where to go.
Taking into account engine differences is not possible at all, as LNM cannot detect them in any simulator.
In X-Plane, you most definitely can by reading the path down to the ACF file.
Here's why: Unless the aircraft uses some plugin magic to alter engine parameters (thrust, RPMs, fuel flow, etc.) to cover different engine variants, the only other way is to use different ACF files (e.g. 747-400_PW.acf, 747-400_RR.acf, etc.) with specific engine parameters, but which are stored in the exact same folder because they use (almost) the exact same art assets.
(FSX behaving exactly the same, IIRC.)
The alternative of altering the ICAO code to some fantasy one to represent a certain engine variant in order to autoload a suitable performance file in LNM would mess up other simulator elements like ATC.
acf does not contain engine variants and there is no way I'll read the filesnames (which is unreliable anway) to get the variants. Not worth the effort and added complexity.
I'm using "XPLMGetNthAircraftModel" to get the path in a few projects of mine and it works absolutely reliably each and every time.
I already do the same since not all parameters are available as datarefs but I'm not going to scan the filename for engine types.
I already do the same since not all parameters are available as datarefs but I'm not going to scan the filename for engine types.
I think we have a grave misunderstanding here. "Engine variants" was just a use case to justify using the path to an ACF or aircraft.cfg file as a definite association for a performance profile.