From 2592f6b1a42f7c3399ed71491a97007fa55c2142 Mon Sep 17 00:00:00 2001 From: m_thread Date: Wed, 29 Oct 2014 00:30:06 +0100 Subject: [PATCH] OP-1581 Add button to open Vehicle Configuration Wizard to Config plugin. --- .../src/plugins/config/airframe.ui | 45 ++++++++++++++++++- .../src/plugins/config/configgadgetfactory.h | 3 ++ .../config/configvehicletypewidget.cpp | 4 ++ .../plugins/setupwizard/setupwizardplugin.cpp | 5 +++ .../plugins/setupwizard/setupwizardplugin.h | 2 +- 5 files changed, 56 insertions(+), 3 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/config/airframe.ui b/ground/openpilotgcs/src/plugins/config/airframe.ui index 9609b357a..e08ab3014 100644 --- a/ground/openpilotgcs/src/plugins/config/airframe.ui +++ b/ground/openpilotgcs/src/plugins/config/airframe.ui @@ -87,6 +87,29 @@ + + Qt::Horizontal + + + QSizePolicy::Minimum + + + + 20 + 20 + + + + + + + + Vehicle Setup Wizard... + + + + + Qt::Horizontal @@ -389,8 +412,8 @@ 0 0 - 838 - 445 + 293 + 300 @@ -925,6 +948,24 @@ p, li { white-space: pre-wrap; } 1 + + nameEdit + vehicleSetupWizardButton + airframesScrollArea + scrollArea_2 + decelTime + accelTime + feedForwardSlider + maxAccelSlider + ffTestBox1 + ffTestBox2 + ffTestBox3 + textBrowser + airframeHelp + saveAircraftToRAM + saveAircraftToSD + tabWidget + diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetfactory.h b/ground/openpilotgcs/src/plugins/config/configgadgetfactory.h index 936cb41b4..afee59722 100644 --- a/ground/openpilotgcs/src/plugins/config/configgadgetfactory.h +++ b/ground/openpilotgcs/src/plugins/config/configgadgetfactory.h @@ -46,6 +46,9 @@ public: IUAVGadget *createGadget(QWidget *parent); +signals: + void onOpenVehicleConfigurationWizard(); + public slots: void startInputWizard(); diff --git a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp index 3925431eb..a27d84d88 100644 --- a/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp +++ b/ground/openpilotgcs/src/plugins/config/configvehicletypewidget.cpp @@ -27,6 +27,7 @@ #include "configvehicletypewidget.h" #include "systemsettings.h" #include "actuatorsettings.h" +#include "configgadgetfactory.h" #include "cfg_vehicletypes/configccpmwidget.h" #include "cfg_vehicletypes/configfixedwingwidget.h" @@ -121,6 +122,9 @@ ConfigVehicleTypeWidget::ConfigVehicleTypeWidget(QWidget *parent) : ConfigTaskWi m_aircraft->saveAircraftToRAM->setVisible(false); } + ConfigGadgetFactory *configGadgetFactory = pm->getObject(); + connect(m_aircraft->vehicleSetupWizardButton, SIGNAL(clicked()), configGadgetFactory, SIGNAL(onOpenVehicleConfigurationWizard())); + SystemSettings *syssettings = SystemSettings::GetInstance(getObjectManager()); Q_ASSERT(syssettings); m_aircraft->nameEdit->setMaxLength(syssettings->VEHICLENAME_NUMELEM); diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.cpp b/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.cpp index 39b3d5f0e..f6c5505b1 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include @@ -78,6 +79,10 @@ bool SetupWizardPlugin::initialize(const QStringList & args, QString *errMsg) ac->appendGroup("Wizard"); ac->addAction(cmd, "Wizard"); + ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); + ConfigGadgetFactory *configGadgetFactory = pm->getObject(); + connect(configGadgetFactory, SIGNAL(onOpenVehicleConfigurationWizard()), this, SLOT(showSetupWizard())); + return true; } diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.h b/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.h index 0c68e600b..580140f4b 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizardplugin.h @@ -33,7 +33,7 @@ class SetupWizardPlugin : public ExtensionSystem::IPlugin { Q_OBJECT - Q_PLUGIN_METADATA(IID "OpenPilot.SetupWizard") + Q_PLUGIN_METADATA(IID "OpenPilot.SetupWizard") public: SetupWizardPlugin();