diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputpagefixedwing.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputpagefixedwing.cpp new file mode 100644 index 000000000..66db90bdf --- /dev/null +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputpagefixedwing.cpp @@ -0,0 +1,54 @@ +/** + ****************************************************************************** + * + * @file outputpage.cpp + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @addtogroup + * @{ + * @addtogroup OutputPage + * @{ + * @brief + *****************************************************************************/ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include "outputpagefixedwing.h" +#include "ui_outputpagefixedwing.h" +#include "setupwizard.h" + +OutputPageFixedwing::OutputPageFixedwing(SetupWizard *wizard, QWidget *parent) : + AbstractWizardPage(wizard, parent), + + ui(new Ui::OutputPageFixedwing) +{ + ui->setupUi(this); +} + +OutputPageFixedwing::~OutputPageFixedwing() +{ + delete ui; +} + +bool OutputPageFixedwing::validatePage() +{ + if (ui->rapidESCButton->isChecked()) { + getWizard()->setESCType(SetupWizard::ESC_RAPID); + } else { + getWizard()->setESCType(SetupWizard::ESC_LEGACY); + } + + return true; +} diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputpagefixedwing.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputpagefixedwing.h new file mode 100644 index 000000000..d3d99b0fa --- /dev/null +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputpagefixedwing.h @@ -0,0 +1,49 @@ +/** + ****************************************************************************** + * + * @file outputpage.h + * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. + * @addtogroup + * @{ + * @addtogroup OutputPage + * @{ + * @brief + *****************************************************************************/ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef OUTPUTPAGEFIXEDWING_H +#define OUTPUTPAGEFIXEDWING_H + +#include "abstractwizardpage.h" + +namespace Ui { +class OutputPageFixedwing; +} + +class OutputPageFixedwing : public AbstractWizardPage { + Q_OBJECT + +public: + explicit OutputPageFixedwing(SetupWizard *wizard, QWidget *parent = 0); + ~OutputPage(); + bool validatePage(); + +private: + Ui::OutputPageFixedwing *ui; +}; + +#endif // OUTPUTPAGEFIXEDWING_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputpagefixedwing.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputpagefixedwing.ui new file mode 100644 index 000000000..bb7132888 --- /dev/null +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputpagefixedwing.ui @@ -0,0 +1,153 @@ + + + OutputPageFixedwing + + + + 0 + 0 + 600 + 400 + + + + WizardPage + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8pt; font-weight:400; font-style:normal;"> +<p align="center" style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:12pt; font-weight:600;">OpenPilot Output Signal Configuration</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:12pt; font-weight:600;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">To set an optimal configuration of the output signals powering your servos, the wizard needs to know what type of servos you will use and what their capabilities are.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:10pt;">Please select one of the options below. If you are unsure about the capabilities of your servos, just leave the default option selected and continue the wizard.</span></p> +<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-size:10pt;"><br /></p></body></html> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + 10 + + + + Standard ESC 50Hz + + + QToolButton { border: none } + + + Standard Servos + + + + :/setupwizard/resources/bttn-ESC-up.png + :/setupwizard/resources/bttn-ESC-down.png:/setupwizard/resources/bttn-ESC-up.png + + + + 200 + 100 + + + + true + + + false + + + true + + + Qt::ToolButtonTextUnderIcon + + + true + + + + + + + + 10 + + + + Turbo PWM ESC 400Hz + + + QToolButton { border: none } + + + Digital Servos + + + + :/setupwizard/resources/bttn-turbo-up.png + :/setupwizard/resources/bttn-turbo-down.png:/setupwizard/resources/bttn-turbo-up.png + + + + 200 + 100 + + + + true + + + true + + + true + + + Qt::ToolButtonTextUnderIcon + + + true + + + + + + + + + + + + diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp index eccfd2ce2..2ee8bf039 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp @@ -36,6 +36,7 @@ #include "pages/surfacepage.h" #include "pages/inputpage.h" #include "pages/outputpage.h" +#include "pages/outputpagefixedwing.h" #include "pages/biascalibrationpage.h" #include "pages/summarypage.h" #include "pages/savepage.h" @@ -113,7 +114,7 @@ int SetupWizard::nextId() const return PAGE_OUTPUT; case PAGE_FIXEDWING: - return PAGE_OUTPUT; + return PAGE_OUTPUT_FIXEDWING; case PAGE_INPUT: if (isRestartNeeded()) { @@ -128,6 +129,9 @@ int SetupWizard::nextId() const case PAGE_OUTPUT: return PAGE_SUMMARY; + case PAGE_OUTPUT_FIXEDWING: + return PAGE_SUMMARY; + case PAGE_BIAS_CALIBRATION: return PAGE_OUTPUT_CALIBRATION; @@ -319,6 +323,7 @@ void SetupWizard::createPages() setPage(PAGE_SURFACE, new SurfacePage(this)); setPage(PAGE_INPUT, new InputPage(this)); setPage(PAGE_OUTPUT, new OutputPage(this)); + setPage(PAGE_OUTPUT_FIXEDWING, new OutputPageFixedwing(this)); setPage(PAGE_BIAS_CALIBRATION, new BiasCalibrationPage(this)); // setPage(PAGE_REVO_CALIBRATION, new RevoCalibrationPage(this)); setPage(PAGE_OUTPUT_CALIBRATION, new OutputCalibrationPage(this)); diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h index a908ac989..434856607 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h @@ -156,9 +156,10 @@ private slots: void pageChanged(int currId); private: enum { PAGE_START, PAGE_CONTROLLER, PAGE_VEHICLES, PAGE_MULTI, PAGE_FIXEDWING, - PAGE_HELI, PAGE_SURFACE, PAGE_INPUT, PAGE_OUTPUT, PAGE_BIAS_CALIBRATION, - PAGE_REVO_CALIBRATION, PAGE_OUTPUT_CALIBRATION, PAGE_SAVE, PAGE_SUMMARY, - PAGE_NOTYETIMPLEMENTED, PAGE_REBOOT, PAGE_END, PAGE_UPDATE }; + PAGE_HELI, PAGE_SURFACE, PAGE_INPUT, PAGE_OUTPUT, PAGE_OUTPUT_FIXEDWING, + PAGE_BIAS_CALIBRATION,PAGE_REVO_CALIBRATION, PAGE_OUTPUT_CALIBRATION, + PAGE_SAVE, PAGE_SUMMARY,PAGE_NOTYETIMPLEMENTED, PAGE_REBOOT, PAGE_END, + PAGE_UPDATE }; void createPages(); bool saveHardwareSettings() const; bool canAutoUpdate() const; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro index 366b7eae9..51a98c880 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro @@ -23,6 +23,7 @@ HEADERS += setupwizardplugin.h \ pages/surfacepage.h \ pages/abstractwizardpage.h \ pages/outputpage.h \ + pages/outputpagefixedwing.h \ pages/inputpage.h \ pages/summarypage.h \ vehicleconfigurationsource.h \ @@ -50,6 +51,7 @@ SOURCES += setupwizardplugin.cpp \ pages/surfacepage.cpp \ pages/abstractwizardpage.cpp \ pages/outputpage.cpp \ + pages/outputpagefixedwing.cpp \ pages/inputpage.cpp \ pages/summarypage.cpp \ vehicleconfigurationsource.cpp \ @@ -77,6 +79,7 @@ FORMS += \ pages/helipage.ui \ pages/surfacepage.ui \ pages/outputpage.ui \ + pages/outputpagefixedwing.ui \ pages/inputpage.ui \ pages/summarypage.ui \ connectiondiagram.ui \