MBDyn-1.7.3
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups
FlightGearFileDriveCallerTypeReader Struct Reference

#include <module-flightgear.h>

Inheritance diagram for FlightGearFileDriveCallerTypeReader:
Collaboration diagram for FlightGearFileDriveCallerTypeReader:

Public Member Functions

virtual integer Read (const DataManager *pDM, MBDynParser &HP, FileDrive *pDrv)
 
- Public Member Functions inherited from FileDriveCallerTypeReader
virtual ~FileDriveCallerTypeReader (void)
 

Detailed Description

Definition at line 66 of file module-flightgear.h.

Member Function Documentation

integer FlightGearFileDriveCallerTypeReader::Read ( const DataManager pDM,
MBDynParser HP,
FileDrive pDrv 
)
virtual

Implements FileDriveCallerTypeReader.

Definition at line 104 of file recFromFlightgear.cc.

References fGNetCtrlsWordSet, fGNetFDMWordSet, fieldsDescriptionFGNetCtrls, fieldsDescriptionFGNetFDM, IncludeParser::GetLineData(), HighParser::IsWord(), MBDYN_EXCEPT_ARGS, and StreamDrive::pGetModifier().

104  {
105  FieldsDescriptionFG *fieldsDescriptionFGInUse;
106  HighParser::WordSet *FGWordSetInUse;
107  std::string FGStructureName;
108  const char *s;
109 
110  const StreamDrive *pDrv_StreamDrive = dynamic_cast<StreamDrive*>(pDrv);
111  const StreamDrive::Modifier *pMod = pDrv_StreamDrive->pGetModifier();
112 
113  if(pMod != 0 && dynamic_cast<const FGNetFDMStreamDriveCopyCast*>(pMod) != 0){
114  fieldsDescriptionFGInUse = &fieldsDescriptionFGNetFDM;
115  FGWordSetInUse = &fGNetFDMWordSet;
116  FGStructureName = "NetFDM";
117  }else if(pMod != 0 && dynamic_cast<const FGNetCtrlsStreamDriveCopyCast*>(pMod) != 0){
118  fieldsDescriptionFGInUse = &fieldsDescriptionFGNetCtrls;
119  FGWordSetInUse = &fGNetCtrlsWordSet;
120  FGStructureName = "NetCtrls";
121  }else{
122  silent_cerr("error: specified FileDrive does not receive Flight Gear data structure. Please check it out. "
123  "error at line " << HP.GetLineData() << std::endl);
125  }
126 
127  if((s = HP.IsWord(*FGWordSetInUse)) != NULL){
128  FieldsDescriptionFG::iterator it = fieldsDescriptionFGInUse->find(std::string(s));
129  return it->second.position;
130  }else{
131  silent_cerr("FlightGearFileDriveCallerTypeReader: unknown FG field of " << FGStructureName
132  << " at line " << HP.GetLineData()
133  << std::endl);
135  }
136 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
virtual const char * IsWord(const HighParser::WordSet &ws)
Definition: parser.cc:977
FGNetCtrlsWordSet fGNetCtrlsWordSet
const StreamDrive::Modifier * pGetModifier(void) const
Definition: streamdrive.cc:80
FieldsDescriptionFG fieldsDescriptionFGNetCtrls
FGNetFDMWordSet fGNetFDMWordSet
FieldsDescriptionFG fieldsDescriptionFGNetFDM
virtual HighParser::ErrOut GetLineData(void) const
Definition: parsinc.cc:697
std::map< std::string, FieldInfo > FieldsDescriptionFG

Here is the call graph for this function:


The documentation for this struct was generated from the following files: