FlightGear version check

From FlightGear wiki
Revision as of 16:32, 17 November 2015 by Bugman (talk | contribs) (→‎For aircraft developers: Small fix for the {{Non-stable}} template.)
Jump to navigation Jump to search
This article is a stub. You can help the wiki by expanding it.


Caution  When installing/using aircraft the FlightGear version and the aircraft version must match. Otherwise strange bugs should be expected and the version-mismatch combination will not be supported by the FlightGear community.
pui/xml dialog showing a version conflict between fgfs binary and aircraft version

If in doubt, people should check the About dialog or even /sim/version in the property tree using the proeperty brwoser.


For aircraft developers

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 (unknown). 10}% completed

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

  <minimum-flightgear-version>4.0.0</minimum-flightgear-version>

Minimum FlightGear version required for this aircraft [1], note that this is a "soft" requirement - i.e. it will not terminate fg or trigger an error, but only show a warning in the console/fg window using a Nasal script that checks if the property is set. This is mainly intended to make compatibility issues more obvious, i.e. end-users downloading new aircraft and wanting to use them in conjunction with an old version of FlightGear, which is causing quite a bit of workload on the support forum. We are hoping to also display this info in the About dialog

Fgdata

property browser showing /sim/version info


Note  This is currently just proof-of-concept code which will need to be refined/reviewed and committed to fgdata.

$FG_ROOT/Nasal/version.nas (this ensures that the check will be executed for each loaded aircraft, without having to touch any -set.xml files, and it will also work with Reset & re-init).

# anonymous function that will be called directly
(func() {
##
# current aircraft
var ac = getprop("/sim/aircraft");
var url = "http://wiki.flightgear.org/FlightGear_Version_Check";
var fgversion = getprop("/sim/version/flightgear");
logprint(3,"FlightGear v."~ fgversion);

var acversion = getprop("/sim/minimum-flightgear-version");

if (acversion == nil) {
logprint(4,ac~"-set.xml file missing version info, see: "~url);
return; # version not specified 
}
logprint(3,"Aircraft requires FlightGear v."~acversion);

# parse the version number into major/minor and patch level
# http://plausible.org/nasal/lib.html
var (major, minor, patch) = split(".", acversion);
}
)();
version mismatch dialog created/processed by Canvas via pui2canvas