Changeset 122 in flair-src for trunk/lib/FlairMeta/src/UavFactory.cpp


Ignore:
Timestamp:
Jan 6, 2017, 1:56:26 PM (4 years ago)
Author:
Sanahuja Guillaume
Message:

modifs uav vrpn i686

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/FlairMeta/src/UavFactory.cpp

    r45 r122  
    3030
    3131namespace { // anonymous
    32      vector<flair::meta::Uav* (*)(FrameworkManager*,string,string,UavMultiplex*)> *vectoroffunctions=NULL;
     32     vector<flair::meta::Uav* (*)(string,string,UavMultiplex*)> *vectoroffunctions=NULL;
    3333}
    3434
     
    4141
    4242
    43 Uav *CreateUav(FrameworkManager *parent, string uav_name, string uav_type,
     43Uav *CreateUav(string name, string uav_type,
    4444               UavMultiplex *multiplex) {
    4545
     
    4848  if(vectoroffunctions!=NULL) {
    4949    for(int i=0;i<vectoroffunctions->size();i++) {
    50       uav=vectoroffunctions->at(i)(parent, uav_name, uav_type,multiplex);
     50      uav=vectoroffunctions->at(i)(name,uav_type,multiplex);
    5151      if(uav!=NULL) {
    5252        free(vectoroffunctions);
     
    5858
    5959  if (uav_type == "hds_x4") {
    60     parent->Err("UAV type %s not yet implemented\n", uav_type.c_str());
     60    getFrameworkManager()->Err("UAV type %s not yet implemented\n", uav_type.c_str());
    6161    return NULL;
    6262  } else if (uav_type == "hds_x8") {
    63     return new HdsX8(parent, uav_name, multiplex);
     63    return new HdsX8(name, multiplex);
    6464  } else if (uav_type == "xair") {
    65     return new XAir(parent, uav_name, multiplex);
     65    return new XAir(name, multiplex);
    6666  } else if (uav_type == "hds_xufo") {
    67     parent->Err("UAV type %s not yet implemented\n", uav_type.c_str());
     67    getFrameworkManager()->Err("UAV type %s not yet implemented\n", uav_type.c_str());
    6868    return NULL;
    6969  } else if (uav_type.compare(0, 7, "x4_simu") == 0) {
     
    7272      simu_id = atoi(uav_type.substr(7, uav_type.size() - 7).c_str());
    7373    }
    74     return new SimuX4(parent, uav_name, simu_id, multiplex);
     74    return new SimuX4(name, simu_id, multiplex);
    7575  } else if (uav_type.compare(0, 7, "x8_simu") == 0) {
    7676    int simu_id = 0;
     
    7878      simu_id = atoi(uav_type.substr(7, uav_type.size() - 7).c_str());
    7979    }
    80     return new SimuX8(parent, uav_name, simu_id, multiplex);
     80    return new SimuX8(name, simu_id, multiplex);
    8181  } else {
    82     parent->Err("UAV type %s unknown\n", uav_type.c_str());
     82    getFrameworkManager()->Err("UAV type %s unknown\n", uav_type.c_str());
    8383    return NULL;
    8484  }
    8585}
    8686
    87 void RegisterUavCreator(flair::meta::Uav*(*func)(FrameworkManager *parent, string uav_name, string uav_type,
     87void RegisterUavCreator(flair::meta::Uav*(*func)(string name, string type,
    8888               UavMultiplex *multiplex)) {
    89   if(vectoroffunctions==NULL) vectoroffunctions=(vector<flair::meta::Uav* (*)(FrameworkManager*,string,string,UavMultiplex*)>*)malloc(sizeof(vector<flair::meta::Uav* (*)(FrameworkManager*,string,string,UavMultiplex*)>));
     89  if(vectoroffunctions==NULL) vectoroffunctions=(vector<flair::meta::Uav* (*)(string,string,UavMultiplex*)>*)malloc(sizeof(vector<flair::meta::Uav* (*)(string,string,UavMultiplex*)>));
    9090
    9191  vectoroffunctions->push_back(func);
Note: See TracChangeset for help on using the changeset viewer.