diff --git a/companion/src/CMakeLists.txt b/companion/src/CMakeLists.txt index 73d21daff..652ca745c 100644 --- a/companion/src/CMakeLists.txt +++ b/companion/src/CMakeLists.txt @@ -151,8 +151,8 @@ set(companion_SRCS splashlibrary.cpp mainwindow.cpp companion.cpp - modelconfigdialog.cpp qcustomplot.cpp + wizarddialog.cpp ) set(companion_MOC_HDRS @@ -174,9 +174,9 @@ set(companion_MOC_HDRS modelslist.h mdichild.h mainwindow.h - modelconfigdialog.h qcustomplot.h helpers.h + wizarddialog.h ) set(companion_UIS @@ -195,7 +195,6 @@ set(companion_UIS customizesplashdialog.ui splashlibrary.ui burndialog.ui - modelconfigdialog.ui ) set(companion_RCS diff --git a/companion/src/companion.qrc b/companion/src/companion.qrc index df5a5470e..fa38969d8 100644 --- a/companion/src/companion.qrc +++ b/companion/src/companion.qrc @@ -60,6 +60,7 @@ images/wizard/ailerons.png images/wizard/airbrakes.png images/wizard/bank.png + images/wizard/conclusion.png images/wizard/cyclic.png images/wizard/fblheli.png images/wizard/flaps.png @@ -68,10 +69,12 @@ images/wizard/helictrl.png images/wizard/models.png images/wizard/multirotor.png + images/wizard/rudder.png images/wizard/simpletail.png images/wizard/tail.png images/wizard/tails.png images/wizard/throttle.png + images/wizard/wingtype.png images/library/00001.png images/library/00002.png images/library/00003.png diff --git a/companion/src/images/wizard/ailerons.png b/companion/src/images/wizard/ailerons.png index e6f9f741a..389bfae01 100644 Binary files a/companion/src/images/wizard/ailerons.png and b/companion/src/images/wizard/ailerons.png differ diff --git a/companion/src/images/wizard/airbrakes.png b/companion/src/images/wizard/airbrakes.png index 466e81b3d..66fc8c8a3 100644 Binary files a/companion/src/images/wizard/airbrakes.png and b/companion/src/images/wizard/airbrakes.png differ diff --git a/companion/src/images/wizard/bank.png b/companion/src/images/wizard/bank.png index 6cef38878..5697f3eed 100644 Binary files a/companion/src/images/wizard/bank.png and b/companion/src/images/wizard/bank.png differ diff --git a/companion/src/images/wizard/conclusion.png b/companion/src/images/wizard/conclusion.png new file mode 100644 index 000000000..8b188491d Binary files /dev/null and b/companion/src/images/wizard/conclusion.png differ diff --git a/companion/src/images/wizard/cyclic.png b/companion/src/images/wizard/cyclic.png index 56ff59f5b..1d5a5cdc4 100644 Binary files a/companion/src/images/wizard/cyclic.png and b/companion/src/images/wizard/cyclic.png differ diff --git a/companion/src/images/wizard/fblheli.png b/companion/src/images/wizard/fblheli.png index 839c20004..6ff59f70e 100644 Binary files a/companion/src/images/wizard/fblheli.png and b/companion/src/images/wizard/fblheli.png differ diff --git a/companion/src/images/wizard/flaps.png b/companion/src/images/wizard/flaps.png index 349149d60..635db4407 100644 Binary files a/companion/src/images/wizard/flaps.png and b/companion/src/images/wizard/flaps.png differ diff --git a/companion/src/images/wizard/gyro.png b/companion/src/images/wizard/gyro.png index 96cbb2571..1fef2d933 100644 Binary files a/companion/src/images/wizard/gyro.png and b/companion/src/images/wizard/gyro.png differ diff --git a/companion/src/images/wizard/helictrl.png b/companion/src/images/wizard/helictrl.png index 729e5f50f..088cad50c 100644 Binary files a/companion/src/images/wizard/helictrl.png and b/companion/src/images/wizard/helictrl.png differ diff --git a/companion/src/images/wizard/models.png b/companion/src/images/wizard/models.png index fa4cd6c82..8b188491d 100644 Binary files a/companion/src/images/wizard/models.png and b/companion/src/images/wizard/models.png differ diff --git a/companion/src/images/wizard/multirotor.png b/companion/src/images/wizard/multirotor.png index eccf45b0d..c99203dbd 100644 Binary files a/companion/src/images/wizard/multirotor.png and b/companion/src/images/wizard/multirotor.png differ diff --git a/companion/src/images/wizard/rudder.png b/companion/src/images/wizard/rudder.png new file mode 100644 index 000000000..60927d0ec Binary files /dev/null and b/companion/src/images/wizard/rudder.png differ diff --git a/companion/src/images/wizard/simpletail.png b/companion/src/images/wizard/simpletail.png index 884ed3821..1fcc15364 100644 Binary files a/companion/src/images/wizard/simpletail.png and b/companion/src/images/wizard/simpletail.png differ diff --git a/companion/src/images/wizard/tail.png b/companion/src/images/wizard/tail.png index 7273ff77b..09121ed17 100644 Binary files a/companion/src/images/wizard/tail.png and b/companion/src/images/wizard/tail.png differ diff --git a/companion/src/images/wizard/tails.png b/companion/src/images/wizard/tails.png index 148407b11..5ad1f03e0 100644 Binary files a/companion/src/images/wizard/tails.png and b/companion/src/images/wizard/tails.png differ diff --git a/companion/src/images/wizard/throttle.png b/companion/src/images/wizard/throttle.png index 200abc32b..28edad587 100644 Binary files a/companion/src/images/wizard/throttle.png and b/companion/src/images/wizard/throttle.png differ diff --git a/companion/src/images/wizard/wingtype.png b/companion/src/images/wizard/wingtype.png new file mode 100644 index 000000000..979fd74d2 Binary files /dev/null and b/companion/src/images/wizard/wingtype.png differ diff --git a/companion/src/mdichild.cpp b/companion/src/mdichild.cpp index 91a5ba3e1..9bde8a9f7 100644 --- a/companion/src/mdichild.cpp +++ b/companion/src/mdichild.cpp @@ -52,6 +52,7 @@ #include "burndialog.h" #include "helpers.h" #include "appdata.h" +#include "wizarddialog.h" #include #if defined WIN32 || !defined __GNUC__ @@ -109,6 +110,12 @@ void MdiChild::copy() ui->modelsList->copy(); } +void MdiChild::openWizard() +{ + WizardDialog *wizard = new WizardDialog(this); + wizard->show(); +} + void MdiChild::paste() { ui->modelsList->paste(); @@ -145,9 +152,10 @@ void MdiChild::on_SimulateTxButton_clicked() startSimulation(this, radioData, -1); } -void MdiChild::OpenEditWindow(bool wizard=false) +void MdiChild::OpenEditWindow() { int row = ui->modelsList->currentRow(); + bool wizard=false; if (row) { //TODO error checking @@ -159,10 +167,9 @@ void MdiChild::OpenEditWindow(bool wizard=false) isNew = true; //modeledit - clear mixes, apply first template setModified(); } - if (isNew && !wizard) { + if (isNew) { int ret; - bool wizardEnable=g.enableWizard(); - if (wizardEnable) { + if (g.enableWizard()) { ret = QMessageBox::question(this, tr("Companion"), tr("Do you want to use model wizard? "), QMessageBox::Yes | QMessageBox::No); if (ret == QMessageBox::Yes) { wizard=true; diff --git a/companion/src/mdichild.h b/companion/src/mdichild.h index 7a18491eb..9aaaa7c2c 100644 --- a/companion/src/mdichild.h +++ b/companion/src/mdichild.h @@ -89,10 +89,11 @@ private slots: void qSleep(int ms); public slots: - void OpenEditWindow(bool wizard); - + void OpenEditWindow(); + void cut(); void copy(); + void openWizard(); void paste(); void writeEeprom(); void simulate(); diff --git a/companion/src/modelconfigdialog.cpp b/companion/src/modelconfigdialog.cpp deleted file mode 100644 index 4badaa906..000000000 --- a/companion/src/modelconfigdialog.cpp +++ /dev/null @@ -1,937 +0,0 @@ -#include "modelconfigdialog.h" -#include "ui_modelconfigdialog.h" -#include "helpers.h" -#include "eeprominterface.h" -#include -#include "helpers.h" - -#define NUM_CH 10 - -modelConfigDialog::modelConfigDialog(RadioData &radioData, uint64_t * result, QWidget *parent) : - QDialog(parent), - ui(new Ui::modelConfigDialog), - radioData(radioData), - result(result), - generalSettings(radioData.generalSettings) -{ - ui->setupUi(this); - this->setWindowIcon(CompanionIcon("wizard.png")); - rxLock=false; - ruddercolor << "#ffd100" << "#ffff00"; - throttlecolor << "#e40000"; - aileroncolor << "#0000ff" << "#00ffff"; - elevatorcolor << "#827f00" << "#ffff00"; - flapscolor << "#007f00" << "#00ff00"; - airbrakecolor << "#9b0099" << "#ff00fc"; - helicolor << "#00ff00" << "#0000ff" << "#00ffff" << "#ffff00" << "#e40000" << "#ffa400"; - connect(ui->ailType_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(ConfigChanged())); - connect(ui->flapsType_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(ConfigChanged())); - connect(ui->spoilersType_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(ConfigChanged())); - connect(ui->swashType_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(ConfigChanged())); - connect(ui->engine_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(ConfigChanged())); - connect(ui->rudder_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(ConfigChanged())); - connect(ui->tailType_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(tailConfigChanged())); - connect(ui->gyro_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(tailConfigChanged())); - connect(ui->chStyle_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(ConfigChanged())); - connect(ui->asail2_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(rxUpdate())); - connect(ui->asele2_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(rxUpdate())); - connect(ui->asrud2_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(rxUpdate())); - connect(ui->asfla1_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(rxUpdate())); - connect(ui->asfla2_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(rxUpdate())); - connect(ui->asspo1_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(rxUpdate())); - connect(ui->asspo2_CB,SIGNAL(currentIndexChanged(int)),this,SLOT(rxUpdate())); - connect(ui->as_CB,SIGNAL(clicked()),this,SLOT(rxUpdate())); - formSetup(); - QTimer::singleShot(0, this, SLOT(shrink())); - connect(ui->buttonBox,SIGNAL(clicked(QAbstractButton*)), this, SLOT(doAction(QAbstractButton*))); -} - -modelConfigDialog::~modelConfigDialog() -{ - delete ui; -} - -void modelConfigDialog::rxUpdate() -{ - QLabel * channel[] = {ui->CH_1,ui->CH_2,ui->CH_3,ui->CH_4,ui->CH_5,ui->CH_6,ui->CH_7,ui->CH_8,ui->CH_9,ui->CH_10,NULL}; - for (int i=0; channel[i]; i++) { - channel[i]->setStyleSheet(""); - } - for (int i=0; ias_CB->isChecked()) { - if ((ModelType==0) || (ModelType==2)) { - index=ui->asail2_CB->currentIndex(); - if (ailerons>1 && index>0) { - rx[index-1]=true; - } - index=ui->asele2_CB->currentIndex(); - if (elevators>1 && index>0) { - rx[index-1]=true; - } - } - if (ModelType==3) { - index=ui->asrud2_CB->currentIndex(); - if (rudders>1 && index>0) { - rx[index-1]=true; - } - } - index=ui->asfla1_CB->currentIndex(); - if (flaps>0 && index>0) { - rx[index-1]=true; - } - index=ui->asfla2_CB->currentIndex(); - if (flaps>1 && index>0) { - rx[index-1]=true; - } - if ((ModelType==0) || (ModelType==2)) { - index=ui->asspo1_CB->currentIndex(); - if (spoilers>0 && index>0) { - rx[index-1]=true; - } - index=ui->asspo2_CB->currentIndex(); - if (spoilers>1 && index>0) { - rx[index-1]=true; - } - } - } - #define ICC(x) icc[(x)-1] - uint8_t icc[4] = {0}; - for(uint8_t i=1; i<=4; i++) //generate inverse array - for(uint8_t j=1; j<=4; j++) if(CC(i)==j) icc[j-1]=i; - uint8_t stick; - switch (ModelType) { - case 0: //AIRPLANE - stick=ICC(STK_THR); - channel[stick-1]->setStyleSheet(QString("background-color: %1;").arg(throttlecolor.at(0))); - rx[stick-1]=true; - stick=ICC(STK_RUD); - channel[stick-1]->setStyleSheet(QString("background-color: %1;").arg(ruddercolor.at(0))); - rx[stick-1]=true; - if (ailerons>0) { - stick=ICC(STK_AIL); - channel[stick-1]->setStyleSheet(QString("background-color: %1;").arg(aileroncolor.at(0))); - rx[stick-1]=true; - } - stick=ICC(STK_ELE); - channel[stick-1]->setStyleSheet(QString("background-color: %1;").arg(elevatorcolor.at(0))); - rx[stick-1]=true; - if (ailerons>1) { - index=ui->asail2_CB->currentIndex(); - if (!ui->as_CB->isChecked()) - index=0; - if (index==0) { - for (int j=0; jsetStyleSheet(QString("background-color: %1;").arg(aileroncolor.at(1))); - rx[j]=true; - break; - } - } - } else { - channel[index-1]->setStyleSheet(QString("background-color: %1;").arg(aileroncolor.at(1))); - } - } - if (elevators>1) { - index=ui->asele2_CB->currentIndex(); - if (!ui->as_CB->isChecked()) - index=0; - if (index==0) { - for (int j=0; jsetStyleSheet(QString("background-color: %1;").arg(elevatorcolor.at(1))); - rx[j]=true; - break; - } - } - } else { - channel[index-1]->setStyleSheet(QString("background-color: %1;").arg(elevatorcolor.at(1))); - } - } - for (uint8_t i=0; i< flaps; i++) { - if (i==0) { - index=ui->asfla1_CB->currentIndex(); - } else { - index=ui->asfla2_CB->currentIndex(); - } - if (!ui->as_CB->isChecked()) - index=0; - if (index==0) { - for (int j=0; jsetStyleSheet(QString("background-color: %1;").arg(flapscolor.at(i))); - rx[j]=true; - break; - } - }; - } else { - channel[index-1]->setStyleSheet(QString("background-color: %1;").arg(flapscolor.at(i))); - } - } - break; - case 1: //HELI - switch (ui->chStyle_CB->currentIndex()) { - case 0: - channel[0]->setStyleSheet(QString("background-color: %1;").arg(helicolor.at(0))); //ELE CYC1 - channel[1]->setStyleSheet(QString("background-color: %1;").arg(helicolor.at(1))); //AIL CYC2 - channel[2]->setStyleSheet(QString("background-color: %1;").arg(helicolor.at(2))); //PITCH CYC3 - channel[3]->setStyleSheet(QString("background-color: %1;").arg(helicolor.at(3))); //RUD - channel[4]->setStyleSheet(QString("background-color: %1;").arg(helicolor.at(4))); //THR - if (ui->gyro_CB->currentIndex()>0) { - channel[5]->setStyleSheet(QString("background-color: %1;").arg(helicolor.at(5))); //GYRO - } - break; - case 1: - channel[0]->setStyleSheet(QString("background-color: %1;").arg(helicolor.at(1))); //AIL CYC2 - channel[1]->setStyleSheet(QString("background-color: %1;").arg(helicolor.at(0))); //ELE CYC1 - channel[2]->setStyleSheet(QString("background-color: %1;").arg(helicolor.at(4))); //THR - channel[3]->setStyleSheet(QString("background-color: %1;").arg(helicolor.at(3))); //RUD - if (ui->gyro_CB->currentIndex()>0) { - channel[4]->setStyleSheet(QString("background-color: %1;").arg(helicolor.at(5))); //GYRO - } - channel[5]->setStyleSheet(QString("background-color: %1;").arg(helicolor.at(2))); //PIT CYC3 - break; - } - break; - case 2: //GLIDER - if (throttle>0) { - stick=ICC(STK_THR); - channel[stick-1]->setStyleSheet(QString("background-color: %1;").arg(throttlecolor.at(0))); - rx[stick-1]=true; - } - if (ailerons>0) { - stick=ICC(STK_AIL); - channel[stick-1]->setStyleSheet(QString("background-color: %1;").arg(aileroncolor.at(0))); - rx[stick-1]=true; - } - stick=ICC(STK_ELE); - channel[stick-1]->setStyleSheet(QString("background-color: %1;").arg(elevatorcolor.at(0))); - rx[stick-1]=true; - stick=ICC(STK_RUD); - channel[stick-1]->setStyleSheet(QString("background-color: %1;").arg(ruddercolor.at(0))); - rx[stick-1]=true; - if (ailerons>1) { - index=ui->asail2_CB->currentIndex(); - if (!ui->as_CB->isChecked()) - index=0; - if (index==0) { - for (int j=0; jsetStyleSheet(QString("background-color: %1;").arg(aileroncolor.at(1))); - rx[j]=true; - break; - } - } - } else { - channel[index-1]->setStyleSheet(QString("background-color: %1;").arg(aileroncolor.at(1))); - } - } - if (elevators>1) { - index=ui->asele2_CB->currentIndex(); - if (!ui->as_CB->isChecked()) - index=0; - if (index==0) { - for (int j=0; jsetStyleSheet(QString("background-color: %1;").arg(elevatorcolor.at(1))); - rx[j]=true; - break; - } - } - } else { - channel[index-1]->setStyleSheet(QString("background-color: %1;").arg(elevatorcolor.at(1))); - } - } - for (uint8_t i=0; i< flaps; i++) { - if (i==0) { - index=ui->asfla1_CB->currentIndex(); - } else { - index=ui->asfla2_CB->currentIndex(); - } - if (!ui->as_CB->isChecked()) - index=0; - if (index==0) { - for (int j=0; jsetStyleSheet(QString("background-color: %1;").arg(flapscolor.at(i))); - rx[j]=true; - break; - } - }; - } else { - channel[index-1]->setStyleSheet(QString("background-color: %1;").arg(flapscolor.at(i))); - } - } - for (uint8_t i=0; i< spoilers; i++) { - if (i==0) { - index=ui->asspo1_CB->currentIndex(); - } else { - index=ui->asspo2_CB->currentIndex(); - } - if (!ui->as_CB->isChecked()) - index=0; - if (index==0) { - for (int j=0; jsetStyleSheet(QString("background-color: %1;").arg(airbrakecolor.at(i))); - rx[j]=true; - break; - } - }; - } else { - channel[index-1]->setStyleSheet(QString("background-color: %1;").arg(airbrakecolor.at(i))); - } - } - break; - case 3: //DELTA WING - if (throttle>0) { - stick=ICC(STK_THR); - channel[stick-1]->setStyleSheet(QString("background-color: %1;").arg(throttlecolor.at(0))); - rx[stick-1]=true; - } - stick=ICC(STK_AIL); - channel[stick-1]->setStyleSheet(QString("background-color: %1;").arg(aileroncolor.at(0))); - rx[stick-1]=true; - stick=ICC(STK_ELE); - channel[stick-1]->setStyleSheet(QString("background-color: %1;").arg(elevatorcolor.at(0))); - rx[stick-1]=true; - if (rudders>0) { - stick=ICC(STK_RUD); - channel[stick-1]->setStyleSheet(QString("background-color: %1;").arg(ruddercolor.at(0))); - rx[stick-1]=true; - } - if (rudders>1) { - index=ui->asrud2_CB->currentIndex(); - if (!ui->as_CB->isChecked()) - index=0; - if (index==0) { - for (int j=0; jsetStyleSheet(QString("background-color: %1;").arg(ruddercolor.at(1))); - rx[j]=true; - break; - } - } - } else { - channel[index-1]->setStyleSheet(QString("background-color: %1;").arg(ruddercolor.at(1))); - } - } - for (uint8_t i=0; i< flaps; i++) { - if (i==0) { - index=ui->asfla1_CB->currentIndex(); - } else { - index=ui->asfla2_CB->currentIndex(); - } - if (!ui->as_CB->isChecked()) - index=0; - if (index==0) { - for (int j=0; jsetStyleSheet(QString("background-color: %1;").arg(flapscolor.at(i))); - rx[j]=true; - break; - } - }; - } else { - channel[index-1]->setStyleSheet(QString("background-color: %1;").arg(flapscolor.at(i))); - } - } - break; - } - asUpdate(); -} - -void modelConfigDialog::tailConfigChanged() -{ - if (tailLock) - return; - tailLock=true; - QImage image; - int index; - int head; - switch (ModelType) { - case 0: - index=ui->tailType_CB->currentIndex(); - switch (index) { - case 0: - rudders=1; - elevators=1; - image.load(":/images/mcw/at1e1r.png"); - break; - case 1: - rudders=1; - elevators=1; - image.load(":/images/mcw/atailv.png"); - break; - case 2: - rudders=1; - elevators=2; - image.load(":/images/mcw/at2e1r.png"); - break; - } - break; - case 1: - elevators=1; - rudders=1; - head=ui->swashType_CB->currentIndex(); - if (head==4) { - index=ui->gyro_CB->currentIndex(); - switch (index) { - case 0: - image.load(":/images/mcw/htailfblng.png"); - break; - case 1: - image.load(":/images/mcw/htailfblg.png"); - break; - case 2: - image.load(":/images/mcw/htailfblg.png"); - break; - } - } else { - index=ui->gyro_CB->currentIndex(); - switch (index) { - case 0: - image.load(":/images/mcw/htailng.png"); - break; - case 1: - image.load(":/images/mcw/htailg.png"); - break; - case 2: - image.load(":/images/mcw/htailg.png"); - break; - } - } - break; - case 2: - index=ui->tailType_CB->currentIndex(); - switch (index) { - case 0: - elevators=1; - rudders=1; - image.load(":/images/mcw/gt1e1r.png"); - break; - case 1: - elevators=1; - rudders=1; - image.load(":/images/mcw/gtailv.png"); - break; - case 2: - elevators=2; - rudders=1; - image.load(":/images/mcw/gt2e1r.png"); - break; - } - break; - } - ui->tailImg->setPixmap(QPixmap::fromImage(image)); - tailLock=false; - rxUpdate(); -} - -void modelConfigDialog::ConfigChanged() -{ - if (wingsLock) - return; - wingsLock=true; - QImage image; - QString imgname=":/images/mcw/"; - QStringList wimages; - int index; - switch (ModelType) { - case 0: - if (ui->ailType_CB->currentIndex()==0) { - ui->flapsType_CB->setCurrentIndex(0); - ui->flapsType_CB->setDisabled(true); - } else { - ui->flapsType_CB->setEnabled(true); - } - ailerons=ui->ailType_CB->currentIndex(); - flaps=ui->flapsType_CB->currentIndex(); - throttle=1; - imgname.append(QString("aw%1a%2f.png").arg(ui->ailType_CB->currentIndex()).arg(ui->flapsType_CB->currentIndex())); - image.load(imgname); - ui->wingImg->setPixmap(QPixmap::fromImage(image)); - break; - case 1: - wimages.clear(); - wimages << "h90.png" << "h120.png" << "h120x.png" << "h140.png" << "hfbl.png"; - index=ui->swashType_CB->currentIndex(); - ui->gyroType_Label->show(); - ui->gyro_CB->show(); - ailerons=1; - throttle=1; - imgname.append(wimages.at(index)); - image.load(imgname); - ui->wingImg->setPixmap(QPixmap::fromImage(image)); - tailConfigChanged(); - break; - case 2: - if (ui->ailType_CB->currentIndex()==0) { - ui->flapsType_CB->setCurrentIndex(0); - ui->flapsType_CB->setDisabled(true); - } else { - ui->flapsType_CB->setEnabled(true); - } - if (ui->ailType_CB->currentIndex()==0) { - ui->spoilersType_CB->setCurrentIndex(0); - ui->spoilersType_CB->setDisabled(true); - } else { - ui->spoilersType_CB->setEnabled(true); - } - ailerons=ui->ailType_CB->currentIndex(); - flaps=ui->flapsType_CB->currentIndex(); - spoilers=ui->spoilersType_CB->currentIndex(); - throttle=ui->engine_CB->currentIndex(); - imgname.append(QString("gw%1t%2a%3f%4s.png").arg(ui->engine_CB->currentIndex()).arg(ui->ailType_CB->currentIndex()).arg(ui->flapsType_CB->currentIndex()).arg(ui->spoilersType_CB->currentIndex())); - image.load(imgname); - ui->wingImg->setPixmap(QPixmap::fromImage(image)); - break; - case 3: - ailerons=ui->ailType_CB->currentIndex(); - flaps=ui->flapsType_CB->currentIndex(); - rudders=ui->rudder_CB->currentIndex(); - throttle=ui->engine_CB->currentIndex(); - imgname.append(QString("dt%1t2e%2f%3r.png").arg(ui->engine_CB->currentIndex()).arg(ui->flapsType_CB->currentIndex()).arg(ui->rudder_CB->currentIndex())); - image.load(imgname); - ui->wingImg->setPixmap(QPixmap::fromImage(image)); - imgname.clear(); - imgname.append(QString(":/images/mcw/db%1t2e%2f%3r.png").arg(ui->engine_CB->currentIndex()).arg(ui->flapsType_CB->currentIndex()).arg(ui->rudder_CB->currentIndex())); - image.load(imgname); - ui->tailImg->setPixmap(QPixmap::fromImage(image)); - break; - default: - ui->wingImg->clear(); - break; - } - wingsLock=false; - rxUpdate(); -} - -void modelConfigDialog::on_planeButton_clicked() -{ - ui->planeButton->setStyleSheet("background-color: #007f00; color: white;"); - ui->heliButton->setStyleSheet(""); - ui->gliderButton->setStyleSheet(""); - ui->deltaButton->setStyleSheet(""); - ModelType=0; - wingsLock=true; - tailLock=true; - ui->engine_Label->hide(); - ui->engine_CB->setCurrentIndex(0); - ui->engine_CB->hide(); - ui->rudder_Label->hide(); - ui->rudder_CB->setCurrentIndex(0); - ui->rudder_CB->hide(); - ui->spoilersLabel->hide(); - ui->spoilersType_CB->setCurrentIndex(0); - ui->spoilersType_CB->hide(); - ui->spLabel->hide(); - ui->sp_Label->hide(); - ui->swashType_CB->setCurrentIndex(0); - ui->swashType_CB->hide(); - ui->gyroType_Label->hide(); - ui->gyro_CB->setCurrentIndex(0); - ui->gyro_CB->hide(); - ui->chStyle_CB->hide(); - ui->chStyle_CB->setCurrentIndex(0); - ui->chassign_Label->hide(); - ui->wingLabel->show(); - ui->ailType_Label->show(); - ui->ailType_CB->show(); - ui->ailType_CB->setCurrentIndex(0); - ui->tailLabel->show(); - ui->tailType_Label->show(); - ui->tailType_CB->show(); - ui->tailType_CB->setCurrentIndex(0); - ui->flapsType_Label->show(); - ui->flapsType_CB->show(); - ui->flapsType_CB->setCurrentIndex(0); - ui->flapsType_CB->setDisabled(true); - ui->planeButton->setDisabled(true); - ui->heliButton->setEnabled(true); - ui->gliderButton->setEnabled(true); - ui->deltaButton->setEnabled(true); - wingsLock=false; - tailLock=false; - resetControls(); - ConfigChanged(); - tailConfigChanged(); -} - -void modelConfigDialog::on_heliButton_clicked() -{ - ui->planeButton->setStyleSheet(""); - ui->heliButton->setStyleSheet("background-color: #007f00; color: white;"); - ui->gliderButton->setStyleSheet(""); - ui->deltaButton->setStyleSheet(""); - ModelType=1; - wingsLock=true; - tailLock=true; - ui->engine_Label->hide(); - ui->engine_CB->setCurrentIndex(0); - ui->engine_CB->hide(); - ui->rudder_Label->hide(); - ui->rudder_CB->setCurrentIndex(0); - ui->rudder_CB->hide(); - ui->wingLabel->hide(); - ui->ailType_Label->hide(); - ui->ailType_CB->hide(); - ui->ailType_CB->setCurrentIndex(0); - ui->tailType_Label->hide(); - ui->tailType_CB->hide(); - ui->tailType_CB->setCurrentIndex(0); - ui->flapsType_Label->hide(); - ui->flapsType_CB->hide(); - ui->flapsType_CB->setCurrentIndex(0); - ui->flapsType_CB->setDisabled(true); - ui->spoilersLabel->hide(); - ui->spoilersType_CB->setCurrentIndex(0); - ui->spoilersType_CB->hide(); - ui->tailLabel->show(); - ui->spLabel->show(); - ui->sp_Label->show(); - ui->swashType_CB->setCurrentIndex(0); - ui->swashType_CB->show(); - ui->gyroType_Label->show(); - ui->gyro_CB->setCurrentIndex(0); - ui->gyro_CB->show(); - ui->chStyle_CB->show(); - ui->chStyle_CB->setCurrentIndex(0); - ui->chassign_Label->show(); - ui->planeButton->setEnabled(true); - ui->heliButton->setDisabled(true); - ui->gliderButton->setEnabled(true); - ui->deltaButton->setEnabled(true); - wingsLock=false; - tailLock=false; - resetControls(); - ConfigChanged(); - tailConfigChanged(); -} - -void modelConfigDialog::on_gliderButton_clicked() -{ - ui->planeButton->setStyleSheet(""); - ui->heliButton->setStyleSheet(""); - ui->gliderButton->setStyleSheet("background-color: #007f00; color: white;"); - ui->deltaButton->setStyleSheet(""); - ModelType=2; - wingsLock=true; - tailLock=true; - ui->rudder_Label->hide(); - ui->rudder_CB->setCurrentIndex(0); - ui->rudder_CB->hide(); - ui->spLabel->hide(); - ui->sp_Label->hide(); - ui->swashType_CB->setCurrentIndex(0); - ui->swashType_CB->hide(); - ui->gyroType_Label->hide(); - ui->gyro_CB->setCurrentIndex(0); - ui->gyro_CB->hide(); - ui->chStyle_CB->hide(); - ui->chStyle_CB->setCurrentIndex(0); - ui->chassign_Label->hide(); - ui->wingLabel->show(); - ui->engine_Label->show(); - ui->engine_CB->setCurrentIndex(0); - ui->engine_CB->show(); - ui->ailType_Label->show(); - ui->ailType_CB->show(); - ui->ailType_CB->setCurrentIndex(0); - ui->tailLabel->show(); - ui->tailType_Label->show(); - ui->tailType_CB->show(); - ui->tailType_CB->setCurrentIndex(0); - ui->flapsType_Label->show(); - ui->flapsType_CB->show(); - ui->flapsType_CB->setCurrentIndex(0); - ui->flapsType_CB->setDisabled(true); - ui->spoilersLabel->show(); - ui->spoilersType_CB->setCurrentIndex(0); - ui->spoilersType_CB->setDisabled(true); - ui->spoilersType_CB->show(); - ui->planeButton->setEnabled(true); - ui->heliButton->setEnabled(true); - ui->gliderButton->setDisabled(true); - ui->deltaButton->setEnabled(true); - wingsLock=false; - tailLock=false; - resetControls(); - ConfigChanged(); - tailConfigChanged(); -} - -void modelConfigDialog::on_deltaButton_clicked() -{ - ui->planeButton->setStyleSheet(""); - ui->heliButton->setStyleSheet(""); - ui->gliderButton->setStyleSheet(""); - ui->deltaButton->setStyleSheet("background-color: #007f00; color: white;"); - ModelType=3; - wingsLock=true; - tailLock=true; - ui->spLabel->hide(); - ui->sp_Label->hide(); - ui->swashType_CB->setCurrentIndex(0); - ui->swashType_CB->hide(); - ui->gyroType_Label->hide(); - ui->gyro_CB->setCurrentIndex(0); - ui->gyro_CB->hide(); - ui->chStyle_CB->hide(); - ui->chStyle_CB->setCurrentIndex(0); - ui->chassign_Label->hide(); - ui->ailType_Label->hide(); - ui->ailType_CB->hide(); - ui->ailType_CB->setCurrentIndex(0); - ui->tailLabel->hide(); - ui->tailType_Label->hide(); - ui->tailType_CB->hide(); - ui->tailType_CB->setCurrentIndex(0); - ui->spoilersLabel->hide(); - ui->spoilersType_CB->setCurrentIndex(0); - ui->spoilersType_CB->hide(); - ui->engine_Label->show(); - ui->engine_CB->setCurrentIndex(0); - ui->engine_CB->show(); - ui->rudder_Label->show(); - ui->rudder_CB->setCurrentIndex(0); - ui->rudder_CB->show(); - ui->wingLabel->show(); - ui->flapsType_Label->show(); - ui->flapsType_CB->show(); - ui->flapsType_CB->setCurrentIndex(0); - ui->flapsType_CB->setEnabled(true); - ui->planeButton->setEnabled(true); - ui->heliButton->setEnabled(true); - ui->gliderButton->setEnabled(true); - ui->deltaButton->setDisabled(true); - wingsLock=false; - tailLock=false; - resetControls(); - ConfigChanged(); -} - - -void modelConfigDialog::formSetup() -{ - on_planeButton_clicked(); -} - -void modelConfigDialog::resetControls() { - ailerons=0; - rudders=0; - throttle=0; - elevators=0; - spoilers=0; - flaps=0; -} - - -void modelConfigDialog::shrink() -{ - resize(0,0); -} - -void modelConfigDialog::doAction(QAbstractButton *button) -{ - if ( ui->buttonBox->buttonRole(button) == QDialogButtonBox::ApplyRole) { - int res = QMessageBox::question(this,tr("Apply configuration ?"),tr("Apply configuration deleting existing model ?"),QMessageBox::Yes | QMessageBox::No); - if(res==QMessageBox::Yes) { - uint64_t tmp=0; - tmp=ModelType; - tmp <<=2; - tmp |= ui->engine_CB->currentIndex(); - tmp <<=2; - tmp |= ui->ailType_CB->currentIndex(); - tmp <<=2; - tmp |= ui->flapsType_CB->currentIndex(); - tmp <<=2; - tmp |= ui->spoilersType_CB->currentIndex(); - tmp <<=2; - tmp |= ui->rudder_CB->currentIndex(); - tmp <<=3; - tmp |= ui->swashType_CB->currentIndex(); - tmp <<=2; - tmp |= ui->tailType_CB->currentIndex(); - tmp <<=2; - tmp |= ui->gyro_CB->currentIndex(); - tmp <<=2; - tmp |= ui->chStyle_CB->currentIndex(); - if (ui->as_CB->isChecked()) { - tmp <<=4; - tmp |= ui->asail2_CB->currentIndex(); - tmp <<=4; - tmp |= ui->asele2_CB->currentIndex(); - tmp <<=4; - tmp |= ui->asrud2_CB->currentIndex(); - tmp <<=4; - tmp |= ui->asfla1_CB->currentIndex(); - tmp <<=4; - tmp |= ui->asfla2_CB->currentIndex(); - tmp <<=4; - tmp |= ui->asspo1_CB->currentIndex(); - tmp <<=4; - tmp |= ui->asspo2_CB->currentIndex(); - } else { - tmp <<=28; - } - *result=tmp; - } - } - this->close(); -} - -void modelConfigDialog::asUpdate() -{ - if (rxLock==true) - return; - rxLock=true; - QVariant v(1 | 32); - int i; - //disable default channels used - for (i=0; i<4; i++ ) { - if (rx[i]) { - ui->asail2_CB->setItemData(i+1,false, Qt::UserRole - 1); - ui->asele2_CB->setItemData(i+1,false, Qt::UserRole - 1); - ui->asrud2_CB->setItemData(i+1,false, Qt::UserRole - 1); - ui->asfla1_CB->setItemData(i+1,false, Qt::UserRole - 1); - ui->asfla2_CB->setItemData(i+1,false, Qt::UserRole - 1); - ui->asspo1_CB->setItemData(i+1,false, Qt::UserRole - 1); - ui->asspo2_CB->setItemData(i+1,false, Qt::UserRole - 1); - } else { - ui->asail2_CB->setItemData(i+1,v, Qt::UserRole-1); - ui->asele2_CB->setItemData(i+1,v, Qt::UserRole-1); - ui->asrud2_CB->setItemData(i+1,v, Qt::UserRole-1); - ui->asfla1_CB->setItemData(i+1,v, Qt::UserRole-1); - ui->asfla2_CB->setItemData(i+1,v, Qt::UserRole-1); - ui->asspo1_CB->setItemData(i+1,v, Qt::UserRole-1); - ui->asspo2_CB->setItemData(i+1,v, Qt::UserRole-1); - } - } - for (i=4; iasail2_CB->setItemData(i+1,v, Qt::UserRole-1); - ui->asele2_CB->setItemData(i+1,v, Qt::UserRole-1); - ui->asrud2_CB->setItemData(i+1,v, Qt::UserRole-1); - ui->asfla1_CB->setItemData(i+1,v, Qt::UserRole-1); - ui->asfla2_CB->setItemData(i+1,v, Qt::UserRole-1); - ui->asspo1_CB->setItemData(i+1,v, Qt::UserRole-1); - ui->asspo2_CB->setItemData(i+1,v, Qt::UserRole-1); - } - - i=ui->asail2_CB->currentIndex(); - if (i>0) { - ui->asele2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asrud2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asfla1_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asfla2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asspo1_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asspo2_CB->setItemData(i,false, Qt::UserRole - 1); - } - i=ui->asrud2_CB->currentIndex(); - if (i>0) { - ui->asail2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asele2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asfla1_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asfla2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asspo1_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asspo2_CB->setItemData(i,false, Qt::UserRole - 1); - } - i=ui->asele2_CB->currentIndex(); - if (i>0) { - ui->asail2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asrud2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asfla1_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asfla2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asspo1_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asspo2_CB->setItemData(i,false, Qt::UserRole - 1); - } - i=ui->asfla1_CB->currentIndex(); - if (i>0) { - ui->asail2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asele2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asrud2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asfla2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asspo1_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asspo2_CB->setItemData(i,false, Qt::UserRole - 1); - } - i=ui->asfla2_CB->currentIndex(); - if (i>0) { - ui->asail2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asele2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asrud2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asfla1_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asspo1_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asspo2_CB->setItemData(i,false, Qt::UserRole - 1); - } - i=ui->asspo1_CB->currentIndex(); - if (i>0) { - ui->asail2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asele2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asrud2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asfla1_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asfla2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asspo2_CB->setItemData(i,false, Qt::UserRole - 1); - } - i=ui->asspo2_CB->currentIndex(); - if (i>0) { - ui->asail2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asele2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asrud2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asfla1_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asfla2_CB->setItemData(i,false, Qt::UserRole - 1); - ui->asspo1_CB->setItemData(i,false, Qt::UserRole - 1); - } - - if (ailerons>1 && ui->as_CB->isChecked()) { - ui->asail2_label->show(); - ui->asail2_CB->show(); - } else { - ui->asail2_label->hide(); - ui->asail2_CB->hide(); - } - if (elevators>1 && ui->as_CB->isChecked()) { - ui->asele2_label->show(); - ui->asele2_CB->show(); - } else { - ui->asele2_label->hide(); - ui->asele2_CB->hide(); - } - if (rudders>1 && ui->as_CB->isChecked()) { - ui->asrud2_label->show(); - ui->asrud2_CB->show(); - } else { - ui->asrud2_label->hide(); - ui->asrud2_CB->hide(); - } - if (flaps>0 && ui->as_CB->isChecked()) { - ui->asfla1_label->show(); - ui->asfla1_CB->show(); - } else { - ui->asfla1_label->hide(); - ui->asfla1_CB->hide(); - } - if (flaps>1 && ui->as_CB->isChecked()) { - ui->asfla2_label->show(); - ui->asfla2_CB->show(); - } else { - ui->asfla2_label->hide(); - ui->asfla2_CB->hide(); - } - if (spoilers>0 && ui->as_CB->isChecked()) { - ui->asspo1_label->show(); - ui->asspo1_CB->show(); - } else { - ui->asspo1_label->hide(); - ui->asspo1_CB->hide(); - } - if (spoilers>1 && ui->as_CB->isChecked()) { - ui->asspo2_label->show(); - ui->asspo2_CB->show(); - } else { - ui->asspo2_label->hide(); - ui->asspo2_CB->hide(); - } - rxLock=false; -} diff --git a/companion/src/modelconfigdialog.h b/companion/src/modelconfigdialog.h deleted file mode 100644 index f8f508c71..000000000 --- a/companion/src/modelconfigdialog.h +++ /dev/null @@ -1,59 +0,0 @@ -#ifndef MODELCONFIGDIALOG_H -#define MODELCONFIGDIALOG_H -#include "eeprominterface.h" -#include -#include - - -namespace Ui { - class modelConfigDialog; -} - -class modelConfigDialog : public QDialog { - Q_OBJECT -public: - modelConfigDialog(RadioData &radioData, uint64_t * result, QWidget *parent = 0); - ~modelConfigDialog(); - -private: - Ui::modelConfigDialog *ui; - bool wingsLock; - bool tailLock; - bool rxLock; - int ModelType; - RadioData &radioData; - uint64_t * result; - GeneralSettings generalSettings; - QStringList ruddercolor; - QStringList aileroncolor; - QStringList elevatorcolor; - QStringList throttlecolor; - QStringList flapscolor; - QStringList airbrakecolor; - QStringList helicolor; - bool rx[10]; - unsigned int ailerons; - unsigned int rudders; - unsigned int throttle; - unsigned int elevators; - unsigned int spoilers; - unsigned int flaps; - - - -private slots: - void ConfigChanged(); - void tailConfigChanged(); - void rxUpdate(); - void resetControls(); - void on_planeButton_clicked(); - void on_heliButton_clicked(); - void on_gliderButton_clicked(); - void on_deltaButton_clicked(); - void formSetup(); - void asUpdate(); - void shrink(); - void doAction(QAbstractButton *button); -}; - -#endif // MODELCONFIGDIALOG_H diff --git a/companion/src/modelconfigdialog.ui b/companion/src/modelconfigdialog.ui deleted file mode 100644 index afa4dd0bd..000000000 --- a/companion/src/modelconfigdialog.ui +++ /dev/null @@ -1,1264 +0,0 @@ - - - modelConfigDialog - - - - 0 - 0 - 793 - 599 - - - - - 0 - 0 - - - - - 0 - 0 - - - - Model Configuration Wizard - - - - - - Engine - - - - - - - 0 - - - - - Qt::Vertical - - - - 400 - 20 - - - - - - - - - 0 - 0 - - - - - 400 - 200 - - - - QFrame::Panel - - - 0 - - - - - - :/images/mcw/aw0a0f.png - - - false - - - 0 - - - - - - - - 0 - 0 - - - - - 400 - 200 - - - - QFrame::Panel - - - 0 - - - - - - :/images/mcw/atailv.png - - - false - - - 0 - - - - - - - - - Qt::Vertical - - - - - - - - 18 - - - - Model Type - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - - 85 - 0 - - - - Airplane - - - - - - - :/images/mcw/aicon.png:/images/mcw/aicon.png - - - - 50 - 29 - - - - - - - - - 0 - 0 - - - - - 85 - 0 - - - - Helicopter - - - - - - - :/images/mcw/hicon.png:/images/mcw/hicon.png - - - - 50 - 29 - - - - - - - - - 85 - 0 - - - - Glider - - - - - - - :/images/mcw/gicon.png:/images/mcw/gicon.png - - - - 50 - 29 - - - - - - - - - 0 - 0 - - - - - 14 - 75 - true - - - - Wing - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - Aileron controls - - - - - - - - No Ailerons - - - - - 1 Servo (or Y) - - - - - 2 Servos - - - - - - - - - 0 - 0 - - - - Flaps controls - - - - - - - - No Flaps - - - - - 1 Servo (or inverting Y) - - - - - 2 Servos - - - - - - - - Spoilers - - - - - - - - No Spoilers/Airbrakes - - - - - 1 Servo (or Y or inverting Y) - - - - - 2 Servos - - - - - - - - - 0 - 0 - - - - - 14 - 75 - true - - - - Swash Plate - - - Qt::AlignCenter - - - - - - - Swash plate - - - - - - - - 90° / Fixed / Coax - - - - - 120° - - - - - 120X° - - - - - 140° - - - - - FlyBarLess - - - - - - - - - 0 - 0 - - - - - 14 - 75 - true - - - - Tail - - - Qt::AlignCenter - - - - - - - - 0 - 0 - - - - Tail controls - - - - - - - - 1 Servo Elevator / 1 Servo Rudder - - - - - V Tail - - - - - 2 Servos Elevator / 1 Servo Rudder - - - - - - - - Gyroscope - - - - - - - - NoGyro - - - - - Switch control - - - - - Pot control - - - - - - - - Channel style - - - - - - - - Open9x Style - - - - - Futaba Style - - - - - - - - 3 - - - - - QFrame::Panel - - - QFrame::Raised - - - 2 - - - Qt::AlignCenter - - - - - - - QFrame::Panel - - - QFrame::Raised - - - 3 - - - Qt::AlignCenter - - - - - - - QFrame::Panel - - - QFrame::Raised - - - 4 - - - Qt::AlignCenter - - - - - - - QFrame::Panel - - - QFrame::Raised - - - 5 - - - Qt::AlignCenter - - - - - - - QFrame::Panel - - - QFrame::Raised - - - 6 - - - Qt::AlignCenter - - - - - - - QFrame::Panel - - - QFrame::Raised - - - 7 - - - Qt::AlignCenter - - - - - - - QFrame::Panel - - - QFrame::Raised - - - 8 - - - Qt::AlignCenter - - - - - - - QFrame::Panel - - - QFrame::Raised - - - 9 - - - Qt::AlignCenter - - - - - - - QFrame::Panel - - - QFrame::Raised - - - 1 - - - Qt::AlignCenter - - - - - - - Qt::Vertical - - - - 20 - 0 - - - - - - - - QFrame::Panel - - - QFrame::Raised - - - 10 - - - Qt::AlignCenter - - - - - - - - - - - Qt::Vertical - - - QSizePolicy::Expanding - - - - 20 - 0 - - - - - - - - Ele2 - - - - - - - Use advanced controls - - - - - - - Spoiler2 - - - - - - - Flap2 - - - - - - - Flap1 - - - - - - - Rud2 - - - - - - - - AUTO - - - - - CH01 - - - - - CH02 - - - - - CH03 - - - - - CH04 - - - - - CH05 - - - - - CH06 - - - - - CH07 - - - - - CH08 - - - - - CH09 - - - - - CH10 - - - - - - - - Ail2 - - - - - - - Spoiler 1 - - - - - - - Qt::Horizontal - - - QDialogButtonBox::Apply|QDialogButtonBox::Cancel - - - false - - - - - - - - AUTO - - - - - CH01 - - - - - CH02 - - - - - CH03 - - - - - CH04 - - - - - CH05 - - - - - CH06 - - - - - CH07 - - - - - CH08 - - - - - CH09 - - - - - CH10 - - - - - - - - - AUTO - - - - - CH01 - - - - - CH02 - - - - - CH03 - - - - - CH04 - - - - - CH05 - - - - - CH06 - - - - - CH07 - - - - - CH08 - - - - - CH09 - - - - - CH10 - - - - - - - - - AUTO - - - - - CH01 - - - - - CH02 - - - - - CH03 - - - - - CH04 - - - - - CH05 - - - - - CH06 - - - - - CH07 - - - - - CH08 - - - - - CH09 - - - - - CH10 - - - - - - - - - AUTO - - - - - CH01 - - - - - CH02 - - - - - CH03 - - - - - CH04 - - - - - CH05 - - - - - CH06 - - - - - CH07 - - - - - CH08 - - - - - CH09 - - - - - CH10 - - - - - - - - - AUTO - - - - - CH01 - - - - - CH02 - - - - - CH03 - - - - - CH04 - - - - - CH05 - - - - - CH06 - - - - - CH07 - - - - - CH08 - - - - - CH09 - - - - - CH10 - - - - - - - - - AUTO - - - - - CH01 - - - - - CH02 - - - - - CH03 - - - - - CH04 - - - - - CH05 - - - - - CH06 - - - - - CH07 - - - - - CH08 - - - - - CH09 - - - - - CH10 - - - - - - - - - - - 85 - 0 - - - - Delta wing - - - - - - - :/images/mcw/dicon.png:/images/mcw/dicon.png - - - - 50 - 29 - - - - - - - - - Not present - - - - - Present - - - - - - - - Rudder - - - - - - - - Not present - - - - - Single rudder - - - - - Dual rudder (with 2 servos) - - - - - - - - - - - diff --git a/companion/src/modelslist.cpp b/companion/src/modelslist.cpp index 088945f12..19300c5f8 100644 --- a/companion/src/modelslist.cpp +++ b/companion/src/modelslist.cpp @@ -105,12 +105,12 @@ void ModelsListWidget::ShowContextMenu(const QPoint& pos) void ModelsListWidget::OpenEditWindow() { - ((MdiChild *)parent())->OpenEditWindow(false); + ((MdiChild *)parent())->OpenEditWindow(); } void ModelsListWidget::OpenWizard() { - ((MdiChild *)parent())->OpenEditWindow(true); + ((MdiChild *)parent())->openWizard(); } void ModelsListWidget::LoadBackup() @@ -229,6 +229,7 @@ void ModelsListWidget::dropEvent(QDropEvent *event) // QMessageBox::warning(this, tr("Companion"),tr("Index :%1").arg(row)); const QMimeData *mimeData = event->mimeData(); + if(mimeData->hasFormat("application/x-companion")) { QByteArray gmData = mimeData->data("application/x-companion"); diff --git a/companion/src/wizarddialog.cpp b/companion/src/wizarddialog.cpp new file mode 100644 index 000000000..996e455c6 --- /dev/null +++ b/companion/src/wizarddialog.cpp @@ -0,0 +1,416 @@ +#include +#include "wizarddialog.h" + +WizardDialog::WizardDialog(QWidget *parent) + : QWizard(parent) +{ + setWindowTitle(tr("Model Wizard")); + + setPage(Page_Models, new ModelSelectionPage(this, "models",tr("Model Type"),tr("Enter model name and model type."))); + setPage(Page_Throttle, new ThrottlePage(this, "throttle",tr("Throttle"),tr("Has your model got a motor or an engine?"), Page_Wingtypes)); + setPage(Page_Wingtypes, new WingtypeSelectionPage(this, "wingtype",tr("Wing Type"),tr("Is your model a flying wing/deltawing or has it a standard wing configuration?"))); + setPage(Page_Ailerons, new AileronsPage(this, "ailerons",tr("Ailerons"),tr("Has your model got ailerons?"), Page_Flaps)); + setPage(Page_Flaps, new FlapsPage(this, "flaps",tr("Flaps"),tr("Has your model got flaps?"), Page_Airbrakes)); + setPage(Page_Airbrakes, new AirbreaksPage(this, "airbrakes",tr("Airbrakes"),tr("Has your model got airbrakes?"), Page_Tails)); + setPage(Page_Bank, new BankPage(this, "bank",tr("Flying-wing / Delta-wing"),tr("Are the elevons controlled by servos connected to separate channels or by a single servo channel?"), Page_Rudder)); + setPage(Page_Rudder, new RudderPage(this, "rudder",tr("Rudder"),tr("Does your model have a rudder?"), Page_Conclusion)); + setPage(Page_Tails, new TailSelectionPage(this, "tails",tr("Tail Type"),tr("Select which type of tail your model is equiped with."))); + setPage(Page_Tail, new TailPage(this, "tail",tr("Tail"),tr("Select channels for tail control."), Page_Conclusion)); + setPage(Page_Simpletail, new SimpleTailPage(this, "simpletail",tr("Tail"),tr("Select elevator channel."), Page_Conclusion)); + setPage(Page_Cyclic, new CyclicPage(this, "cyclic",tr("Cyclic"),tr("Which type of swash control is installed in your helicopter?"), Page_Gyro)); + setPage(Page_Gyro, new GyroPage(this, "gyro",tr("Tail Gyro"),tr("Has your helicopter got an adjustable gyro for the tail?"), Page_Flybar)); + setPage(Page_Flybar, new FlybarSelectionPage(this, "flybar",tr("Rotor Type"),tr("Has your helicopter got a flybar?"))); + setPage(Page_Fblheli, new FblPage(this, "fblheli",tr("Helicopter"),tr("Select the controls for your helicopter"), Page_Conclusion)); + setPage(Page_Helictrl, new HeliPage(this, "helictrl",tr("Helicopter"),tr("Select the controls for your helicopter"), Page_Conclusion)); + setPage(Page_Multirotor, new MultirotorPage(this, "multirotor",tr("Multirotor"),tr("Select the control channels for your multirotor"), Page_Conclusion)); + setPage(Page_Conclusion, new ConclusionPage(this, "conclusion",tr("Save Changes"),tr( + "Your model should now be set up. You now have to manually check the direction of each control surface and reverse the channels that " + "make controls move in the wrong direction.

Remove the propeller/propellers before you try to control your model for the first time.

" + "Please note that continuing removes all old model settings!"), -1)); + + setStartId(Page_Models); + +#ifndef Q_WS_MAC + setWizardStyle(ModernStyle); +#endif + setOption(HaveHelpButton, true); + connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp())); +} + +void WizardDialog::showHelp() +{ + QString message; + + switch (currentId()) { + case Page_Models: message = tr("Select the type of model you want to create settings for."); break; + case Page_Throttle: message = tr("Select the receiver channel that is connected to your ESC or throttle servo."); break; + case Page_Wingtypes: message = tr("The wing control surfaces of flying wings and delta winged aircraft are called elevons and are used for controlling both elevation and roll. " + "These aircrafts do not have a tail with control surfaces"); break; + case Page_Ailerons: message = tr("One or two channels are used to control the Ailerons. " + "If your servos are connected by a common Y-cable you should select the single-servo option."); break; + case Page_Flaps: message = tr("This wizard assumes that your flaps are controlled by a switch. " + "If your flaps are controlled by a potentiometer you can change that manually later." + "Just select the correct receiver channel and an arbitrary switch."); break; + case Page_Airbrakes: message = tr("Air brakes are used to reduce the speed of advanced sail planes. " + "It is very uncommon on other types of planes."); break; + case Page_Bank: message = tr("Please note that, even if the elevons are controlled by separate servos, " + "these may be controlled by a common channel."); break; + case Page_Rudder: message = tr("TBD."); break; + case Page_Tails: message = tr("Select the tail type of your plane."); break; + case Page_Tail: message = tr("TBD."); break; + case Page_Simpletail: message = tr("TBD."); break; + case Page_Flybar: message = tr("TBD."); break; + case Page_Cyclic: message = tr("TBD."); break; + case Page_Gyro: message = tr("TBD."); break; + case Page_Fblheli: message = tr("TBD."); break; + case Page_Helictrl: message = tr("TBD."); break; + case Page_Multirotor: message = tr("TBD."); break; + case Page_Conclusion: message = tr("TBD."); break; + default: message = tr("Move on. Nothin to see here."); + } + QMessageBox::information(this, tr("Model Wizard Help"), message); +} + +StandardPage::StandardPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage) + : QWizardPage() +{ + pageFollower = nextPage; + wizardDialog = dlg; + + setTitle(title); + setPixmap(QWizard::WatermarkPixmap, QPixmap(QString(":/images/wizard/") + image + QString(".png"))); + topLabel = new QLabel(text+"
"); + topLabel->setWordWrap(true); + + QVBoxLayout *layout = new QVBoxLayout; + layout->addWidget(topLabel); + setLayout(layout); +} + +int StandardPage::nextId() const +{ + return pageFollower; +} + +ModelSelectionPage::ModelSelectionPage(WizardDialog *dlg, QString image, QString title, QString text) + : StandardPage(dlg, image, title, text) +{ + nameLineEdit = new QLineEdit; + planeRB = new QRadioButton(tr("Plane")); + planeRB->setChecked(true); + multirotorRB = new QRadioButton(tr("Multirotor")); + helicopterRB = new QRadioButton(tr("Helicopter")); + + registerField("evaluate.name*", nameLineEdit); + + QLayout *l = layout(); + l->addWidget(new QLabel(tr("Model Name:"))); + l->addWidget(nameLineEdit); + l->addWidget(new QLabel("")); + l->addWidget(new QLabel(tr("Model Type:"))); + l->addWidget(planeRB); + l->addWidget(multirotorRB); + l->addWidget(helicopterRB); +} + +int ModelSelectionPage::nextId() const +{ + if (helicopterRB->isChecked()) + return WizardDialog::Page_Cyclic; + else if (multirotorRB->isChecked()) + return WizardDialog::Page_Multirotor; + else + return WizardDialog::Page_Throttle; +} + +WingtypeSelectionPage::WingtypeSelectionPage(WizardDialog *dlg, QString image, QString title, QString text) + : StandardPage(dlg, image, title, text) +{ + standardWingRB = new QRadioButton(tr("Standard Wing")); + standardWingRB->setChecked(true); + deltaWingRB = new QRadioButton(tr("Flying Wing / Deltawing")); + + QLayout *l = layout(); + l->addWidget(standardWingRB); + l->addWidget(deltaWingRB); +} + +int WingtypeSelectionPage::nextId() const +{ + if (deltaWingRB->isChecked()) + return WizardDialog::Page_Bank; + else + return WizardDialog::Page_Ailerons; +} + +TailSelectionPage::TailSelectionPage(WizardDialog *dlg, QString image, QString title, QString text) + : StandardPage(dlg, image, title, text) +{ + standardTailRB = new QRadioButton(tr("Elevator and Rudder")); + standardTailRB->setChecked(true); + simpleTailRB = new QRadioButton(tr("Only Elevator")); + vTailRB = new QRadioButton(tr("V-tail")); + + QLayout *l = layout(); + l->addWidget(new QLabel(tr("Tail Type:"))); + l->addWidget(standardTailRB); + l->addWidget(simpleTailRB); + l->addWidget(vTailRB); +} + +int TailSelectionPage::nextId() const +{ + if (simpleTailRB->isChecked()) + return WizardDialog::Page_Simpletail; + else + return WizardDialog::Page_Tail; +} + +FlybarSelectionPage::FlybarSelectionPage(WizardDialog *dlg, QString image, QString title, QString text) + : StandardPage(dlg, image, title, text) +{ + flybarRB = new QRadioButton(tr("Has Flybar")); + flybarRB->setChecked(true); + noFlybarRB = new QRadioButton(tr("Flybarless")); + + QLayout *l = layout(); + l->addWidget(new QLabel(tr("Flybar:"))); + l->addWidget(flybarRB); + l->addWidget(noFlybarRB); +} + +int FlybarSelectionPage::nextId() const +{ + if (flybarRB->isChecked()) + return WizardDialog::Page_Helictrl; + else + return WizardDialog::Page_Fblheli; +} + +ThrottlePage::ThrottlePage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage) + : StandardPage(dlg, image, title, text, nextPage) +{ + motorRB = new QRadioButton(tr("Yes")); + noMotorRB = new QRadioButton(tr("No")); + motorRB->setChecked(true); + throttleCB = new QComboBox(); + + QLayout *l = layout(); + l->addWidget(motorRB); + l->addWidget(noMotorRB); + l->addWidget(new QLabel(tr("
Throttle Channel:"))); + l->addWidget(throttleCB); +} + +AileronsPage::AileronsPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage) + : StandardPage(dlg, image, title, text, nextPage) +{ + noAileronsRB = new QRadioButton(tr("No")); + oneAileronRB = new QRadioButton(tr("Yes, controlled by a single channel")); + twoAileronsRB = new QRadioButton(tr("Yes, controlled by two channels")); + noAileronsRB->setChecked(true); + aileron1CB = new QComboBox(); + aileron2CB = new QComboBox(); + + QLayout *l = layout(); + l->addWidget(noAileronsRB); + l->addWidget(oneAileronRB); + l->addWidget(twoAileronsRB); + l->addWidget(new QLabel(tr("
First Aileron Channel:"))); + l->addWidget(aileron1CB); + l->addWidget(new QLabel(tr("Second Aileron Channel:"))); + l->addWidget(aileron2CB); +} + +FlapsPage::FlapsPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage) + : StandardPage(dlg, image, title, text, nextPage) +{ + noFlapsRB = new QRadioButton(tr("No")); + oneFlapRB = new QRadioButton(tr("Yes, controlled by a single channel")); + twoFlapsRB = new QRadioButton(tr("Yes, controlled by two channels")); + noFlapsRB->setChecked(true); + flap1CB = new QComboBox(); + flap2CB = new QComboBox(); + + QLayout *l = layout(); + l->addWidget(noFlapsRB); + l->addWidget(oneFlapRB); + l->addWidget(twoFlapsRB); + l->addWidget(new QLabel(tr("
First Flap Channel:"))); + l->addWidget(flap1CB); + l->addWidget(new QLabel(tr("Second Flap Channel:"))); + l->addWidget(flap2CB); +} + +AirbreaksPage::AirbreaksPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage) + : StandardPage(dlg, image, title, text, nextPage) +{ + noAirbreaksRB = new QRadioButton(tr("No")); + oneAirbreakRB = new QRadioButton(tr("Yes, controlled by a single channel")); + twoAirbreaksRB = new QRadioButton(tr("Yes, controlled by two channels")); + noAirbreaksRB->setChecked(true); + airbreak1CB = new QComboBox(); + airbreak2CB = new QComboBox(); + + QLayout *l = layout(); + l->addWidget(noAirbreaksRB); + l->addWidget(oneAirbreakRB); + l->addWidget(twoAirbreaksRB); + l->addWidget(new QLabel(tr("
First Airbreak Channel:"))); + l->addWidget(airbreak1CB); + l->addWidget(new QLabel(tr("Second Airbreak Channel:"))); + l->addWidget(airbreak2CB); +} + +BankPage::BankPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage) + : StandardPage(dlg, image, title, text, nextPage) +{ + oneElevonChRB = new QRadioButton(tr("One")); + oneElevonChRB->setChecked(true); + twoElevonsChRB = new QRadioButton(tr("Two")); + elevon1CB = new QComboBox(); + elevon2CB = new QComboBox(); + + QLayout *l = layout(); + l->addWidget(oneElevonChRB); + l->addWidget(twoElevonsChRB); + l->addWidget(new QLabel(tr("
First Elevon Channel:"))); + l->addWidget(elevon1CB); + l->addWidget(new QLabel(tr("Second Elevon Channel:"))); + l->addWidget(elevon2CB); +} +RudderPage::RudderPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage) + : StandardPage(dlg, image, title, text, nextPage) +{ + noRudderRB = new QRadioButton(tr("No")); + noRudderRB->setChecked(true); + hasRudderRB = new QRadioButton(tr("Yes")); + rudderCB = new QComboBox(); + + QLayout *l = layout(); + l->addWidget(noRudderRB); + l->addWidget(hasRudderRB); + l->addWidget(new QLabel(tr("
Rudder Channel:"))); + l->addWidget(rudderCB); +} + +TailPage::TailPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage) + : StandardPage(dlg, image, title, text, nextPage) +{ + elevatorCB = new QComboBox(); + rudderCB = new QComboBox(); + + QLayout *l = layout(); + l->addWidget(new QLabel(tr("Rudder Channel:"))); + l->addWidget(rudderCB); + l->addWidget(new QLabel(tr("Elevator Channel:"))); + l->addWidget(elevatorCB); +} + +SimpleTailPage::SimpleTailPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage) + : StandardPage(dlg, image, title, text, nextPage) +{ + elevatorCB = new QComboBox(); + + QLayout *l = layout(); + l->addWidget(new QLabel(tr("Elevator Channel:"))); + l->addWidget(elevatorCB); +} + +CyclicPage::CyclicPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage) + : StandardPage(dlg, image, title, text, nextPage) +{ + cyclic90RB = new QRadioButton(tr("90")); + cyclic90RB->setChecked(true); + cyclic120RB = new QRadioButton(tr("120")); + cyclic120XRB = new QRadioButton(tr("120x")); + cyclic140RB = new QRadioButton(tr("140")); + + QLayout *l = layout(); + l->addWidget(cyclic90RB); + l->addWidget(cyclic120RB); + l->addWidget(cyclic120XRB); + l->addWidget(cyclic140RB); +} + +GyroPage::GyroPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage) + : StandardPage(dlg, image, title, text, nextPage) +{ + noGyroRB = new QRadioButton(tr("No")); + noGyroRB->setChecked(true); + switchGyroRB = new QRadioButton(tr("Yes, controled by a switch")); + potGyroRB = new QRadioButton(tr("Yes, controlled by a pot")); + + QLayout *l = layout(); + l->addWidget(noGyroRB); + l->addWidget(switchGyroRB); + l->addWidget(potGyroRB); +} + +FblPage::FblPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage) + : StandardPage(dlg, image, title, text, nextPage) +{ + throttleCB = new QComboBox(); + yawCB = new QComboBox(); + pitchCB = new QComboBox(); + rollCB = new QComboBox(); + + QLayout *l = layout(); + l->addWidget(new QLabel(tr("Trottle Channel:"))); + l->addWidget(throttleCB); + l->addWidget(new QLabel(tr("Yaw Channel:"))); + l->addWidget(yawCB); + l->addWidget(new QLabel(tr("Pitch Channel:"))); + l->addWidget(pitchCB); + l->addWidget(new QLabel(tr("Roll Channel:"))); + l->addWidget(rollCB); +} + +HeliPage::HeliPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage) + : StandardPage(dlg, image, title, text, nextPage) +{ + throttleCB = new QComboBox(); + yawCB = new QComboBox(); + pitchCB = new QComboBox(); + rollCB = new QComboBox(); + + QLayout *l = layout(); + l->addWidget(new QLabel(tr("Trottle Channel:"))); + l->addWidget(throttleCB); + l->addWidget(new QLabel(tr("Yaw Channel:"))); + l->addWidget(yawCB); + l->addWidget(new QLabel(tr("Pitch Channel:"))); + l->addWidget(pitchCB); + l->addWidget(new QLabel(tr("Roll Channel:"))); + l->addWidget(rollCB); +} + +MultirotorPage::MultirotorPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage) + : StandardPage(dlg, image, title, text, nextPage) +{ + throttleCB = new QComboBox(); + yawCB = new QComboBox(); + pitchCB = new QComboBox(); + rollCB = new QComboBox(); + + QLayout *l = layout(); + l->addWidget(new QLabel(tr("Trottle Channel:"))); + l->addWidget(throttleCB); + l->addWidget(new QLabel(tr("Yaw Channel:"))); + l->addWidget(yawCB); + l->addWidget(new QLabel(tr("Pitch Channel:"))); + l->addWidget(pitchCB); + l->addWidget(new QLabel(tr("Roll Channel:"))); + l->addWidget(rollCB); +} + +ConclusionPage::ConclusionPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage) + : StandardPage(dlg, image, title, text, nextPage) +{ + proceedCB = new QCheckBox(tr("OK, I understand.")); + registerField("evaluate.proceed*", proceedCB); + + QLayout *l = layout(); + l->addWidget(proceedCB); +} + diff --git a/companion/src/wizarddialog.h b/companion/src/wizarddialog.h new file mode 100644 index 000000000..09a80c72f --- /dev/null +++ b/companion/src/wizarddialog.h @@ -0,0 +1,249 @@ +#ifndef WIZARDDIALOG_H +#define WIZARDDIALOG_H + +#include + +QT_BEGIN_NAMESPACE +class QCheckBox; +class QLabel; +class QLineEdit; +class QRadioButton; +class QComboBox; +QT_END_NAMESPACE + + +class WizardDialog : public QWizard +{ + Q_OBJECT + +public: + enum { Page_Models, Page_Throttle, Page_Wingtypes, Page_Ailerons, Page_Flaps, + Page_Airbrakes, Page_Bank, Page_Rudder, Page_Tails, Page_Tail, + Page_Simpletail, Page_Cyclic, Page_Gyro, Page_Flybar, + Page_Fblheli, Page_Helictrl, Page_Multirotor, + Page_Conclusion }; + + WizardDialog(QWidget *parent = 0); + +private slots: + void showHelp(); +}; + +class StandardPage: public QWizardPage +{ + Q_OBJECT +public: + StandardPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); + WizardDialog *wizardDialog; +private: + QLabel *topLabel; + int pageFollower; + int nextId() const; +}; + +class ModelSelectionPage: public StandardPage +{ + Q_OBJECT +public: + ModelSelectionPage(WizardDialog *dlg, QString image, QString title, QString text); +private: + QLineEdit *nameLineEdit; + QRadioButton *planeRB; + QRadioButton *multirotorRB; + QRadioButton *helicopterRB; + int nextId() const; +}; + +class WingtypeSelectionPage: public StandardPage +{ + Q_OBJECT +public: + WingtypeSelectionPage(WizardDialog *dlg, QString image, QString title, QString text); +private: + QRadioButton *deltaWingRB; + QRadioButton *standardWingRB; + int nextId() const; +}; + +class TailSelectionPage: public StandardPage +{ + Q_OBJECT +public: + TailSelectionPage(WizardDialog *dlg, QString image, QString title, QString text); +private: + QRadioButton *vTailRB; + QRadioButton *standardTailRB; + QRadioButton *simpleTailRB; + int nextId() const; +}; + +class FlybarSelectionPage: public StandardPage +{ + Q_OBJECT +public: + FlybarSelectionPage(WizardDialog *dlg, QString image, QString title, QString text); +private: + QRadioButton *flybarRB; + QRadioButton *noFlybarRB; + int nextId() const; +}; + +class ThrottlePage: public StandardPage +{ + Q_OBJECT +public: + ThrottlePage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); +private: + QRadioButton *motorRB; + QRadioButton *noMotorRB; + QComboBox *throttleCB; +}; + +class AileronsPage: public StandardPage +{ + Q_OBJECT +public: + AileronsPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); +private: + QRadioButton *oneAileronRB; + QRadioButton *twoAileronsRB; + QRadioButton *noAileronsRB; + QComboBox *aileron1CB; + QComboBox *aileron2CB; +}; + +class FlapsPage: public StandardPage +{ + Q_OBJECT +public: + FlapsPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); +private: + QRadioButton *oneFlapRB; + QRadioButton *twoFlapsRB; + QRadioButton *noFlapsRB; + QComboBox *flap1CB; + QComboBox *flap2CB; +}; + +class AirbreaksPage: public StandardPage +{ + Q_OBJECT +public: + AirbreaksPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); +private: + QRadioButton *oneAirbreakRB; + QRadioButton *twoAirbreaksRB; + QRadioButton *noAirbreaksRB; + QComboBox *airbreak1CB; + QComboBox *airbreak2CB; +}; + +class BankPage: public StandardPage +{ + Q_OBJECT +public: + BankPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); +private: + QRadioButton *oneElevonChRB; + QRadioButton *twoElevonsChRB; + QComboBox *elevon1CB; + QComboBox *elevon2CB; +}; + +class RudderPage: public StandardPage +{ + Q_OBJECT +public: + RudderPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); +private: + QRadioButton *noRudderRB; + QRadioButton *hasRudderRB; + QComboBox *rudderCB; +}; + +class TailPage: public StandardPage +{ + Q_OBJECT +public: + TailPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); + QComboBox *elevatorCB; + QComboBox *rudderCB; +}; + +class SimpleTailPage: public StandardPage +{ + Q_OBJECT +public: + SimpleTailPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); + QComboBox *elevatorCB; +}; + +class CyclicPage: public StandardPage +{ + Q_OBJECT +public: + CyclicPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); +private: + QRadioButton *cyclic90RB; + QRadioButton *cyclic120RB; + QRadioButton *cyclic120XRB; + QRadioButton *cyclic140RB; +}; + +class GyroPage: public StandardPage +{ + Q_OBJECT +public: + GyroPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); +private: + QRadioButton *noGyroRB; + QRadioButton *switchGyroRB; + QRadioButton *potGyroRB; +}; + +class FblPage: public StandardPage +{ + Q_OBJECT +public: + FblPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); +private: + QComboBox *throttleCB; + QComboBox *yawCB; + QComboBox *pitchCB; + QComboBox *rollCB; +}; + +class HeliPage: public StandardPage +{ + Q_OBJECT +public: + HeliPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); +private: + QComboBox *throttleCB; + QComboBox *yawCB; + QComboBox *pitchCB; + QComboBox *rollCB; +}; + +class MultirotorPage: public StandardPage +{ + Q_OBJECT +public: + MultirotorPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); +private: + QComboBox *throttleCB; + QComboBox *yawCB; + QComboBox *pitchCB; + QComboBox *rollCB; +}; + +class ConclusionPage: public StandardPage +{ + Q_OBJECT +public: + ConclusionPage(WizardDialog *dlg, QString image, QString title, QString text, int nextPage=-1); +private: + QCheckBox *proceedCB; +}; + +#endif // WIZARDDIALOG_H