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

#include <module-flightgear.h>

Inheritance diagram for FlightGearFileDriveReader:
Collaboration diagram for FlightGearFileDriveReader:

Public Member Functions

virtual StreamDrive::ModifierRead (std::vector< doublereal > &v0, MBDynParser &HP, int &idrives)
 
StreamDrive::ModifierbuildFGStreamDriveModifier (FieldsDescriptionFG *fieldsDescriptionFGInUse)
 
- Public Member Functions inherited from FileDriveContentTypeReader
virtual ~FileDriveContentTypeReader (void)
 

Detailed Description

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

Member Function Documentation

StreamDrive::Modifier * FlightGearFileDriveReader::buildFGStreamDriveModifier ( FieldsDescriptionFG fieldsDescriptionFGInUse)

Definition at line 83 of file recFromFlightgear.cc.

References buildFGBufCast(), fieldsDescriptionFGNetCtrls, fieldsDescriptionFGNetFDM, and MBDYN_EXCEPT_ARGS.

Referenced by Read().

83  {
84  StreamDrive::Modifier *pSDM(0);
85 
86  std::vector<BufCast *> data(fieldsDescriptionFGInUse->size());
87  buildFGBufCast(data, *fieldsDescriptionFGInUse);
88  size_t minsize = data[data.size() - 1]->offset() + data[data.size() - 1]->size();
89  size_t size = minsize;
90 
91  if(fieldsDescriptionFGInUse == &fieldsDescriptionFGNetFDM){
92  pSDM = new FGNetFDMStreamDriveCopyCast(size, data);
93  }else if(fieldsDescriptionFGInUse == &fieldsDescriptionFGNetCtrls){
94  pSDM = new FGNetCtrlsStreamDriveCopyCast(size, data);
95  }else{
96  silent_cerr("FlightGearFileDriveReader::buildFGStreamDriveModifier internal error: unknown fieldsDescriptionFGInUse " << std::endl);
98  }
99 
100  return pSDM;
101 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
void buildFGBufCast(std::vector< BufCast * > &data, FieldsDescriptionFG &fieldsDescriptionFGInUse)
FieldsDescriptionFG fieldsDescriptionFGNetCtrls
FieldsDescriptionFG fieldsDescriptionFGNetFDM

Here is the call graph for this function:

StreamDrive::Modifier * FlightGearFileDriveReader::Read ( std::vector< doublereal > &  v0,
MBDynParser HP,
int idrives 
)
virtual

Implements FileDriveContentTypeReader.

Definition at line 53 of file recFromFlightgear.cc.

References buildFGStreamDriveModifier(), fieldsDescriptionFGNetCtrls, fieldsDescriptionFGNetFDM, IncludeParser::GetLineData(), HighParser::IsKeyWord(), MBDYN_EXCEPT_ARGS, and printOptionsOnTextFile().

53  {
54  StreamDrive::Modifier *pMod = 0;
55 
56  FieldsDescriptionFG *fieldsDescriptionFGInUse;
57 
58  if(HP.IsKeyWord("NetFDM")){
59  fieldsDescriptionFGInUse = &fieldsDescriptionFGNetFDM;
60  idrives = fieldsDescriptionFGNetFDM.size();
61  }
62  else if(HP.IsKeyWord("NetCtrls")){
63  fieldsDescriptionFGInUse = &fieldsDescriptionFGNetCtrls;
64  idrives = fieldsDescriptionFGNetCtrls.size();
65  }
66  else{
67  silent_cerr("invalid FG data structure "
68  "at line " << HP.GetLineData() << std::endl);
70  }
71 
72  if(HP.IsKeyWord("print" "options")){
73  printOptionsOnTextFile("FGNetFDM_options.txt", fieldsDescriptionFGNetFDM);
74  printOptionsOnTextFile("FGNetCtrls_options.txt", fieldsDescriptionFGNetCtrls);
75  silent_cout("Flight Gear options correctly printed on files." << std::endl);
76  }
77 
78  pMod = this->buildFGStreamDriveModifier(fieldsDescriptionFGInUse);
79 
80  return pMod;
81 }
#define MBDYN_EXCEPT_ARGS
Definition: except.h:63
void printOptionsOnTextFile(const char *fileName, FieldsDescriptionFG &fieldsDescriptionFG)
StreamDrive::Modifier * buildFGStreamDriveModifier(FieldsDescriptionFG *fieldsDescriptionFGInUse)
virtual bool IsKeyWord(const char *sKeyWord)
Definition: parser.cc:910
FieldsDescriptionFG fieldsDescriptionFGNetCtrls
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: