20,741
edits
m (David Megginson: http://www.mail-archive.com/flightgear-devel@flightgear.org/msg03740.html) |
m (David Megginson: http://www.mail-archive.com/flightgear-devel@flightgear.org/msg03740.html) |
||
Line 14: | Line 14: | ||
The config files serve many different purposes; using the XML-based property-list format for all of them helps a lot, since it allows some common structure and reusable code among all the formats. Imagine if we had one file format for preferences, a different one for panels (say, with fixed-length fields), a different one for saving a flight (perhaps a binary format), another one for sound configuration (perhaps an INI file), a different one for top-level aircraft configuration (perhaps CSV), yet another one for configuring 3D models (perhaps embedded data strings in the 3D files themselves), etc. etc. | The config files serve many different purposes; using the XML-based property-list format for all of them helps a lot, since it allows some common structure and reusable code among all the formats. Imagine if we had one file format for preferences, a different one for panels (say, with fixed-length fields), a different one for saving a flight (perhaps a binary format), another one for sound configuration (perhaps an INI file), a different one for top-level aircraft configuration (perhaps CSV), yet another one for configuring 3D models (perhaps embedded data strings in the 3D files themselves), etc. etc. | ||
We have config files for totally different purposes, and the fact that they all use XML is simply a convenience for programmers and customizers. | |||
Here are some of the conventions that we've come up with so far, partly ad-hoc (all paths relative to $FG_ROOT): | |||
* preferences.xml - the top-level default preferences | |||
* joysticks.xml - default joystick bindings, included by preferences.xml | |||
* keyboard.xml - default keyboard bindings, included by preferences.xml | |||
* Aircraft/*-set.xml - aircraft-specific settings, overriding the defaults in preferences.xml (and joystick/keyboard.xml) | |||
Basically, these are the main files in the base package that affect FlightGear's main property tree. Other files use the property-file format for convenience to populate various data structures, but they do not touch the main tree and are not accessible through the property browser or through the command-line --prop: option; it's just a coincidence that they also use the property-list format: | |||
* materials.xml - define the materials (textures, colour, lighting) for use in the scenery | |||
* HUDS/**/*.xml - configuration files to define the various heads-up displays | |||
* Aircraft/*/*-sound.xml - configuration files to define sounds played for various aircraft | |||
* Aircraft/*/Panels/*-panel.xml - configuration files to define 2D panels for various aircraft. | |||
* Aircraft/*/Instruments/*.xml - configuration files for individual instruments included by the 2D panels. | |||
* Aircraft/Instruments/*.xml - ditto | |||
We also use some XML-based formats that do not (yet?) follow the property-list conventions, including the following: | |||
* Aircraft/*/*.xml - JSBSim aero model config files | |||
* Aircraft/Aircraft-yasim/*.xml - YASim aero model config files | |||
* Engine/*.xml - JSBSim engine and thruster config files | |||
YASim and JSBSim each uses its own XML format, which is different from the XML format used by the rest of FlightGear. For YASim, see $FG_ROOT/Aircraft-yasim/README.yasim in the base package; for JSBSim, see the documentation at http://jsbsim.sourceforge.net/. UIUC uses a non-XML config-file format. | |||
To work with PropertyList-XML files, you can use various means, such as: | To work with PropertyList-XML files, you can use various means, such as: |