Implementing VNAV support in FlightGear: Difference between revisions

Jump to navigation Jump to search
Line 260: Line 260:


=== FGScript ===
=== FGScript ===
JSBSim is entirely built around the [[Property Tree]] concept (actually an outdated version of it - because JSBSim doesn't depend on SimGear, the old property tree code is still used in the source tree), scripting in JSBSim is also implemented on top of the property tree, it isn't really "scripting" per se, it's properties + XML, and some JSBSim specific building blocks to support events, conditions, notifications and some custom expressions. Surprisingly, this rather simple mechanism is pretty powerful, and fully deterministic.
JSBSim is entirely built around the [[Property Tree]] concept (actually an outdated version of it - because JSBSim doesn't depend on SimGear, the old property tree code is still used in the source tree), scripting in JSBSim is also implemented on top of the property tree, it isn't really "scripting" per se, it's properties + XML, and some JSBSim specific building blocks to support events, conditions, notifications and some custom expressions like JSBSim functions.  
To learn more about FGScript itself, you will want to check out the [http://www.holycows.net/JSBSim_Script_Tutorial.pdf JSBSim Scripting Tutorial].


The scripting engine in JSBSim is to be found in src/input_output/FGScript.cpp - scripts are basically just XML files that are evaluated once during initialization, to  set up several data structures, namely:
Surprisingly, this rather simple mechanism is pretty powerful, and fully deterministic. To learn more about JSBSim's FGScript itself, you will want to check out the [http://www.holycows.net/JSBSim_Script_Tutorial.pdf JSBSim Scripting Tutorial].
 
The scripting engine in JSBSim is to be found in src/input_output/FGScript.cpp - scripts are basically just XML files that are evaluated once during initialization, to  set up several data structures (that are later on evaluated in the FGFDMexec() main loop by calling FGScript::RunScript), namely:


* initialization stuff (aircraft, initialization file (position, altitude, etc)
* initialization stuff (aircraft, initialization file (position, altitude, etc)

Navigation menu