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);
22 void getExternalInput(float dt=1e6);
24 Airplane* getAirplane();
26 // XML parsing callback from XMLVisitor
27 virtual void startElement(const char* name, const XMLAttributes &atts);
30 struct AxisRec { char* name; int handle; };
31 struct EngRec { char* prefix; Thruster* eng; };
32 struct WeightRec { char* prop; float size; int handle; };
33 struct PropOut { SGPropertyNode* prop; int handle, type; bool left;
36 void setOutputProperties();
38 Wing* parseWing(XMLAttributes* a, const char* name);
39 int parseAxis(const char* name);
40 int parseOutput(const char* name);
41 void parseWeight(XMLAttributes* a);
42 void parsePropeller(XMLAttributes* a);
43 bool eq(const char* a, const char* b);
44 char* dup(const char* s);
45 int attri(XMLAttributes* atts, char* attr);
46 int attri(XMLAttributes* atts, char* attr, int def);
47 float attrf(XMLAttributes* atts, char* attr);
48 float attrf(XMLAttributes* atts, char* attr, float def);
50 // The core Airplane object we manage.
53 // The list of "axes" that we expect to find as input. These are
54 // typically property names.
60 // Engine types. Contains an EngRec structure.
63 // Output properties for the ControlMap
66 // Parsing temporaries