4 #include <simgear/xml/easyxml.hxx>
6 #include "Airplane.hpp"
13 // This class forms the "glue" to the FlightGear codebase. It handles
14 // parsing of XML airplane files, interfacing to the properties
15 // system, and providing data for the use of the FGInterface object.
16 class FGFDM : public XMLVisitor {
21 void iterate(float dt);
23 Airplane* getAirplane();
25 // XML parsing callback from XMLVisitor
26 virtual void startElement(const char* name, const XMLAttributes &atts);
29 struct AxisRec { char* name; int handle; };
30 struct EngRec { char* prefix; void* eng; };
31 struct WeightRec { char* prop; float size; int handle; };
33 void getExternalInput(float dt);
34 void setOutputProperties();
36 Wing* parseWing(XMLAttributes* a, const char* name);
37 int parseAxis(const char* name);
38 int parseOutput(const char* name);
39 void parseWeight(XMLAttributes* a);
40 void parsePropeller(XMLAttributes* a);
41 bool eq(const char* a, const char* b);
42 char* dup(const char* s);
43 int attri(XMLAttributes* atts, char* attr);
44 int attri(XMLAttributes* atts, char* attr, int def);
45 float attrf(XMLAttributes* atts, char* attr);
46 float attrf(XMLAttributes* atts, char* attr, float def);
48 // The core Airplane object we manage.
51 // The list of "axes" that we expect to find as input. These are
52 // typically property names.
58 // Engine types. Contains an EngRec structure.
62 // Parsing temporaries