From a4d2582cec79e835c4550ee12de2138500d2d25c Mon Sep 17 00:00:00 2001 From: Fredrik Larson Date: Tue, 26 Aug 2014 12:44:11 +1000 Subject: [PATCH] Move Config plugin for fixed wings back to oly Aileron type per Eric --- .../configfixedwingwidget.cpp | 30 +++++-------------- .../config/configvehicletypewidget.cpp | 5 ++-- .../setupwizard/pages/fixedwingpage.cpp | 2 +- .../plugins/setupwizard/wizardResources.qrc | 1 + 4 files changed, 11 insertions(+), 27 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configfixedwingwidget.cpp b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configfixedwingwidget.cpp index 9b613fb5d..948d99dfa 100644 --- a/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configfixedwingwidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/cfg_vehicletypes/configfixedwingwidget.cpp @@ -53,11 +53,11 @@ ConfigFixedWingWidget::ConfigFixedWingWidget(QWidget *parent) : populateChannelComboBoxes(); QStringList fixedWingTypes; - fixedWingTypes << "Aileron Dual Servo" << "Aileron Single Servo" << "Elevon"; + fixedWingTypes << "Aileron" << "Elevon"; m_aircraft->fixedWingType->addItems(fixedWingTypes); - // Set default model to "Aileron Dual Servo" - m_aircraft->fixedWingType->setCurrentIndex(m_aircraft->fixedWingType->findText("Aileron Dual Servo")); + // Set default model to "Aileron" + m_aircraft->fixedWingType->setCurrentIndex(m_aircraft->fixedWingType->findText("Aileron")); setupUI(m_aircraft->fixedWingType->currentText()); @@ -135,9 +135,9 @@ void ConfigFixedWingWidget::setupUI(QString frameType) qDebug() << "Current Aircraft type: \n" << m_aircraft->fixedWingType->currentText(); - if (frameType == "FixedWing" || frameType == "Aileron Dual Servo") { + if (frameType == "FixedWing" || frameType == "Aileron") { plane->setElementId("aileron"); - setComboCurrentIndex(m_aircraft->fixedWingType, m_aircraft->fixedWingType->findText("Aileron Dual Servo")); + setComboCurrentIndex(m_aircraft->fixedWingType, m_aircraft->fixedWingType->findText("Aileron")); resetChannelboxesAndSliders(); m_aircraft->fwRudder1ChannelBox->setEnabled(true); @@ -152,22 +152,6 @@ void ConfigFixedWingWidget::setupUI(QString frameType) m_aircraft->fwElevator1Label->setText("Elevator 1"); m_aircraft->fwElevator2Label->setText("Elevator 2"); - } else if (frameType == "Aileron Single Servo") { - plane->setElementId("aileron-single"); - setComboCurrentIndex(m_aircraft->fixedWingType, m_aircraft->fixedWingType->findText("Aileron Single Servo")); - resetChannelboxesAndSliders(); - m_aircraft->fwRudder1ChannelBox->setEnabled(true); - m_aircraft->fwRudder2ChannelBox->setEnabled(true); - m_aircraft->fwElevator1ChannelBox->setEnabled(true); - m_aircraft->fwElevator2ChannelBox->setEnabled(true); - m_aircraft->fwAileron1ChannelBox->setEnabled(true); - m_aircraft->fwAileron2ChannelBox->setEnabled(false); - - m_aircraft->fwAileron1Label->setText("Aileron 1"); - m_aircraft->fwAileron2Label->setText("Aileron 2"); - m_aircraft->fwElevator1Label->setText("Elevator 1"); - m_aircraft->fwElevator2Label->setText("Elevator 2"); - } else if (frameType == "FixedWingVtail" || frameType == "Vtail") { // do nothing for now } else if (frameType == "FixedWingElevon" || frameType == "Elevon") { @@ -218,7 +202,7 @@ void ConfigFixedWingWidget::setupEnabledControls(QString frameType) // enableComboBoxes(this, CHANNELBOXNAME, 3, true); } else if (frameType == "Elevon" || frameType == "Elevon") { enableComboBoxes(this, CHANNELBOXNAME, 3, true); - } else if (frameType == "aileron" || frameType == "Aileron Dual Servo" || frameType == "Aileron Single Servo") { + } else if (frameType == "aileron" || frameType == "Aileron") { enableComboBoxes(this, CHANNELBOXNAME, 4, true); } } @@ -316,7 +300,7 @@ QString ConfigFixedWingWidget::updateConfigObjectsFromWidgets() QString airframeType; QList motor_servo_List; - if (m_aircraft->fixedWingType->currentText() == "Aileron Dual Servo" || "aileron-single") { + if (m_aircraft->fixedWingType->currentText() == "Aileron") { airframeType = "FixedWing"; setupFrameFixedWing(airframeType); diff --git a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp index 575499753..44b4dcc4a 100644 --- a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp @@ -261,9 +261,8 @@ void ConfigVehicleTypeWidget::updateObjectsFromWidgets() int ConfigVehicleTypeWidget::frameCategory(QString frameType) { - if (frameType == "FixedWing" || frameType == "Aileron Dual Servo" || frameType == "Aileron Single Servo" - || frameType == "FixedWingElevon" || frameType == "Elevon" || frameType == "FixedWingVtail" - || frameType == "Vtail") { + if (frameType == "FixedWing" || frameType == "Aileron" || frameType == "FixedWingElevon" + || frameType == "Elevon" || frameType == "FixedWingVtail" || frameType == "Vtail") { return ConfigVehicleTypeWidget::FIXED_WING; } else if (frameType == "Tri" || frameType == "Tricopter Y" || frameType == "QuadX" || frameType == "Quad X" || frameType == "QuadP" || frameType == "Quad +" || frameType == "Hexa" || frameType == "Hexacopter" diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.cpp index ab506ccd6..bc8e96d05 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/fixedwingpage.cpp @@ -35,7 +35,7 @@ FixedWingPage::FixedWingPage(SetupWizard *wizard, QWidget *parent) : { ui->setupUi(this); QSvgRenderer *renderer = new QSvgRenderer(); - renderer->load(QString(":/configgadget/images/fixedwing-shapes.svg")); + renderer->load(QString(":/setupwizard/resources/fixedwing-shapes-wizard-no-numbers.svg")); m_fixedwingPic = new QGraphicsSvgItem(); m_fixedwingPic->setSharedRenderer(renderer); QGraphicsScene *scene = new QGraphicsScene(this); diff --git a/ground/openpilotgcs/src/plugins/setupwizard/wizardResources.qrc b/ground/openpilotgcs/src/plugins/setupwizard/wizardResources.qrc index 56bf63139..850bf1f05 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/wizardResources.qrc +++ b/ground/openpilotgcs/src/plugins/setupwizard/wizardResources.qrc @@ -36,6 +36,7 @@ resources/wizard.png resources/multirotor-shapes.svg resources/fixedwing-shapes-wizard.svg + resources/fixedwing-shapes-wizard-no-numbers.svg resources/bttn-illustration-down.png resources/bttn-illustration-up.png