Commit 3ce01da8 authored by Lorenz Meier's avatar Lorenz Meier

Airframes list: Fix format

parent 577e498b
...@@ -26,99 +26,43 @@ ...@@ -26,99 +26,43 @@
#include "AirframeComponentAirframes.h" #include "AirframeComponentAirframes.h"
QMap<QString, AirframeComponentAirframes::AirframeType_t> AirframeComponentAirframes::rgAirframeTypes; QMap<QString, AirframeComponentAirframes::AirframeType_t*> AirframeComponentAirframes::rgAirframeTypes;
AirframeComponentAirframes::AirframeComponentAirframes() { QMap<QString, AirframeComponentAirframes::AirframeType_t*>& AirframeComponentAirframes::get() {
// Standard planes // Set a single airframe to prevent the UI from going crazy
AirframeType_t standardPlane = { "Standard Airplane", "qrc:/qmlimages/AirframeStandardPlane.png", }; if (rgAirframeTypes.count() == 0) {
AirframeInfo_t easystar = {"Multiplex Easystar 1/2", 2100}; // Standard planes
standardPlane.rgAirframeInfo.append(easystar); AirframeType_t *standardPlane = new AirframeType_t;
rgAirframeTypes.insert("StandardPlane", standardPlane); standardPlane->name = "Standard Airplane";
standardPlane->imageResource = "qrc:/qmlimages/AirframeStandardPlane.png";
// Flying wings AirframeInfo_t *easystar = new AirframeInfo_t;
easystar->name = "Multiplex Easystar 1/2";
easystar->autostartId = 2100;
standardPlane->rgAirframeInfo.append(easystar);
rgAirframeTypes.insert("StandardPlane", standardPlane);
qDebug() << "Adding plane config";
// Flying wings
}
return rgAirframeTypes;
} }
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoStandardPlane[] = { void AirframeComponentAirframes::clear() {
// { "Multiplex Easystar 1/2", 2100 },
// { "Generic AERT", 2101 },
// { "3DR Skywalker", 2102 },
// { "Skyhunter (1800 mm)", 2103 },
// { "Generic AETR", 2104 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoSimulation[] = {
// { "Plane (HilStar, X-Plane)", 1000 },
// { "Plane (Rascal, FlightGear)", 1004 },
// { "Quad X HIL", 1001 },
// { "Quad + HIL", 1003 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoFlyingWing[] = {
// { "Z-84 Wing Wing (845 mm)", 3033 },
// { "TBS Caipirinha (850 mm)", 3100 },
// { "Bormatec Camflyer Q (800 mm)", 3030 },
// { "FX-61 Phantom FPV (1550 mm)", 3031 },
// { "FX-79 Buffalo (2000 mm)", 3034 },
// { "Skywalker X5 (1180 mm)", 3032 },
// { "Viper v2 (3000 mm)", 3035 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoQuadRotorX[] = { // Run through all and delete them
// { "DJI F330 8\" Quad", 4010 }, for (unsigned tindex = 0; tindex < AirframeComponentAirframes::get().count(); tindex++) {
// { "DJI F450 10\" Quad", 4011 },
// { "X frame Quad UAVCAN", 4012 },
// { "AR.Drone Frame Quad", 4008 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoQuadRotorPlus[] = { const AirframeComponentAirframes::AirframeType_t* pType = AirframeComponentAirframes::get().values().at(tindex);
// { "Generic 10\" Quad +", 5001 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoHexaRotorX[] = { for (unsigned index = 0; index < pType->rgAirframeInfo.count(); index++) {
// { "Standard 10\" Hexa X", 6001 }, const AirframeComponentAirframes::AirframeInfo_t* pInfo = pType->rgAirframeInfo.at(index);
// { "Coaxial 10\" Hexa X", 11001 }, delete pInfo;
// { NULL, 0 } }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoHexaRotorPlus[] = { delete pType;
// { "Standard 10\" Hexa", 7001 }, }
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoOctoRotorX[] = { rgAirframeTypes.clear();
// { "Standard 10\" Octo", 8001 }, }
// { "Coaxial 10\" Octo", 12001 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoOctoRotorPlus[] = {
// { "Standard 10\" Octo", 9001 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeInfo_t AirframeComponentAirframes::_rgAirframeInfoQuadRotorH[] = {
// { "3DR Iris", 10016 },
// { "TBS Discovery", 10015 },
// { "SteadiDrone QU4D", 10017 },
// { NULL, 0 }
//};
//const AirframeComponentAirframes::AirframeType_t AirframeComponentAirframes::rgAirframeTypes[] = {
// { "Standard Airplane", "qrc:/qmlimages/AirframeStandardPlane.png", AirframeComponentAirframes::_rgAirframeInfoStandardPlane },
// { "Flying Wing", "qrc:/qmlimages/AirframeFlyingWing.png", AirframeComponentAirframes::_rgAirframeInfoFlyingWing },
// { "QuadRotor X", "qrc:/qmlimages/AirframeQuadRotorX.png", AirframeComponentAirframes::_rgAirframeInfoQuadRotorX },
// { "QuadRotor +", "qrc:/qmlimages/AirframeQuadRotorPlus.png", AirframeComponentAirframes::_rgAirframeInfoQuadRotorPlus },
// { "HexaRotor X", "qrc:/qmlimages/AirframeHexaRotorX.png", AirframeComponentAirframes::_rgAirframeInfoHexaRotorX },
// { "HexaRotor +", "qrc:/qmlimages/AirframeHexaRotorPlus.png", AirframeComponentAirframes::_rgAirframeInfoHexaRotorPlus },
// { "OctoRotor X", "qrc:/qmlimages/AirframeOctoRotorX.png", AirframeComponentAirframes::_rgAirframeInfoOctoRotorX },
// { "OctoRotor +", "qrc:/qmlimages/AirframeOctoRotorPlus.png", AirframeComponentAirframes::_rgAirframeInfoOctoRotorPlus },
// { "QuadRotor H", "qrc:/qmlimages/AirframeQuadRotorH.png", AirframeComponentAirframes::_rgAirframeInfoQuadRotorH },
// { "Simulation", "qrc:/qmlimages/AirframeSimulation.png", AirframeComponentAirframes::_rgAirframeInfoSimulation },
// { NULL, NULL, NULL }
//};
...@@ -39,21 +39,22 @@ ...@@ -39,21 +39,22 @@
class AirframeComponentAirframes class AirframeComponentAirframes
{ {
public: public:
AirframeComponentAirframes();
typedef struct { typedef struct {
const char* name; QString name;
int autostartId; int autostartId;
} AirframeInfo_t; } AirframeInfo_t;
typedef struct { typedef struct {
const char* name; QString name;
const char* imageResource; QString imageResource;
QList<AirframeInfo_t> rgAirframeInfo; QList<AirframeInfo_t*> rgAirframeInfo;
} AirframeType_t; } AirframeType_t;
static QMap<QString, AirframeComponentAirframes::AirframeType_t*>& get();
static void clear();
public: protected:
static QMap<QString, AirframeType_t> rgAirframeTypes; static QMap<QString, AirframeType_t*> rgAirframeTypes;
private: private:
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment