Talk:FGPythonSys
Jump to navigation
Jump to search
FGNasalSys vs FGPythonSys - common baseclass
These are APIs that are sufficiently generic in nature to be moved to a common baseclass that can be shared by FGPythonSys/FGNasalSys:
- printlog(), i.e. wrapping SG_LOG() [1]
- loadModule()
- loadPropertyScripts()
- addcommand()/removecomand()
- runfgcommand() (with locking, e.g. using SGMutex)
class FGScriptingSystem : public SGSubsystem, public SGPropertyChangeListener {
public:
FGScriptingSystem();
virtual ~FGScriptingSystem();
const char* readfile(const char* file, int* lenOut);
// Subsystem functions.
virtual void init();
virtual void reinit();
virtual void bind();
virtual void unbind();
virtual void update(double dt);
protected:
// Load and execute a script.
bool loadModule(SGPath file, const char *module) = 0;
virtual void loadPropertyScripts() = 0;
virtual void loadPropertyScripts(SGPropertyNode *n) = 0;
private:
};