Hi fellow wiki editors!

To help newly registered users get more familiar with the wiki (and maybe older users too) there is now a {{Welcome to the wiki}} template. Have a look at it and feel free to add it to new users discussion pages (and perhaps your own).

I have tried to keep the template short, but meaningful. /Johan G


From FlightGear wiki
Jump to: navigation, search
This article is a stub. You can help the wiki by expanding it.

Conditions (or SGConditions) in the SimGear library are a property-based representation of custom conditions based on comparing property values. They can be evaluated from both C++ and Nasal (see simgear/props/condition.hxx and $FG_ROOT/Nasal/props.nas). Comparison of string-typed properties involves lexicographic ordering, as specified by the C++ operators < and >.


Conditions are supported in

And several other places.

Sample Expressions

This is a sample expression for checking if the throttle on the first engine is above half:

    <value type="double">0.5</value>

Supported elements

Each comparison (like less-than or greater-than-equals) requires either two <property> elements (the first with index=0 and the second with index=1) or a <property> (considered first) and <value> (considered second); booleans compare each of their child conditions. A <condition> element itself functions as an <and> element; that is, it can have several children, all of which must be true to make the whole condition true.

<not> <!-- acts like logical inverse of <and>, i.e. accepts child conditions -->
<property> <!-- evaluates boolean value of specified property -->

Related content

Wiki articles

Readme file

Source code