Implementing VNAV support in FlightGear: Difference between revisions

Jump to navigation Jump to search
Line 296: Line 296:
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.  
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.  


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]. Scripting examples are to be found in the scripts/ directory.
Surprisingly, this rather simple mechanism is pretty powerful. 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]. Scripting examples are to be found in the scripts/ directory.


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()::Run by calling FGScript::RunScript), namely:
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()::Run by calling FGScript::RunScript), namely:

Navigation menu