Aircraft Center

From FlightGear wiki
Jump to navigation Jump to search
This article describes content/features that may not yet be available in the latest stable version of FlightGear (2020.3).
You may need to install some extra components, use the latest development (Git) version or even rebuild FlightGear from source, possibly from a custom topic branch using special build settings: .

This feature is scheduled for FlightGear 4.x. 50}% completed

If you'd like to learn more about getting your own ideas into FlightGear, check out Implementing new features for FlightGear.

This article is a stub. You can help the wiki by expanding it.
Canvas dialog showing the prototype for an Aircraft Center for directly downloading/installing/managing -and switching between- aircraft from within FlightGear, an upcoming experimental feature scheduled for FlightGear 3.2, currently being developed by TheTom and Zakalawe
Cquote1.png Recently I've also been mulling the possibility of selecting aircraft from an "in program" dialog similar to Fly II where you can climb up to 35,000 feet in a 747 and then switch to a C172 :-) Seriously, even if we did a full reset, it'd be nice to switch aircraft (3D models as well) and fdm's on the fly (pun not intended).
— David Megginson ( Fri, 08 Nov 2002 18:01:41 -0800). starting the XML GUI; early implementors needed.
Cquote2.png
Cquote1.png As we move forward with FlightGear development and future versions, we will be expanding the "in app" aircraft center. This dialog inside flightgear lets you select, download, and switch to any of the aircraft in the library.
— Curtis Olson (2015-02-17). Re: [Flightgear-devel] Citation II for base package?.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png the goal here is to almost get rid of a centralised aircraft repo anyway, and have a decentralised development system with the only central point being the aircraft package manager for end users. Then 99% of people never care where the aircraft is stored while it’s developed.
Cquote2.png
Cquote1.png For all other aircraft, the intention for both these nightly builds and official releases is to use the aircraft catalog + package system, which is based around HTTP rather than an SCM system. I’m working at the moment on integrating the client parts into the launcher GUI.
— James Turner (2015-03-11). Re: [Flightgear-devel] FGDATA and Jenkins.
(powered by Instant-Cquotes)
Cquote2.png

Background

Note  Also see The FlightGear Front-End Situation
Cquote1.png The Canvas-based Aircraft Center dialog was originally prototyped by TheTom in response to Zakalawe announcing on the devel list that he was going to come up with a front-end for his still ongoing package manager subsystem, by creating a hard-coded PUI dialog.

Since then, many things have changed - Zakalawe is now working on an integrated Qt5 launcher, which is intended to remain an optional feature, but which is also intended to provide an in-sim replacement for the built-in PUI GUI. Also, TheTom is not currently as actively involved as Zakalawe, so that the Aircaft Center has not seen much attention recently - and Zakalawe stated on the devel list that he is now considering the "Aircraft Center" an "experimental feature" that is likely to be deprecated due to this ongoing Qt5 launcher/GUI efforts.

The Aircraft Center is primarily written in Nasal and Canvas, as its back-end it is using SimGear http binding for downloading aircraft, and a few fgcommands for dealing with the package manager subsystem.
— Hooray (Feb 10th, 2016). Re: Aircraft Center.
(powered by Instant-Cquotes)
Cquote2.png

Internally, the launcher is implemented in the form of a Nasal script that resides in $FG_ROOT/Nasal/canvas/gui/dialogs/AircraftCenter.nas using the Canvas GUI APIs and a handful of widgets. All the package manager functionality lives in SimGear and is triggered in the form of so called fgcommands. Thus, the list itself will be populated based on XML files that are automatically downloaded. If there are errors related to fetching/using those files, they shoudl show up in $FG_HOME/fgfs.log (look for Catalog.cxx).

The fetched files are to be found in $FG_HOME/Aircraft/org.flightgear.*

Cquote1.png The "built-in" GUI/launcher is one of the longest-standing feature requests - but it's not just about the GUI (which is rather straightforward in comparison), but about the simulator never having been developed with this requirement, i.e. run-time reinitialization, in mind - thus, things like "fgrun" (and a plethora of other external launchers) were developed, which acted as a front-end on top of FG, so that FG itself wouldn't need to be changed - i.e. kind of a "remote control" using command line arguments. So it's there for a reason - fgrun uses the FLTK GUI library, which while relatively simple, is much more powerful than our legacy GUI engine, PUI.


Still, people have been asking for this for years, and it's thanks to pretty much a single person, Zakalawe, that switching aircraft is going to become possible pretty soon - he handled all the ugly work of cleaning up the simulator internals to make this happen - it's not exactly glamorous work, you gotta touch a ton of places, and you inevitably introduce a ton of regressions along the way.


— Hooray (Thu Jun 26). Re: About FlightGear being user-friendly or not.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png And yes, even the legacy FG GUI is entirely based on XML and configurable through just editiing XML files - but the collection of "widgets" (GUI controls like buttons, checkboxes, labels etc) is extremely small and very inflexible.


This is something that is currently being addressed by TheTom and Zakalawe, who've both been working on a new Canvas GUI, and a new Canvas GUI dialog called "Aircraft Center", which -while still experimental- is intended to eventually allow end-users to easily download/install aircraft right within the simulator, and also switch between aircraft at run-time without having to exit/restart the simulator.

Thus, adopting Canvas is going to address a number of long-standing issues, but it's obviously a process that only just got started, and it will not happen overnight - 2-3 release cycles are not far-fetched, that's how long the whole migration could very well take, unless there are more people interested in helping.


— Hooray (Thu Jun 26). Re: About FlightGear being user-friendly or not.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png Note that the upcoming FlightGear release is likely to contain an integrated, hard-coded, launcher based on Qt5 to work around this non-working launcher on MacOS: flightgear/flightgear/f3810707d53f3c04769bbc214036ee9156bc3a7c commit view


Unfortunately, this is -once again- overlapping with other efforts (think Canvas GUI/Aircraft Center), and it's going to be Mac specific, too. If it wasn't for the recent mongoose GUI/Canvas GUI efforts, and had this been done/accepted a few years ago, many recent developments would be made obsolete by allowing Qt5 - but back then, Qt5 was a "no-go"...


— Hooray (Sun Jan 04). Re: FG cannot be opened on new iMac.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png The Aircraft Center is implemented entirely in scripting space - the package manager is exposed to Nasal via extension functions - it's probably (hopefully) just a matter of adapting 3-5 lines of code to try the other URLs if the first URL fails - for which you'll need to check the error code/state (property tree). please see $FG_ROOT/Nasal/canvas/gui/dialogs/AircraftCenter.nas
— Hooray (Sat Dec 13). Re: Aircraft center: .
(powered by Instant-Cquotes)
Cquote2.png

Global Canvas GUI (WIP)

Cquote1.png we could certainly prepare the main binary to become increasingly configurable, so that it can be used for such purposes - it would even be possible to use built-in FG dialogs in an external window, running in a standalone process - e.g. for an instructor console, but also for a Canvas-driven TerraGear GUI.
— Hooray (Mon Jul 07). Re: How can I retire from the forum?.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png (This subject has been discussed at FSWeekend)


I'm slowly working on a new "global" GUI created in Canvas. It's still in heavy development and I'm not sure I will have time to finish it for FG 3.4, but if people are helping I think we can get it.

Canvas GUI experiments by F-JJTH (11/2014) [1]
Canvas GUI experiments by F-JJTH (11/2014) [2]
Canvas GUI experiments by F-JJTH (11/2014) [3]
Canvas GUI experiments by F-JJTH (11/2014) [4]

— Clement de l'Hamaide (2014-11-18). Re: [Flightgear-devel] Features for 3.4 please.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png The goal is to replace our dozens of GUI dialog by only 1 dialog with nice architecture/organization.

For example, the "General" page is remplacing "File > Sound configuration", "View > Cockpit View Options", "View > Adjust HUD Properties" and "View > View Options". Some Canvas tools are missing (slider, radio button, styling helper like "font-bold", "underline"...) but I know Canvas is under development.


— Clement de l'Hamaide (2014-11-18). Re: [Flightgear-devel] Features for 3.4 please.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png The "Home" page is designed to be the "select airport", "select aircraft", "help"... finally this dialog could become the "built-in launcher".For

example we can imagine to have an option like --enable-launcher which start FG in a way that he doesn't load any aircraft or position but instead we hold the splashscreen and we show this Canvas dialog, then the user can select his airport and his aircraft. Finally a simple 'reset' with all settings required by the user is triggered that way the user end up in his aircraft at his airport. All of this require to be discussed and is likely at the "proof-of-concept" state.


— Clement de l'Hamaide (2014-11-18). Re: [Flightgear-devel] Features for 3.4 please.
(powered by Instant-Cquotes)
Cquote2.png


Cquote1.png Looks … okay, just be aware how it will interact with the menubar. (Especially on Mac).


I actually considered the same, unifying many settings dialogs into one Preferences dialog; not combing ‘everything’ but all the Rendering / View / Multiplayer / Scenery Download / Instrument settings into one Preferences dialog with tabs.


— James Turner (2014-11-19). Re: [Flightgear-devel] Features for 3.4 please.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png I would still think that a series of top level dialogs might make more sense, based on frequency of use:
  • an aircraft selection / startup location / scenario selection (aka ‘the launcher’) ; something that is shown by default on launch and used every day
  • a preferences + settings + joystick config one which hopefully is not used every day (once things are setup)
  • a help + about dialog which again hopefully is not used every day, maybe designed to remain open on screen

— James Turner (2014-11-19). Re: [Flightgear-devel] Features for 3.4 please.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png I’m not sure how the equipment dialogs (which are often customised per-aircraft - eg radios or autopilot), including the GPS and route-manager, fit into this either.

Of course, it’s great if Canvas is as the point that we can actually consider such things, and hopefully the actual arrangement of screens + widgets is easy to evaluate and adjust.


— James Turner (2014-11-19). Re: [Flightgear-devel] Features for 3.4 please.
(powered by Instant-Cquotes)
Cquote2.png

Feature Requests

Supporting separate/external Windows for the GUI

Cquote1.png This looks promising in a technical/coding perspective of having this and that common GUI feature available also for flightgear. But for me personally one of the big problems of the FlightGear GUI is that it is "inside" the only and one main window. There is no possibility to have a separate window to not cover the main content, the scenery and the cockpit? This would make the GUI much more practical. I would really like to run flightgear with one window "view" and other windows for the program (options). This will improve the usability of all the menus, dialogs etc. a lot in my opinion.
Cquote2.png

Status

Also see: http://forum.flightgear.org/viewtopic.php?f=25&t=28877&#p277382

Cquote1.png I've pushed now a first version of an aircraft install/removal dialog.

Was a lot more effort than expected, but now there are a lot of
improvements available useful for every type of dialog.


— Thomas Geymayer (2014-06-10). Re: [Flightgear-devel] select/download aircraft.
Cquote2.png
Cquote1.png The dialog is available in the menu (File > Aircraft Center) and shows

a list of the 100 first aircrafts available to install/remove. I've
chosen to limit the number, because with showing all aircrafts at once
I got a delay of a few seconds on opening the dialog. I will
investigate into this more later. You can use the according buttons to
install/remove aircrafts - which I have already done successfully.
Currently the dialog does not indicate any progress and needs to be
reopened to update the buttons.

As the feature freeze is already approaching, I won't be able to add
too much features for this release. So I think there won't be any
keyboard input/searching for this release. I want to support different
tabs to show a list of eg. just the installed aircrafts and do a
simple cache for all the downloaded images, to have them visible
faster on opening the dialog.


— Thomas Geymayer (2014-06-10). Re: [Flightgear-devel] select/download aircraft.
Cquote2.png
Cquote1.png Thomas Geymayer and I are working on it, I am not sure where’s he go to with the UI, the backend pieces are mostly there but will need some intensive testing. There is a #define flag you can toggle (in HTTPClient.cxx) to enable the code including the Nasal API; it will download / refresh a catalog, which is generated by the scripts I committed to fgmeta a week ago. Then you can access the package system from pkg.root in the Nasal console, using the API defined at the bottom of HTTPClient.cxx.


If you are crazy enough to enable this code, and run it, be aware it downloads zips, unpacks them, makes calls to unlink files, renames directories, and so on. I would recommend some caution, and especially, don’t run it as root - while developing it I had it extract a few zips to ‘/‘ or worse due to screwed up path logic.

Equally, I would welcome a code review of the code in simgear/package/Install.cxx to check any security issues or dangerous behaviour. The code /tries/ to be ‘safe’ - extract zip to a temporary folder, and uses rename/unlink to atomically update if the zip extraction succeeds. But it’s only had one pair of eyes on it so far.


— James Turner (2014-06-10). Re: [Flightgear-devel] select/download aircraft.
Cquote2.png
Cquote1.png My next objective will be actually switching to an aircraft, and setting up the correct paths so that dependencies work; this is more or less orthogonal, I will make a new command to select an aircraft (and reset the sim) based on an aircraft ID or fully-qualified ID. (Again to allow catalogs with ID collisions, such as org.flightgear.default.747-400 and nl.gijs-hangar.beta.747-400)


If anyone wishes to start adding tags or more meta-data to aircraft in FGdata, please let me know, especially to keep the tag space coherent and hence useful for searching.


— James Turner (2014-06-10). Re: [Flightgear-devel] select/download aircraft.
Cquote2.png
Cquote1.png the whole thing is still pretty experimental, it’s probably not at the ‘this text should be a little to the left’ point. We’re more at the ‘it didn’t erase your C drive? Great!’ stage….
— James Turner (2014-06-13). Re: [Flightgear-devel] Notes on Aircraft Center....
Cquote2.png
Cquote1.png The layout and widget systems is now maturing, so I think after 3.2 I

can start with porting PUI. Just one major component is missing, namely
keyboard input and the according input focus.

I guess this will take one or two more releases.


— Thomas Geymayer (2014-06-13). Re: [Flightgear-devel] Notes on Aircraft Center....
Cquote2.png

Tagging

Cquote1.png Related to this, does anyone know how standardised the <status> values are? If there is a defined list of values I will add query support and expose them as an enum to Nasal.


And, if anyone who has a custom hangar would like to start maintaining a catalog, please let me know - there is no UI in FG to add additional catalogs yet but it would help with testing. If you already have a web server with zip files of aircraft, you only need to serve one extra XML file to run a ‘package-ified’ hangar. The catalog XML can be hand written or generated using any technology you like - there’s Python scripts in fgmeta, but PHP / shell-script / etc will all work too.


— James Turner (2014-06-11). Re: [Flightgear-devel] select/download aircraft.
Cquote2.png
Cquote1.png have updated my script with to restrict tags to the set I original wrote on the wiki some time ago:


http://wiki.flightgear.org/Catalog_metadata

I am going to do make a drive-by assault on fgdata/Aircraft adding tags - hopefully no maintainer feels this is problematic since it’s purely adding metadata to make the UI more functional. I am sure I will get some entries ‘wrong’ and the tags themselves are still up for discussion, but we have a version control system, and most of the tags are very non-controversial.

The ‘nicer’ Nasal tags syntax is added now too. (Part of the motivation for adding tags to fgdata is to test it better(


— James Turner (2014-06-12). Re: [Flightgear-devel] select/download aircraft.
Cquote2.png

Variants

Cquote1.png I don’t think there’s any pathological examples with more than eight -set.xml. Designating the ‘main’ -set.xml is still an issue.


What I will do is include the set-file and description in a ‘variants’ list, with the first entry being the default. So in the catalog XML, something like:

<package>
<variant>
<id>747-400-FO</id>
<name>747-400 First-officer mode</name>
</variant>
...
</package>

On Package I’ll expose this as string_list of variants() with a nameForVariant(std::string variant) helper. For Nasal I can return a dictionary.

Variant IDs will need to be unique within the Catalog, and I’ll update the search logic to accept /any/ variant ID as matching the package - this will make the aircraft-startup part of everything work, and keeps thing close to how it behaves with unpackaged aircraft.


— James Turner (2014-06-13). Re: [Flightgear-devel] select/download aircraft.
Cquote2.png

Aircraft developers can make use of a new tag in the Aircraft-set.xml file. Added to the <sim>, the <variant-of> tag states to the launcher the aircraft type that your aircraft is a variant of. For example, the BAe Sea Harrier FA2 is a variant of the BAe Sea Harrier, and the Cessna 172P - Canvas Demo is a variant of the C172P.

Note  At the moment, only the Mac Qt launcher (which comes with FlightGear for Mac v3.4+) will read this tag.

Syntax:

<sim>
    ...
    <variant-of>[aircraft]</variant-of>
    ...
</sim>

Example from $FG_AIRCRAFT/Aircraft/777/777-200ER-set.xml (see gitorious/fg/fgdata/1017a32b1b078f46959b3b6e7510a7376458b02b):

<variant-of>777-200</variant-of>

Development

Cquote1.png I thought about adding a cache add Canvas::Image or rather at the

HTTPRequest level to cache all HTTP requests/files which have not set
a no-cache header.


— Thomas Geymayer (2014-06-10). Re: [Flightgear-devel] select/download aircraft.
Cquote2.png
Cquote1.png for a first step I want to limit it only to the

HTTPMemoryRequest which is mainly used for downloading canvas images. So
it should not affect too many parts.
Someday we should probably add a cache limit - but not now ;-) I will
also need this for displaying tilemaps.


— Thomas Geymayer (2014-06-10). Re: [Flightgear-devel] select/download aircraft.
Cquote2.png
Cquote1.png A semi-related small thing: I'd like to have saved-between-sessions

"default aircraft/starting airport" properties (/sim/default-aircraft,
/sim/default-airport ?), set by a "make this default" check box in Go To
Airport and the new aircraft dialog, so those who prefer something other
than c172p@... don't have to select it on every startup. I should be
able to implement this, but comments would be appreciated.


— Rebecca N. Palmer (2014-05-30). Re: [Flightgear-devel] select/download aircraft.
Cquote2.png
Cquote1.png Currently box layouts are available. Once they fully

work I'll start thinking of other layouts and widgets.


— Thomas Geymayer (2014-06-13). Re: [Flightgear-devel] Notes on Aircraft Center....
Cquote2.png
Cquote1.png I want

to implement a cache to speed it up after the first time, but not for
3.2. If an image fails to load there should be a message in the terminal.
"No thumbnail available" is shown if there is no image specified in the
catalog.


— Thomas Geymayer (2014-06-13). Re: [Flightgear-devel] Notes on Aircraft Center....
Cquote2.png
Cquote1.png what I’d want is tabs at the top for ‘installed aircraft’, ‘available updates’ and so on. But again the question is really what UI we can build in the time available.
— James Turner (2014-06-13). Re: [Flightgear-devel] Notes on Aircraft Center....
Cquote2.png

Known Issues

Cquote1.png The default aircraft catalog download path is http://fgfs.goneabitbursar.com/pkg/<version>/default-catalog.xml, which does not exist for 3.4.0 or 3.5.0, giving a "catalog download failure:" error and an empty Aircraft Center.
— Rebecca N. Palmer (2015-03-31). [Flightgear-devel] Non-existent default catalog.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png Also, the address includes the micro version: is that intentional or not? catalog download failure:http://fgfs.goneabitbursar.com/pkg/3.4.1/default-catalog.xml
— Rebecca N. Palmer (2015-03-31). Re: [Flightgear-devel] Non-existent default catalog.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png It would be good to resolve the missing aircraft center database.
— Curtis Olson (2015-03-31). Re: [Flightgear-devel] fgdata 3.4.1.
(powered by Instant-Cquotes)
Cquote2.png
Cquote1.png Prior to a reset, if you edit /sim/aircraft, it works as you would expect. However there are some quirks related to aircraft-specific menu items / dialogs, at least on Mac (the custom menu for previous aircraft is not removed).


There may be other bugs, since this feature is not used by anyone yet.


— James Turner (2014-05-30). Re: [Flightgear-devel] select/download aircraft.
Cquote2.png
Cquote1.png If you've created a grid control for Canvas, it would be nice to see the

FDM, Systems, Cockpit and Model ratings broken out into individual columns
so you could sort by them. :)

If you get to the point where you can change aircraft from this dialog,
you might want to include a checkbox that will limit the list to installed
aircraft.

If the Aircraft Center dialog is open, other dialogs don't appear to work
- I tried exiting via File->Exit and none of the items were selectable.
Hitting ESC brings up the Exit dialog, but the buttons were not clickable.

Dismissing the Aircraft Center dialog allowed the other dialogs to operate
properly.


Cquote2.png
Cquote1.png The Canvas fonts are blurry compared to the in.sim Menu bar Fonts -Richi Muchacho


Cquote2.png

See also