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


Ignore:
Timestamp:
Apr 8, 2016, 3:40:57 PM (6 years ago)
Author:
Bayard Gildas
Message:

sources reformatted with flair-format-dir script

File:
1 edited

Legend:

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

    r10 r15  
    2929using namespace flair::meta;
    3030
    31 Uav* CreateUav(FrameworkManager* parent,string uav_name,string uav_type,UavMultiplex *multiplex) {
    32     /*if(uav_type=="ardrone2") {
     31Uav *CreateUav(FrameworkManager *parent, string uav_name, string uav_type,
     32               UavMultiplex *multiplex) {
     33  /*if(uav_type=="ardrone2") {
    3334        return new ArDrone2(parent,uav_name,multiplex);
    34     } else */if(uav_type=="hds_x4") {
    35         parent->Err("UAV type %s not yet implemented\n",uav_type.c_str());
    36         return NULL;
    37     } else if(uav_type=="hds_x8") {
    38         return new HdsX8(parent,uav_name,multiplex);
    39     } else if(uav_type=="xair") {
    40         return new XAir(parent,uav_name,multiplex);
    41     } else if(uav_type=="hds_xufo") {
    42         parent->Err("UAV type %s not yet implemented\n",uav_type.c_str());
    43         return NULL;
    44     } else if(uav_type.compare(0,7,"x4_simu")==0) {
    45         int simu_id=0;
    46         if(uav_type.size()>7) {
    47             simu_id=atoi(uav_type.substr (7,uav_type.size()-7).c_str());
    48         }
    49         return new SimuX4(parent,uav_name,simu_id,multiplex);
    50     } else if(uav_type.compare(0,7,"x8_simu") == 0) {
    51         int simu_id=0;
    52         if(uav_type.size()>7) {
    53             simu_id=atoi(uav_type.substr (7,uav_type.size()-7).c_str());
    54         }
    55         return new SimuX8(parent,uav_name,simu_id,multiplex);
    56     } else {
    57         parent->Err("UAV type %s unknown\n",uav_type.c_str());
    58         return NULL;
     35    } else */ if (uav_type == "hds_x4") {
     36    parent->Err("UAV type %s not yet implemented\n", uav_type.c_str());
     37    return NULL;
     38  } else if (uav_type == "hds_x8") {
     39    return new HdsX8(parent, uav_name, multiplex);
     40  } else if (uav_type == "xair") {
     41    return new XAir(parent, uav_name, multiplex);
     42  } else if (uav_type == "hds_xufo") {
     43    parent->Err("UAV type %s not yet implemented\n", uav_type.c_str());
     44    return NULL;
     45  } else if (uav_type.compare(0, 7, "x4_simu") == 0) {
     46    int simu_id = 0;
     47    if (uav_type.size() > 7) {
     48      simu_id = atoi(uav_type.substr(7, uav_type.size() - 7).c_str());
    5949    }
     50    return new SimuX4(parent, uav_name, simu_id, multiplex);
     51  } else if (uav_type.compare(0, 7, "x8_simu") == 0) {
     52    int simu_id = 0;
     53    if (uav_type.size() > 7) {
     54      simu_id = atoi(uav_type.substr(7, uav_type.size() - 7).c_str());
     55    }
     56    return new SimuX8(parent, uav_name, simu_id, multiplex);
     57  } else {
     58    parent->Err("UAV type %s unknown\n", uav_type.c_str());
     59    return NULL;
     60  }
    6061}
Note: See TracChangeset for help on using the changeset viewer.