diff --git a/ground/openpilotgcs/src/plugins/config/configgadgetfactory.cpp b/ground/openpilotgcs/src/plugins/config/configgadgetfactory.cpp index b468adf02..2a1996729 100644 --- a/ground/openpilotgcs/src/plugins/config/configgadgetfactory.cpp +++ b/ground/openpilotgcs/src/plugins/config/configgadgetfactory.cpp @@ -58,5 +58,8 @@ IOptionsPage *ConfigGadgetFactory::createOptionsPage(IUAVGadgetConfiguration *co void ConfigGadgetFactory::startInputWizard() { - gadgetWidget->startInputWizard(); + if(gadgetWidget) + { + gadgetWidget->startInputWizard(); + } } diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/endpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/endpage.cpp index 2df3f9e79..5c445d5ba 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/endpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/endpage.cpp @@ -29,6 +29,7 @@ #include <coreplugin/modemanager.h> #include <extensionsystem/pluginmanager.h> #include <configgadgetfactory.h> +#include <QMessageBox> EndPage::EndPage(SetupWizard *wizard, QWidget *parent) : AbstractWizardPage(wizard, parent), @@ -46,12 +47,19 @@ EndPage::~EndPage() void EndPage::openInputWizard() { - Core::ModeManager::instance()->activateModeByWorkspaceName("Configuration"); - - getWizard()->close(); - ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); ConfigGadgetFactory* configGadgetFactory = pm->getObject<ConfigGadgetFactory>(); - Q_ASSERT(configGadgetFactory); - configGadgetFactory->startInputWizard(); + + if(configGadgetFactory) { + Core::ModeManager::instance()->activateModeByWorkspaceName("Configuration"); + getWizard()->close(); + configGadgetFactory->startInputWizard(); + } + else { + QMessageBox msgBox; + msgBox.setText(tr("Unable to open Input Wizard since the Config Plugin is not\nloaded in the current workspace.")); + msgBox.setStandardButtons(QMessageBox::Ok); + msgBox.setDefaultButton(QMessageBox::Ok); + msgBox.exec(); + } } diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/inputpage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/inputpage.ui index 75cd62c94..d69b5dd3f 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/inputpage.ui +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/inputpage.ui @@ -44,9 +44,9 @@ p, li { white-space: pre-wrap; } <property name="geometry"> <rect> <x>20</x> - <y>220</y> + <y>200</y> <width>561</width> - <height>160</height> + <height>181</height> </rect> </property> <property name="sizePolicy"> @@ -61,22 +61,36 @@ p, li { white-space: pre-wrap; } <property name="alignment"> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> </property> - <widget class="QPushButton" name="pwmButton"> + <widget class="QToolButton" name="pwmButton"> <property name="geometry"> <rect> <x>50</x> <y>40</y> <width>100</width> - <height>100</height> + <height>120</height> </rect> </property> <property name="toolTip"> <string>Tricopter, Quadcopter, Hexacopter, Octocopter</string> </property> + <property name="styleSheet"> + <string notr="true">QToolButton { border: none }</string> + </property> <property name="text"> - <string>PWM -One cable -per channel</string> + <string>PWM</string> + </property> + <property name="icon"> + <iconset resource="../wizardResources.qrc"> + <normaloff>:/setupwizard/resources/bttn-pwm-up.png</normaloff> + <normalon>:/setupwizard/resources/bttn-pwm-down.png</normalon> + <activeoff>:/setupwizard/resources/bttn-pwm-down.png</activeoff> + <activeon>:/setupwizard/resources/bttn-pwm-down.png</activeon>:/setupwizard/resources/bttn-pwm-up.png</iconset> + </property> + <property name="iconSize"> + <size> + <width>100</width> + <height>100</height> + </size> </property> <property name="checkable"> <bool>true</bool> @@ -87,26 +101,43 @@ per channel</string> <property name="autoExclusive"> <bool>true</bool> </property> - <property name="flat"> - <bool>false</bool> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonTextUnderIcon</enum> + </property> + <property name="autoRaise"> + <bool>true</bool> </property> </widget> - <widget class="QPushButton" name="ppmButton"> + <widget class="QToolButton" name="ppmButton"> <property name="geometry"> <rect> <x>170</x> <y>40</y> <width>100</width> - <height>100</height> + <height>120</height> </rect> </property> <property name="toolTip"> <string>Airplane, Sloper, Jet</string> </property> + <property name="styleSheet"> + <string notr="true">QToolButton { border: none }</string> + </property> <property name="text"> - <string>PPM -One cable -for all channels</string> + <string>PPM</string> + </property> + <property name="icon"> + <iconset resource="../wizardResources.qrc"> + <normaloff>:/setupwizard/resources/bttn-ppm-up.png</normaloff> + <normalon>:/setupwizard/resources/bttn-ppm-down.png</normalon> + <activeoff>:/setupwizard/resources/bttn-ppm-down.png</activeoff> + <activeon>:/setupwizard/resources/bttn-ppm-down.png</activeon>:/setupwizard/resources/bttn-ppm-up.png</iconset> + </property> + <property name="iconSize"> + <size> + <width>100</width> + <height>100</height> + </size> </property> <property name="checkable"> <bool>true</bool> @@ -114,25 +145,43 @@ for all channels</string> <property name="autoExclusive"> <bool>true</bool> </property> - <property name="flat"> - <bool>false</bool> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonTextUnderIcon</enum> + </property> + <property name="autoRaise"> + <bool>true</bool> </property> </widget> - <widget class="QPushButton" name="sbusButton"> + <widget class="QToolButton" name="sbusButton"> <property name="geometry"> <rect> <x>290</x> <y>40</y> <width>100</width> - <height>100</height> + <height>120</height> </rect> </property> <property name="toolTip"> <string>Airplane, Sloper, Jet</string> </property> + <property name="styleSheet"> + <string notr="true">QToolButton { border: none }</string> + </property> <property name="text"> - <string>Futaba -S.Bus</string> + <string>Futaba</string> + </property> + <property name="icon"> + <iconset resource="../wizardResources.qrc"> + <normaloff>:/setupwizard/resources/bttn-sbus-up.png</normaloff> + <normalon>:/setupwizard/resources/bttn-sbus-down.png</normalon> + <activeoff>:/setupwizard/resources/bttn-sbus-down.png</activeoff> + <activeon>:/setupwizard/resources/bttn-sbus-down.png</activeon>:/setupwizard/resources/bttn-sbus-up.png</iconset> + </property> + <property name="iconSize"> + <size> + <width>100</width> + <height>100</height> + </size> </property> <property name="checkable"> <bool>true</bool> @@ -140,25 +189,43 @@ S.Bus</string> <property name="autoExclusive"> <bool>true</bool> </property> - <property name="flat"> - <bool>false</bool> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonTextUnderIcon</enum> + </property> + <property name="autoRaise"> + <bool>true</bool> </property> </widget> - <widget class="QPushButton" name="spectrumButton"> + <widget class="QToolButton" name="spectrumButton"> <property name="geometry"> <rect> <x>410</x> <y>40</y> <width>100</width> - <height>100</height> + <height>120</height> </rect> </property> <property name="toolTip"> <string>Airplane, Sloper, Jet</string> </property> + <property name="styleSheet"> + <string notr="true">QToolButton { border: none }</string> + </property> <property name="text"> - <string>Spectrum -Satellite</string> + <string>Spectrum</string> + </property> + <property name="icon"> + <iconset resource="../wizardResources.qrc"> + <normaloff>:/setupwizard/resources/bttn-sat-up.png</normaloff> + <normalon>:/setupwizard/resources/bttn-sat-down.png</normalon> + <activeoff>:/setupwizard/resources/bttn-sat-down.png</activeoff> + <activeon>:/setupwizard/resources/bttn-sat-down.png</activeon>:/setupwizard/resources/bttn-sat-up.png</iconset> + </property> + <property name="iconSize"> + <size> + <width>100</width> + <height>100</height> + </size> </property> <property name="checkable"> <bool>true</bool> @@ -166,12 +233,17 @@ Satellite</string> <property name="autoExclusive"> <bool>true</bool> </property> - <property name="flat"> - <bool>false</bool> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonTextUnderIcon</enum> + </property> + <property name="autoRaise"> + <bool>true</bool> </property> </widget> </widget> </widget> - <resources/> + <resources> + <include location="../wizardResources.qrc"/> + </resources> <connections/> </ui> diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputpage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputpage.ui index 37cd5c209..13b95bd6b 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputpage.ui +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputpage.ui @@ -44,9 +44,9 @@ p, li { white-space: pre-wrap; } <property name="geometry"> <rect> <x>20</x> - <y>220</y> + <y>200</y> <width>561</width> - <height>161</height> + <height>181</height> </rect> </property> <property name="sizePolicy"> @@ -61,21 +61,36 @@ p, li { white-space: pre-wrap; } <property name="alignment"> <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set> </property> - <widget class="QPushButton" name="defaultESCButton"> + <widget class="QToolButton" name="defaultESCButton"> <property name="geometry"> <rect> - <x>290</x> + <x>300</x> <y>40</y> - <width>100</width> - <height>100</height> + <width>200</width> + <height>120</height> </rect> </property> <property name="toolTip"> <string>Tricopter, Quadcopter, Hexacopter, Octocopter</string> </property> + <property name="styleSheet"> + <string notr="true">QToolButton { border: none }</string> + </property> <property name="text"> - <string>Legacy ESC -50 Hz</string> + <string>Standard ESC</string> + </property> + <property name="icon"> + <iconset resource="../wizardResources.qrc"> + <normaloff>:/setupwizard/resources/bttn-ESC-up.png</normaloff> + <normalon>:/setupwizard/resources/bttn-ESC-down.png</normalon> + <activeoff>:/setupwizard/resources/bttn-ESC-down.png</activeoff> + <activeon>:/setupwizard/resources/bttn-ESC-down.png</activeon>:/setupwizard/resources/bttn-ESC-up.png</iconset> + </property> + <property name="iconSize"> + <size> + <width>200</width> + <height>100</height> + </size> </property> <property name="checkable"> <bool>true</bool> @@ -86,25 +101,43 @@ p, li { white-space: pre-wrap; } <property name="autoExclusive"> <bool>true</bool> </property> - <property name="flat"> - <bool>false</bool> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonTextUnderIcon</enum> + </property> + <property name="autoRaise"> + <bool>true</bool> </property> </widget> - <widget class="QPushButton" name="rapidESCButton"> + <widget class="QToolButton" name="rapidESCButton"> <property name="geometry"> <rect> - <x>160</x> + <x>60</x> <y>40</y> - <width>100</width> - <height>100</height> + <width>200</width> + <height>120</height> </rect> </property> <property name="toolTip"> <string>Airplane, Sloper, Jet</string> </property> + <property name="styleSheet"> + <string notr="true">QToolButton { border: none }</string> + </property> <property name="text"> - <string>Rapid ESC -400 Hz</string> + <string>Rapid ESC</string> + </property> + <property name="icon"> + <iconset resource="../wizardResources.qrc"> + <normaloff>:/setupwizard/resources/bttn-rapid-up.png</normaloff> + <normalon>:/setupwizard/resources/bttn-rapid-down.png</normalon> + <activeoff>:/setupwizard/resources/bttn-rapid-down.png</activeoff> + <activeon>:/setupwizard/resources/bttn-rapid-down.png</activeon>:/setupwizard/resources/bttn-rapid-up.png</iconset> + </property> + <property name="iconSize"> + <size> + <width>200</width> + <height>100</height> + </size> </property> <property name="checkable"> <bool>true</bool> @@ -115,12 +148,17 @@ p, li { white-space: pre-wrap; } <property name="autoExclusive"> <bool>true</bool> </property> - <property name="flat"> - <bool>false</bool> + <property name="toolButtonStyle"> + <enum>Qt::ToolButtonTextUnderIcon</enum> + </property> + <property name="autoRaise"> + <bool>true</bool> </property> </widget> </widget> </widget> - <resources/> + <resources> + <include location="../wizardResources.qrc"/> + </resources> <connections/> </ui> diff --git a/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-ESC-down.png b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-ESC-down.png new file mode 100644 index 000000000..26899fb5a Binary files /dev/null and b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-ESC-down.png differ diff --git a/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-ESC-up.png b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-ESC-up.png new file mode 100644 index 000000000..07016ddc1 Binary files /dev/null and b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-ESC-up.png differ diff --git a/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-ppm-down.png b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-ppm-down.png new file mode 100644 index 000000000..03706d360 Binary files /dev/null and b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-ppm-down.png differ diff --git a/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-ppm-up.png b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-ppm-up.png new file mode 100644 index 000000000..f58e5596b Binary files /dev/null and b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-ppm-up.png differ diff --git a/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-pwm-down.png b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-pwm-down.png new file mode 100644 index 000000000..72656896a Binary files /dev/null and b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-pwm-down.png differ diff --git a/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-pwm-up.png b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-pwm-up.png new file mode 100644 index 000000000..25d3624dd Binary files /dev/null and b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-pwm-up.png differ diff --git a/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-rapid-down.png b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-rapid-down.png new file mode 100644 index 000000000..276c26c6b Binary files /dev/null and b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-rapid-down.png differ diff --git a/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-rapid-up.png b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-rapid-up.png new file mode 100644 index 000000000..66808dca8 Binary files /dev/null and b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-rapid-up.png differ diff --git a/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-sat-down.png b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-sat-down.png new file mode 100644 index 000000000..05bc35895 Binary files /dev/null and b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-sat-down.png differ diff --git a/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-sat-up.png b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-sat-up.png new file mode 100644 index 000000000..37e16c2cb Binary files /dev/null and b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-sat-up.png differ diff --git a/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-sbus-down.png b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-sbus-down.png new file mode 100644 index 000000000..ffea88361 Binary files /dev/null and b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-sbus-down.png differ diff --git a/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-sbus-up.png b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-sbus-up.png new file mode 100644 index 000000000..9937ac0b4 Binary files /dev/null and b/ground/openpilotgcs/src/plugins/setupwizard/resources/bttn-sbus-up.png differ diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index 1bac27ec5..3d61a6ed1 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -32,8 +32,8 @@ #include "attitudesettings.h" #include "mixersettings.h" #include "systemsettings.h" -#import "manualcontrolsettings.h" -#import "stabilizationsettings.h" +#include "manualcontrolsettings.h" +#include "stabilizationsettings.h" VehicleConfigurationHelper::VehicleConfigurationHelper(VehicleConfigurationSource *configSource) : m_configSource(configSource), m_uavoManager(0), diff --git a/ground/openpilotgcs/src/plugins/setupwizard/wizardResources.qrc b/ground/openpilotgcs/src/plugins/setupwizard/wizardResources.qrc index cb4e3d5a3..913782e7d 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/wizardResources.qrc +++ b/ground/openpilotgcs/src/plugins/setupwizard/wizardResources.qrc @@ -12,5 +12,17 @@ <file>resources/bttn-plane-down.png</file> <file>resources/bttn-plane-over.png</file> <file>resources/bttn-plane-up.png</file> + <file>resources/bttn-ESC-down.png</file> + <file>resources/bttn-ESC-up.png</file> + <file>resources/bttn-ppm-down.png</file> + <file>resources/bttn-ppm-up.png</file> + <file>resources/bttn-pwm-down.png</file> + <file>resources/bttn-pwm-up.png</file> + <file>resources/bttn-rapid-down.png</file> + <file>resources/bttn-rapid-up.png</file> + <file>resources/bttn-sat-down.png</file> + <file>resources/bttn-sat-up.png</file> + <file>resources/bttn-sbus-down.png</file> + <file>resources/bttn-sbus-up.png</file> </qresource> </RCC>