36 #include <sys/types.h>
78 silent_cerr(
"invalid FG data structure "
86 silent_cout(
"Flight Gear options correctly printed on files." << std::endl);
94 std::vector<ScalarValue*> allValues(totChannels);
95 std::vector<bool> assignedByUser(totChannels,
false);
98 for(FlightGearUserChannels::iterator i = flightGearUserChannels.begin() ; i != flightGearUserChannels.end() ; i++){
99 FieldsDescriptionFG::iterator el = fieldsDescriptionFGInUse->find(i->first);
100 int pos = (el->second.position) -1;
101 allValues.at(pos) = i->second;
102 assignedByUser.at(pos) =
true;
106 this->
setDefaultValues(allValues, assignedByUser, *fieldsDescriptionFGInUse);
118 const char *fieldDescription;
122 while((fieldDescription = HP.
IsWord(*sendToFGWordSetInUse)) != NULL){
123 s =
new std::string(fieldDescription);
124 if(this->
fieldAlreadyUsed(std::string(fieldDescription), flightGearUserChannels)){
125 silent_cerr(
"field of FGNetFDM already used "
131 flightGearUserChannels.insert(FlightGearUserChannels::value_type(*s, scalarValue));
138 if(!assignedByUser.at(fieldsDescriptionFGInUse.find(
"version")->second.position-1)){
141 allValues.at(fieldsDescriptionFGInUse.find(
"version")->second.position-1) =
new ScalarDriveValue(pDC);
144 allValues.at(fieldsDescriptionFGInUse.find(
"version")->second.position-1) =
new ScalarDriveValue(pDC);
148 for (
int i=1 ; i < allValues.size() ; i++){
149 if(!assignedByUser.at(i)){
157 if(flightGearUserChannels.find(fieldDescription) != flightGearUserChannels.end()){
167 std::vector<BufCast *> data(fieldsDescriptionFGInUse.size());
170 size_t minsize = data[data.size() - 1]->offset() + data[data.size() - 1]->size();
171 size_t size = minsize;
HighParser::WordSet * sendToFGWordSetInUse
#define MBDYN_EXCEPT_ARGS
virtual const char * IsWord(const HighParser::WordSet &ws)
void printOptionsOnTextFile(const char *fileName, FieldsDescriptionFG &fieldsDescriptionFG)
void buildFGBufCast(std::vector< BufCast * > &data, FieldsDescriptionFG &fieldsDescriptionFGInUse)
virtual bool IsWord(const std::string &s) const
FGNetCtrlsWordSet fGNetCtrlsWordSet
void ReadFlightGearScalarValues(DataManager *pDM, MBDynParser &HP, FlightGearUserChannels &flightGearUserChannels, FieldsDescriptionFG *dataStructureInUse)
std::map< std::string, ScalarValue * > FlightGearUserChannels
#define SAFENEW(pnt, item)
virtual bool IsKeyWord(const char *sKeyWord)
ScalarValue * ReadScalarValue(DataManager *pDM, MBDynParser &HP)
bool fieldAlreadyUsed(std::string fieldDescription, FlightGearUserChannels &flightGearUserChannels)
#define SAFENEWWITHCONSTRUCTOR(pnt, item, constructor)
StreamContent::Modifier * buildFGStreamContentModifier(FieldsDescriptionFG &fieldsDescriptionFGInUse)
void setDefaultValues(std::vector< ScalarValue * > &allValues, std::vector< bool > &assignedByUser, FieldsDescriptionFG &fieldsDescriptionFGInUse)
virtual StreamContent * Read(DataManager *pDM, MBDynParser &HP)
FieldsDescriptionFG fieldsDescriptionFGNetCtrls
virtual bool IsWord(const std::string &s) const
FGNetFDMWordSet fGNetFDMWordSet
FieldsDescriptionFG fieldsDescriptionFGNetFDM
virtual HighParser::ErrOut GetLineData(void) const
std::map< std::string, FieldInfo > FieldsDescriptionFG