From b1a7f959b5c455a32bbd70883f6d2194652b803b Mon Sep 17 00:00:00 2001 From: Fredrik Larson Date: Fri, 5 Sep 2014 17:14:27 +1000 Subject: [PATCH] Initial tuning page --- ...page.cpp => airframeinitialtuningpage.cpp} | 10 +-- ...wingpage.h => airframeinitialtuningpage.h} | 16 ++-- .../pages/airframeinitialtuningpage.ui | 87 +++++++++++++++++++ .../pages/airframestabfixedwingpage.ui | 45 ---------- .../src/plugins/setupwizard/setupwizard.cpp | 8 +- .../src/plugins/setupwizard/setupwizard.h | 2 +- .../src/plugins/setupwizard/setupwizard.pro | 12 +-- 7 files changed, 111 insertions(+), 69 deletions(-) rename ground/openpilotgcs/src/plugins/setupwizard/pages/{airframestabfixedwingpage.cpp => airframeinitialtuningpage.cpp} (83%) rename ground/openpilotgcs/src/plugins/setupwizard/pages/{airframestabfixedwingpage.h => airframeinitialtuningpage.h} (77%) create mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.ui delete mode 100644 ground/openpilotgcs/src/plugins/setupwizard/pages/airframestabfixedwingpage.ui diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/airframestabfixedwingpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp similarity index 83% rename from ground/openpilotgcs/src/plugins/setupwizard/pages/airframestabfixedwingpage.cpp rename to ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp index 431e84f40..9983abf76 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/airframestabfixedwingpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.cpp @@ -25,17 +25,17 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "airframestabfixedwingpage.h" -#include "ui_airframestabfixedwingpage.h" +#include "airframeinitialtuningpage.h" +#include "ui_airframeinitialtuningpage.h" -AirframeStabFixedwingPage::AirframeStabFixedwingPage(SetupWizard *wizard, QWidget *parent) : +AirframeInitialTuningPage::AirframeInitialTuningPage(SetupWizard *wizard, QWidget *parent) : AbstractWizardPage(wizard, parent), - ui(new Ui::AirframeStabFixedwingPage) + ui(new Ui::AirframeInitialTuningPage) { ui->setupUi(this); } -AirframeStabFixedwingPage::~AirframeStabFixedwingPage() +AirframeInitialTuningPage::~AirframeInitialTuningPage() { delete ui; } diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/airframestabfixedwingpage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.h similarity index 77% rename from ground/openpilotgcs/src/plugins/setupwizard/pages/airframestabfixedwingpage.h rename to ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.h index 4a6dae8dc..fe92e1ee6 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/airframestabfixedwingpage.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.h @@ -25,24 +25,24 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef AIRFRAMESTABFIXEDWINGPAGE_H -#define AIRFRAMESTABFIXEDWINGPAGE_H +#ifndef AIRFRAMEINITIALTUNINGPAGE_H +#define AIRFRAMEINITIALTUNINGPAGE_H #include "abstractwizardpage.h" namespace Ui { -class AirframeStabFixedwingPage; +class AirframeInitialTuningPage; } -class AirframeStabFixedwingPage : public AbstractWizardPage { +class AirframeInitialTuningPage : public AbstractWizardPage { Q_OBJECT public: - explicit AirframeStabFixedwingPage(SetupWizard *wizard, QWidget *parent = 0); - ~AirframeStabFixedwingPage(); + explicit AirframeInitialTuningPage(SetupWizard *wizard, QWidget *parent = 0); + ~AirframeInitialTuningPage(); private: - Ui::AirframeStabFixedwingPage *ui; + Ui::AirframeInitialTuningPage *ui; }; -#endif // AIRFRAMESTABFIXEDWINGPAGE_H +#endif // AIRFRAMEINITIALTUNINGPAGE_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.ui new file mode 100644 index 000000000..6a87e690a --- /dev/null +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/airframeinitialtuningpage.ui @@ -0,0 +1,87 @@ + + + AirframeInitialTuningPage + + + + 0 + 0 + 600 + 400 + + + + WizardPage + + + + + 9 + 9 + 582 + 81 + + + + <!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;">Initial Tuning</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-family:'MS Shell Dlg 2,sans-serif';">This section of the OpenPilot Wizard allows you to select a set of initial tunning parameters for your airframe. Presented below is a list of common airframe types, select the one that matches your airframe the closest, if unsure select the generic variant.</span> </p></body></html> + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + true + + + + + + 10 + 100 + 581 + 291 + + + + + + + + + Qt::ScrollBarAlwaysOn + + + + + + + + + + + + Description + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + + + + + + label_main + label_main + horizontalLayoutWidget + + + + diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/airframestabfixedwingpage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/airframestabfixedwingpage.ui deleted file mode 100644 index 31e672b1f..000000000 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/airframestabfixedwingpage.ui +++ /dev/null @@ -1,45 +0,0 @@ - - - AirframeStabFixedwingPage - - - - 0 - 0 - 600 - 400 - - - - WizardPage - - - - - 20 - 130 - 551 - 191 - - - - <!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 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;">TODO: This page handles PIDs, we get a choice of airframes, some generics as well as specifics like FPV Raptor and Funjet etc</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:12pt; font-weight:600;">Explain these are a starting point and likely will need further tuning as no two airframes are completely identical </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;"><br /></p></body></html> - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop - - - true - - - - - - diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp index 92a157a63..25e3ad1b2 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp @@ -46,7 +46,7 @@ #include "pages/rebootpage.h" #include "pages/outputcalibrationpage.h" #include "pages/revocalibrationpage.h" -#include "pages/airframestabfixedwingpage.h" +#include "pages/airframeinitialtuningpage.h" #include "extensionsystem/pluginmanager.h" #include "vehicleconfigurationhelper.h" #include "actuatorsettings.h" @@ -163,7 +163,7 @@ int SetupWizard::nextId() const { switch (getVehicleType()) { case VEHICLE_FIXEDWING: - return PAGE_AIRFRAMESTAB_FIXEDWING; + return PAGE_AIRFRAME_INITIAL_TUNING; // TODO: PID selection pages for multi and heli case VEHICLE_MULTI: @@ -186,7 +186,7 @@ int SetupWizard::nextId() const case PAGE_AIRSPEED: return PAGE_SUMMARY; - case PAGE_AIRFRAMESTAB_FIXEDWING: + case PAGE_AIRFRAME_INITIAL_TUNING: return PAGE_SAVE; case PAGE_SUMMARY: @@ -440,7 +440,7 @@ void SetupWizard::createPages() setPage(PAGE_SAVE, new SavePage(this)); setPage(PAGE_REBOOT, new RebootPage(this)); setPage(PAGE_NOTYETIMPLEMENTED, new NotYetImplementedPage(this)); - setPage(PAGE_AIRFRAMESTAB_FIXEDWING, new AirframeStabFixedwingPage(this)); + setPage(PAGE_AIRFRAME_INITIAL_TUNING, new AirframeInitialTuningPage(this)); setPage(PAGE_END, new OPEndPage(this)); setStartId(PAGE_START); diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h index 8fb9fd325..f46163792 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h @@ -177,7 +177,7 @@ private: enum { PAGE_START, PAGE_CONTROLLER, PAGE_VEHICLES, PAGE_MULTI, PAGE_FIXEDWING, PAGE_AIRSPEED, PAGE_GPS, PAGE_HELI, PAGE_SURFACE, PAGE_INPUT, PAGE_ESC, PAGE_SERVO, PAGE_BIAS_CALIBRATION, PAGE_REVO_CALIBRATION, PAGE_OUTPUT_CALIBRATION, - PAGE_SAVE, PAGE_SUMMARY, PAGE_NOTYETIMPLEMENTED, PAGE_AIRFRAMESTAB_FIXEDWING, + PAGE_SAVE, PAGE_SUMMARY, PAGE_NOTYETIMPLEMENTED, PAGE_AIRFRAME_INITIAL_TUNING, PAGE_REBOOT, PAGE_END, PAGE_UPDATE }; void createPages(); bool saveHardwareSettings() const; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro index eec6f4e69..b9e651d3e 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro @@ -37,10 +37,10 @@ HEADERS += setupwizardplugin.h \ pages/revocalibrationpage.h \ biascalibrationutil.h \ pages/biascalibrationpage.h \ - pages/airframestabfixedwingpage.h \ pages/escpage.h \ pages/servopage.h \ - pages/selectionpage.h + pages/selectionpage.h \ + pages/airframeinitialtuningpage.h SOURCES += setupwizardplugin.cpp \ setupwizard.cpp \ @@ -69,10 +69,10 @@ SOURCES += setupwizardplugin.cpp \ pages/revocalibrationpage.cpp \ biascalibrationutil.cpp \ pages/biascalibrationpage.cpp \ - pages/airframestabfixedwingpage.cpp \ pages/escpage.cpp \ pages/servopage.cpp \ - pages/selectionpage.cpp + pages/selectionpage.cpp \ + pages/airframeinitialtuningpage.cpp OTHER_FILES += SetupWizard.pluginspec @@ -93,10 +93,10 @@ FORMS += \ pages/autoupdatepage.ui \ pages/revocalibrationpage.ui \ pages/biascalibrationpage.ui \ - pages/airframestabfixedwingpage.ui \ pages/escpage.ui \ pages/servopage.ui \ - pages/selectionpage.ui + pages/selectionpage.ui \ + pages/airframeinitialtuningpage.ui RESOURCES += \ wizardResources.qrc