MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
module-flightgear.h
Go to the documentation of this file.
1 /*header file for module-FlightGear-Conti_GSOC.cc*/
2 
4  virtual bool IsWord(const std::string& s) const;
5 };
6 
8  virtual bool IsWord(const std::string& s) const;
9 };
12 
13 struct FieldInfo{
14  const std::type_info &type; /*data type of the field (double, float, etc)*/
15  int typeSize;
16  int position; /*position inside of the data structure*/
17  size_t offset; /*byte offset from the beginning of the data structure*/
18 };
19 typedef struct FieldInfo FieldInfo;
20 
21 typedef std::map<std::string, FieldInfo> FieldsDescriptionFG; /*key: field name, mapped type: FieldInfo*/
22 
25 extern int FGNetFDMCurVersion;
26 extern int FGNetCtrlsCurVersion;
27 
28 extern "C" int module_init(const char *module_name, void *pdm, void *php);
29 void buildFieldsDescriptionFG(void);
30 void readFGStructuresFromFile(const char *filePath, std::string currentVersionLabel, FieldsDescriptionFG &fieldsDescriptionFG, int &currentVersion);
31 void printOptionsOnTextFile(const char * fileName, FieldsDescriptionFG &fieldsDescriptionFG);
32 void buildFGBufCast(std::vector<BufCast *>& data, FieldsDescriptionFG &fieldsDescriptionFGInUse);
33 BufCast *buildOneFGBufCast(size_t& offset, TypeMap_t& swapmap, const std::type_info &fieldType);
34 
35 /*---------------------------------------------------------------------------------------------------------------------------------------------*/
36 /*specific definitions for Flight Gear stream output element-----------------------------------------------------------------------------------*/
37 /*---------------------------------------------------------------------------------------------------------------------------------------------*/
39 
40 typedef std::map<std::string, ScalarValue *> FlightGearUserChannels;
41 
42 /*content-type for sending data to Flight Gear*/
44  virtual StreamContent* Read(DataManager* pDM, MBDynParser& HP);
45 
47  FlightGearUserChannels &flightGearUserChannels, FieldsDescriptionFG *dataStructureInUse);
48  void setDefaultValues(std::vector<ScalarValue *> &allValues, std::vector<bool> &assignedByUser, FieldsDescriptionFG &fieldsDescriptionFGInUse);
49  bool fieldAlreadyUsed(std::string fieldDescription, FlightGearUserChannels &flightGearUserChannels);
50 
52 };
53 
54 /*---------------------------------------------------------------------------------------------------------------------------------------------*/
55 /*specific definitions for Flight Gear file drive and file drive caller------------------------------------------------------------------------*/
56 /*---------------------------------------------------------------------------------------------------------------------------------------------*/
57 
58 /*FileDrive type for getting data from Flight Gear*/
60  virtual StreamDrive::Modifier * Read(std::vector<doublereal> &v0, MBDynParser& HP, int &idrives);
61 
63 };
64 
65 /*FileDriveCaller type for getting data from Flight Gear*/
67  virtual integer Read(const DataManager* pDM, MBDynParser& HP, FileDrive* pDrv);
68 };
69 
70 /*--------------modifiers for automatically gettinh which FG data structure is read by the specified FileDrive--------------------*/
72  public:
73  FGNetFDMStreamDriveCopyCast(size_t size, const std::vector<BufCast *>& data);
75 };
76 
78  public:
79  FGNetCtrlsStreamDriveCopyCast(size_t size, const std::vector<BufCast *>& data);
81 };
82 /*--------------------------------------------------------------------------------------------------------------------------------*/
HighParser::WordSet * sendToFGWordSetInUse
const std::type_info & type
BufCast * buildOneFGBufCast(size_t &offset, TypeMap_t &swapmap, const std::type_info &fieldType)
FGNetCtrlsStreamDriveCopyCast(size_t size, const std::vector< BufCast * > &data)
virtual bool IsWord(const std::string &s) const
void buildFGBufCast(std::vector< BufCast * > &data, FieldsDescriptionFG &fieldsDescriptionFGInUse)
void readFGStructuresFromFile(const char *filePath, std::string currentVersionLabel, FieldsDescriptionFG &fieldsDescriptionFG, int &currentVersion)
void ReadFlightGearScalarValues(DataManager *pDM, MBDynParser &HP, FlightGearUserChannels &flightGearUserChannels, FieldsDescriptionFG *dataStructureInUse)
std::map< std::string, ScalarValue * > FlightGearUserChannels
FieldsDescriptionFG fieldsDescriptionFGNetFDM
StreamDrive::Modifier * buildFGStreamDriveModifier(FieldsDescriptionFG *fieldsDescriptionFGInUse)
void buildFieldsDescriptionFG(void)
FieldsDescriptionFG fieldsDescriptionFGNetCtrls
bool fieldAlreadyUsed(std::string fieldDescription, FlightGearUserChannels &flightGearUserChannels)
int module_init(const char *module_name, void *pdm, void *php)
This function registers our user defined element for the math parser.
StreamContent::Modifier * buildFGStreamContentModifier(FieldsDescriptionFG &fieldsDescriptionFGInUse)
std::map< std::string, bool > TypeMap_t
Definition: bufmod.h:37
void setDefaultValues(std::vector< ScalarValue * > &allValues, std::vector< bool > &assignedByUser, FieldsDescriptionFG &fieldsDescriptionFGInUse)
virtual StreamContent * Read(DataManager *pDM, MBDynParser &HP)
virtual integer Read(const DataManager *pDM, MBDynParser &HP, FileDrive *pDrv)
virtual bool IsWord(const std::string &s) const
FGNetFDMWordSet fGNetFDMWordSet
int FGNetCtrlsCurVersion
virtual StreamDrive::Modifier * Read(std::vector< doublereal > &v0, MBDynParser &HP, int &idrives)
static const std::vector< doublereal > v0
Definition: fixedstep.cc:45
int FGNetFDMCurVersion
long int integer
Definition: colamd.c:51
FGNetFDMStreamDriveCopyCast(size_t size, const std::vector< BufCast * > &data)
std::map< std::string, FieldInfo > FieldsDescriptionFG
FGNetCtrlsWordSet fGNetCtrlsWordSet
void printOptionsOnTextFile(const char *fileName, FieldsDescriptionFG &fieldsDescriptionFG)
Definition: bufmod.h:42