From 66b66ee8f4d7e18c1fe9cc39f26a78a1e10dfd62 Mon Sep 17 00:00:00 2001 From: Fredrik Arvidsson Date: Tue, 16 Apr 2013 19:41:13 +0200 Subject: [PATCH] OP-816 Re-factoring and removal of warnings. --- ...evellingutil.cpp => cccalibrationutil.cpp} | 28 +++++---- .../{levellingutil.h => cccalibrationutil.h} | 16 ++--- .../setupwizard/outputcalibrationutil.cpp | 2 +- ...evellingpage.cpp => cccalibrationpage.cpp} | 61 +++++++++---------- .../{levellingpage.h => cccalibrationpage.h} | 34 +++++------ ...{levellingpage.ui => cccalibrationpage.ui} | 16 ++--- .../pages/outputcalibrationpage.cpp | 4 ++ .../src/plugins/setupwizard/setupwizard.cpp | 16 ++--- .../src/plugins/setupwizard/setupwizard.h | 8 +-- .../src/plugins/setupwizard/setupwizard.pro | 16 ++--- .../vehicleconfigurationhelper.cpp | 4 +- .../setupwizard/vehicleconfigurationsource.h | 4 +- 12 files changed, 107 insertions(+), 102 deletions(-) rename ground/openpilotgcs/src/plugins/setupwizard/{levellingutil.cpp => cccalibrationutil.cpp} (91%) rename ground/openpilotgcs/src/plugins/setupwizard/{levellingutil.h => cccalibrationutil.h} (86%) rename ground/openpilotgcs/src/plugins/setupwizard/pages/{levellingpage.cpp => cccalibrationpage.cpp} (63%) rename ground/openpilotgcs/src/plugins/setupwizard/pages/{levellingpage.h => cccalibrationpage.h} (66%) rename ground/openpilotgcs/src/plugins/setupwizard/pages/{levellingpage.ui => cccalibrationpage.ui} (72%) diff --git a/ground/openpilotgcs/src/plugins/setupwizard/levellingutil.cpp b/ground/openpilotgcs/src/plugins/setupwizard/cccalibrationutil.cpp similarity index 91% rename from ground/openpilotgcs/src/plugins/setupwizard/levellingutil.cpp rename to ground/openpilotgcs/src/plugins/setupwizard/cccalibrationutil.cpp index 23d422adf..86ffbabca 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/levellingutil.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/cccalibrationutil.cpp @@ -1,11 +1,11 @@ /** ****************************************************************************** * - * @file levellingutil.cpp + * @file cccalibrationutil.cpp * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. * @addtogroup * @{ - * @addtogroup LevellingUtil + * @addtogroup CCCalibrationUtil * @{ * @brief *****************************************************************************/ @@ -25,7 +25,7 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include "levellingutil.h" +#include "cccalibrationutil.h" #include "extensionsystem/pluginmanager.h" #include "uavobjectmanager.h" #include "attitudesettings.h" @@ -33,20 +33,20 @@ #include "gyros.h" -LevellingUtil::LevellingUtil(long measurementCount, long measurementRate) : QObject(), +CCCalibrationUtil::CCCalibrationUtil(long measurementCount, long measurementRate) : QObject(), m_isMeasuring(false), m_accelMeasurementCount(measurementCount), m_gyroMeasurementCount(measurementCount), m_accelMeasurementRate(measurementRate), m_gyroMeasurementRate(measurementRate) { } -LevellingUtil::LevellingUtil(long accelMeasurementCount, long accelMeasurementRate, +CCCalibrationUtil::CCCalibrationUtil(long accelMeasurementCount, long accelMeasurementRate, long gyroMeasurementCount, long gyroMeasurementRate) : QObject(), m_isMeasuring(false), m_accelMeasurementCount(accelMeasurementCount), m_gyroMeasurementCount(gyroMeasurementCount), m_accelMeasurementRate(accelMeasurementRate), m_gyroMeasurementRate(gyroMeasurementRate) { } -void LevellingUtil::start() +void CCCalibrationUtil::start() { if(!m_isMeasuring) { startMeasurement(); @@ -58,15 +58,16 @@ void LevellingUtil::start() } } -void LevellingUtil::abort() +void CCCalibrationUtil::abort() { if(m_isMeasuring) { stopMeasurement(); } } -void LevellingUtil::gyroMeasurementsUpdated(UAVObject *obj) +void CCCalibrationUtil::gyroMeasurementsUpdated(UAVObject *obj) { + Q_UNUSED(obj); QMutexLocker locker(&m_measurementMutex); if(m_receivedGyroUpdates < m_gyroMeasurementCount) { @@ -91,8 +92,9 @@ void LevellingUtil::gyroMeasurementsUpdated(UAVObject *obj) } } -void LevellingUtil::accelMeasurementsUpdated(UAVObject *obj) +void CCCalibrationUtil::accelMeasurementsUpdated(UAVObject *obj) { + Q_UNUSED(obj); QMutexLocker locker(&m_measurementMutex); if(m_receivedAccelUpdates < m_accelMeasurementCount) { @@ -117,7 +119,7 @@ void LevellingUtil::accelMeasurementsUpdated(UAVObject *obj) } } -void LevellingUtil::timeout() +void CCCalibrationUtil::timeout() { QMutexLocker locker(&m_measurementMutex); @@ -125,7 +127,7 @@ void LevellingUtil::timeout() emit timeout(tr("Calibration timed out before receiving required updates.")); } -void LevellingUtil::startMeasurement() +void CCCalibrationUtil::startMeasurement() { QMutexLocker locker(&m_measurementMutex); @@ -174,7 +176,7 @@ void LevellingUtil::startMeasurement() uavObject->setMetadata(newMetaData); } -void LevellingUtil::stopMeasurement() +void CCCalibrationUtil::stopMeasurement() { m_isMeasuring = false; @@ -202,7 +204,7 @@ void LevellingUtil::stopMeasurement() AttitudeSettings::GetInstance(uavObjectManager)->setData(attitudeSettingsData); } -accelGyroBias LevellingUtil::calculateLevellingData() +accelGyroBias CCCalibrationUtil::calculateLevellingData() { accelGyroBias bias; bias.m_accelerometerXBias = m_accelerometerX / (double)m_receivedAccelUpdates / ACCELERATION_SCALE; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/levellingutil.h b/ground/openpilotgcs/src/plugins/setupwizard/cccalibrationutil.h similarity index 86% rename from ground/openpilotgcs/src/plugins/setupwizard/levellingutil.h rename to ground/openpilotgcs/src/plugins/setupwizard/cccalibrationutil.h index c5cbe8709..06947e79c 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/levellingutil.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/cccalibrationutil.h @@ -1,11 +1,11 @@ /** ****************************************************************************** * - * @file levellingutil.h + * @file cccalibrationutil.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. * @addtogroup * @{ - * @addtogroup LevellingUtil + * @addtogroup CCCalibrationUtil * @{ * @brief *****************************************************************************/ @@ -25,8 +25,8 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef LEVELLINGUTIL_H -#define LEVELLINGUTIL_H +#ifndef CCCALIBRATIONUTIL_H +#define CCCALIBRATIONUTIL_H #include #include @@ -35,12 +35,12 @@ #include "uavobject.h" #include "vehicleconfigurationsource.h" -class LevellingUtil : public QObject +class CCCalibrationUtil : public QObject { Q_OBJECT public: - explicit LevellingUtil(long measurementCount, long measurementRate); - explicit LevellingUtil(long accelMeasurementCount, long accelMeasurementRate, + explicit CCCalibrationUtil(long measurementCount, long measurementRate); + explicit CCCalibrationUtil(long accelMeasurementCount, long accelMeasurementRate, long gyroMeasurementCount, long gyroMeasurementRate); signals: @@ -89,4 +89,4 @@ private: accelGyroBias calculateLevellingData(); }; -#endif // LEVELLINGUTIL_H +#endif // CCCALIBRATIONUTIL_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/outputcalibrationutil.cpp b/ground/openpilotgcs/src/plugins/setupwizard/outputcalibrationutil.cpp index 30144ec42..1e7e48959 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/outputcalibrationutil.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/outputcalibrationutil.cpp @@ -46,7 +46,7 @@ OutputCalibrationUtil::~OutputCalibrationUtil() void OutputCalibrationUtil::startChannelOutput(quint16 channel, quint16 safeValue) { - if(m_outputChannel < 0 && channel >= 0 && channel < ActuatorCommand::CHANNEL_NUMELEM) + if(m_outputChannel < 0 && channel < ActuatorCommand::CHANNEL_NUMELEM) { //Start output... m_outputChannel = channel; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/levellingpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/cccalibrationpage.cpp similarity index 63% rename from ground/openpilotgcs/src/plugins/setupwizard/pages/levellingpage.cpp rename to ground/openpilotgcs/src/plugins/setupwizard/pages/cccalibrationpage.cpp index f8a2cfd25..54f0b7b62 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/levellingpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/cccalibrationpage.cpp @@ -1,11 +1,11 @@ /** ****************************************************************************** * - * @file levellingpage.cpp + * @file cccalibrationpage.cpp * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. * @addtogroup * @{ - * @addtogroup LevellingPage + * @addtogroup CCCalibrationPage * @{ * @brief *****************************************************************************/ @@ -27,38 +27,37 @@ #include #include -#include "levellingpage.h" -#include "ui_levellingpage.h" +#include "cccalibrationpage.h" +#include "ui_cccalibrationpage.h" #include "setupwizard.h" -LevellingPage::LevellingPage(SetupWizard *wizard, QWidget *parent) : +CCCalibrationPage::CCCalibrationPage(SetupWizard *wizard, QWidget *parent) : AbstractWizardPage(wizard, parent), - ui(new Ui::LevellingPage), m_levellingUtil(0) + ui(new Ui::CCCalibrationPage), m_calibrationUtil(0) { ui->setupUi(this); - connect(ui->levelButton, SIGNAL(clicked()), this, SLOT(performLevelling())); + connect(ui->levelButton, SIGNAL(clicked()), this, SLOT(performCalibration())); } -LevellingPage::~LevellingPage() +CCCalibrationPage::~CCCalibrationPage() { - if(m_levellingUtil) { - delete m_levellingUtil; + if(m_calibrationUtil) { + delete m_calibrationUtil; } delete ui; } -bool LevellingPage::validatePage() +bool CCCalibrationPage::validatePage() { return true; } -bool LevellingPage::isComplete() const +bool CCCalibrationPage::isComplete() const { - //const_cast(this)->getWizard()->isLevellingPerformed() && return ui->levelButton->isEnabled(); } -void LevellingPage::enableButtons(bool enable) +void CCCalibrationPage::enableButtons(bool enable) { ui->levelButton->setEnabled(enable); getWizard()->button(QWizard::NextButton)->setEnabled(enable); @@ -68,7 +67,7 @@ void LevellingPage::enableButtons(bool enable) QApplication::processEvents(); } -void LevellingPage::performLevelling() +void CCCalibrationPage::performCalibration() { if(!getWizard()->getConnectionManager()->isConnected()) { QMessageBox msgBox; @@ -84,19 +83,19 @@ void LevellingPage::performLevelling() ui->progressLabel->setText(QString(tr("Retrieving data..."))); - if(!m_levellingUtil) + if(!m_calibrationUtil) { - m_levellingUtil = new LevellingUtil(BIAS_CYCLES, BIAS_RATE); + m_calibrationUtil = new CCCalibrationUtil(BIAS_CYCLES, BIAS_RATE); } - connect(m_levellingUtil, SIGNAL(progress(long,long)), this, SLOT(levellingProgress(long,long))); - connect(m_levellingUtil, SIGNAL(done(accelGyroBias)), this, SLOT(levellingDone(accelGyroBias))); - connect(m_levellingUtil, SIGNAL(timeout(QString)), this, SLOT(levellingTimeout(QString))); + connect(m_calibrationUtil, SIGNAL(progress(long,long)), this, SLOT(calibrationProgress(long,long))); + connect(m_calibrationUtil, SIGNAL(done(accelGyroBias)), this, SLOT(calibrationDone(accelGyroBias))); + connect(m_calibrationUtil, SIGNAL(timeout(QString)), this, SLOT(calibrationTimeout(QString))); - m_levellingUtil->start(); + m_calibrationUtil->start(); } -void LevellingPage::levellingProgress(long current, long total) +void CCCalibrationPage::calibrationProgress(long current, long total) { if(ui->levellinProgressBar->maximum() != (int)total) { ui->levellinProgressBar->setMaximum((int)total); @@ -106,16 +105,16 @@ void LevellingPage::levellingProgress(long current, long total) } } -void LevellingPage::levellingDone(accelGyroBias bias) +void CCCalibrationPage::calibrationDone(accelGyroBias bias) { - stopLevelling(); + stopCalibration(); getWizard()->setLevellingBias(bias); emit completeChanged(); } -void LevellingPage::levellingTimeout(QString message) +void CCCalibrationPage::calibrationTimeout(QString message) { - stopLevelling(); + stopCalibration(); QMessageBox msgBox; msgBox.setText(message); @@ -124,13 +123,13 @@ void LevellingPage::levellingTimeout(QString message) msgBox.exec(); } -void LevellingPage::stopLevelling() +void CCCalibrationPage::stopCalibration() { - if(m_levellingUtil) + if(m_calibrationUtil) { - disconnect(m_levellingUtil, SIGNAL(progress(long,long)), this, SLOT(levellingProgress(long,long))); - disconnect(m_levellingUtil, SIGNAL(done(accelGyroBias)), this, SLOT(levellingDone(accelGyroBias))); - disconnect(m_levellingUtil, SIGNAL(timeout(QString)), this, SLOT(levellingTimeout(QString))); + disconnect(m_calibrationUtil, SIGNAL(progress(long,long)), this, SLOT(calibrationProgress(long,long))); + disconnect(m_calibrationUtil, SIGNAL(done(accelGyroBias)), this, SLOT(calibrationDone(accelGyroBias))); + disconnect(m_calibrationUtil, SIGNAL(timeout(QString)), this, SLOT(calibrationTimeout(QString))); ui->progressLabel->setText(QString(tr("Done!"))); enableButtons(true); } diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/levellingpage.h b/ground/openpilotgcs/src/plugins/setupwizard/pages/cccalibrationpage.h similarity index 66% rename from ground/openpilotgcs/src/plugins/setupwizard/pages/levellingpage.h rename to ground/openpilotgcs/src/plugins/setupwizard/pages/cccalibrationpage.h index 06b18ed75..bee647da7 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/levellingpage.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/cccalibrationpage.h @@ -1,11 +1,11 @@ /** ****************************************************************************** * - * @file levellingpage.h + * @file cccalibrationpage.h * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2012. * @addtogroup * @{ - * @addtogroup LevellingPage + * @addtogroup CCCalibrationPage * @{ * @brief *****************************************************************************/ @@ -25,41 +25,41 @@ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#ifndef LEVELLINGPAGE_H -#define LEVELLINGPAGE_H +#ifndef CCCALIBRATIONPAGE_H +#define CCCALIBRATIONPAGE_H #include "abstractwizardpage.h" -#include "levellingutil.h" +#include "cccalibrationutil.h" namespace Ui { -class LevellingPage; +class CCCalibrationPage; } -class LevellingPage : public AbstractWizardPage +class CCCalibrationPage : public AbstractWizardPage { Q_OBJECT public: - explicit LevellingPage(SetupWizard *wizard, QWidget *parent = 0); - ~LevellingPage(); + explicit CCCalibrationPage(SetupWizard *wizard, QWidget *parent = 0); + ~CCCalibrationPage(); bool validatePage(); bool isComplete() const; private slots: - void performLevelling(); - void levellingProgress(long current, long total); - void levellingDone(accelGyroBias bias); - void levellingTimeout(QString message); + void performCalibration(); + void calibrationProgress(long current, long total); + void calibrationDone(accelGyroBias bias); + void calibrationTimeout(QString message); private: static const int BIAS_CYCLES = 200; static const int BIAS_RATE = 30; - Ui::LevellingPage *ui; - LevellingUtil *m_levellingUtil; + Ui::CCCalibrationPage *ui; + CCCalibrationUtil *m_calibrationUtil; - void stopLevelling(); + void stopCalibration(); void enableButtons(bool enable); }; -#endif // LEVELLINGPAGE_H +#endif // CCCALIBRATIONPAGE_H diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/levellingpage.ui b/ground/openpilotgcs/src/plugins/setupwizard/pages/cccalibrationpage.ui similarity index 72% rename from ground/openpilotgcs/src/plugins/setupwizard/pages/levellingpage.ui rename to ground/openpilotgcs/src/plugins/setupwizard/pages/cccalibrationpage.ui index c257619ed..f2f8c7403 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/levellingpage.ui +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/cccalibrationpage.ui @@ -1,7 +1,7 @@ - LevellingPage - + CCCalibrationPage + 0 @@ -20,12 +20,12 @@ <!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:'Lucida Grande'; font-size:13pt; 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-family:'MS Shell Dlg 2'; font-size:12pt; font-weight:600;">OpenPilot controller leveling calibration procedure</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-family:'MS Shell Dlg 2'; font-size:12pt; font-weight:600;"></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'; font-size:10pt;">The wizard needs to get information from the controller to determine in which position the vehicle is normally considered to be level. To be able to successfully perform these measurements, you need to place the vehicle on a surface that is as flat and level as possible. Examples of such surfaces could be a table top or the floor. Be careful to ensure that the vehicle really is level, since this step will affect the accelerometer and gyro bias in the controller software.</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-family:'MS Shell Dlg 2'; font-size:10pt;"></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'; font-size:10pt;">To perform the leveling, please push the Calculate button and wait for the process to finish. </span></p></body></html> +</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;">OpenPilot controller sensor calibration procedure</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;">The wizard needs to get information from the controller to determine in which position the vehicle is normally considered to be level. To be able to successfully perform these measurements, you need to place the vehicle on a surface that is as flat and level as possible. Examples of such surfaces could be a table top or the floor. Be careful to ensure that the vehicle really is level, since this step will affect the accelerometer and gyro bias in the controller software.</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;">To perform the calibration, please push the Calculate button and wait for the process to finish. </span></p></body></html> Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop diff --git a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp index 642d2a3ba..70a2a9fc5 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/pages/outputcalibrationpage.cpp @@ -330,6 +330,7 @@ void OutputCalibrationPage::debugLogChannelValues() void OutputCalibrationPage::on_motorNeutralSlider_valueChanged(int value) { + Q_UNUSED(value); if(ui->motorNeutralButton->isChecked()) { quint16 value = ui->motorNeutralSlider->value(); m_calibrationUtil->setChannelOutputValue(value); @@ -348,6 +349,7 @@ void OutputCalibrationPage::on_servoCenterButton_toggled(bool checked) void OutputCalibrationPage::on_servoCenterSlider_valueChanged(int position) { + Q_UNUSED(position); if(ui->servoCenterButton->isChecked()) { quint16 value = ui->servoCenterSlider->value(); m_calibrationUtil->setChannelOutputValue(value); @@ -375,6 +377,7 @@ void OutputCalibrationPage::on_servoMinAngleButton_toggled(bool checked) void OutputCalibrationPage::on_servoMinAngleSlider_valueChanged(int position) { + Q_UNUSED(position); if(ui->servoMinAngleButton->isChecked()) { quint16 value = ui->servoMinAngleSlider->value(); m_calibrationUtil->setChannelOutputValue(value); @@ -393,6 +396,7 @@ void OutputCalibrationPage::on_servoMaxAngleButton_toggled(bool checked) void OutputCalibrationPage::on_servoMaxAngleSlider_valueChanged(int position) { + Q_UNUSED(position); if(ui->servoMaxAngleButton->isChecked()) { quint16 value = ui->servoMaxAngleSlider->value(); m_calibrationUtil->setChannelOutputValue(value); diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp index e3061f8ad..9ccc6d8ac 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.cpp @@ -36,7 +36,7 @@ #include "pages/surfacepage.h" #include "pages/inputpage.h" #include "pages/outputpage.h" -#include "pages/levellingpage.h" +#include "pages/cccalibrationpage.h" #include "pages/summarypage.h" #include "pages/savepage.h" #include "pages/notyetimplementedpage.h" @@ -117,12 +117,12 @@ int SetupWizard::nextId() const return PAGE_VEHICLES; case PAGE_OUTPUT: return PAGE_SUMMARY; - case PAGE_LEVELLING: - return PAGE_CALIBRATION; - case PAGE_CALIBRATION: + case PAGE_CC_CALIBRATION: + return PAGE_OUTPUT_CALIBRATION; + case PAGE_OUTPUT_CALIBRATION: return PAGE_SAVE; case PAGE_SUMMARY: - return PAGE_LEVELLING; + return PAGE_CC_CALIBRATION; case PAGE_SAVE: return PAGE_END; case PAGE_NOTYETIMPLEMENTED: @@ -275,8 +275,8 @@ void SetupWizard::createPages() setPage(PAGE_SURFACE, new SurfacePage(this)); setPage(PAGE_INPUT, new InputPage(this)); setPage(PAGE_OUTPUT, new OutputPage(this)); - setPage(PAGE_LEVELLING, new LevellingPage(this)); - setPage(PAGE_CALIBRATION, new OutputCalibrationPage(this)); + setPage(PAGE_CC_CALIBRATION, new CCCalibrationPage(this)); + setPage(PAGE_OUTPUT_CALIBRATION, new OutputCalibrationPage(this)); setPage(PAGE_SUMMARY, new SummaryPage(this)); setPage(PAGE_SAVE, new SavePage(this)); setPage(PAGE_REBOOT, new RebootPage(this)); @@ -295,7 +295,7 @@ void SetupWizard::createPages() void SetupWizard::customBackClicked() { - if(currentId() == PAGE_CALIBRATION) { + if(currentId() == PAGE_OUTPUT_CALIBRATION) { static_cast(currentPage())->customBackClicked(); } else { diff --git a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h index 5fe791522..0f04d085f 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.h @@ -29,7 +29,7 @@ #define SETUPWIZARD_H #include -#include "levellingutil.h" +#include "cccalibrationutil.h" #include #include #include "vehicleconfigurationsource.h" @@ -65,8 +65,8 @@ public: SetupWizard::RADIO_SETTING getRadioSetting() const {return m_radioSetting;} void setLevellingBias(accelGyroBias bias) { m_levellingBias = bias; m_levellingPerformed = true; } - bool isLevellingPerformed() const { return m_levellingPerformed; } - accelGyroBias getLevellingBias() const { return m_levellingBias; } + bool isCalibrationPerformed() const { return m_levellingPerformed; } + accelGyroBias getCalibrationBias() const { return m_levellingBias; } void setActuatorSettings(QList actuatorSettings) { m_actuatorSettings = actuatorSettings; } bool isMotorCalibrationPerformed() const { return m_motorCalibrationPerformed; } @@ -90,7 +90,7 @@ 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_LEVELLING, PAGE_CALIBRATION, + PAGE_HELI, PAGE_SURFACE, PAGE_INPUT, PAGE_OUTPUT, PAGE_CC_CALIBRATION, PAGE_OUTPUT_CALIBRATION, PAGE_SAVE, PAGE_SUMMARY, PAGE_NOTYETIMPLEMENTED, 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 2f1754541..215ab0143 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro +++ b/ground/openpilotgcs/src/plugins/setupwizard/setupwizard.pro @@ -25,8 +25,6 @@ HEADERS += setupwizardplugin.h \ pages/outputpage.h \ pages/inputpage.h \ pages/summarypage.h \ - pages/levellingpage.h \ - levellingutil.h \ vehicleconfigurationsource.h \ vehicleconfigurationhelper.h \ connectiondiagram.h \ @@ -34,7 +32,9 @@ HEADERS += setupwizardplugin.h \ outputcalibrationutil.h \ pages/rebootpage.h \ pages/savepage.h \ - pages/autoupdatepage.h + pages/autoupdatepage.h \ + pages/cccalibrationpage.h \ + cccalibrationutil.h SOURCES += setupwizardplugin.cpp \ setupwizard.cpp \ @@ -51,8 +51,6 @@ SOURCES += setupwizardplugin.cpp \ pages/outputpage.cpp \ pages/inputpage.cpp \ pages/summarypage.cpp \ - pages/levellingpage.cpp \ - levellingutil.cpp \ vehicleconfigurationsource.cpp \ vehicleconfigurationhelper.cpp \ connectiondiagram.cpp \ @@ -60,7 +58,9 @@ SOURCES += setupwizardplugin.cpp \ outputcalibrationutil.cpp \ pages/rebootpage.cpp \ pages/savepage.cpp \ - pages/autoupdatepage.cpp + pages/autoupdatepage.cpp \ + pages/cccalibrationpage.cpp \ + cccalibrationutil.cpp OTHER_FILES += SetupWizard.pluginspec @@ -77,12 +77,12 @@ FORMS += \ pages/outputpage.ui \ pages/inputpage.ui \ pages/summarypage.ui \ - pages/levellingpage.ui \ connectiondiagram.ui \ pages/outputcalibrationpage.ui \ pages/rebootpage.ui \ pages/savepage.ui \ - pages/autoupdatepage.ui + pages/autoupdatepage.ui \ + pages/cccalibrationpage.ui RESOURCES += \ wizardResources.qrc diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp index 82b09200f..59d7ab7d9 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationhelper.cpp @@ -332,9 +332,9 @@ void VehicleConfigurationHelper::applyLevellingConfiguration() AttitudeSettings* attitudeSettings = AttitudeSettings::GetInstance(m_uavoManager); Q_ASSERT(attitudeSettings); AttitudeSettings::DataFields data = attitudeSettings->getData(); - if(m_configSource->isLevellingPerformed()) + if(m_configSource->isCalibrationPerformed()) { - accelGyroBias bias = m_configSource->getLevellingBias(); + accelGyroBias bias = m_configSource->getCalibrationBias(); data.AccelBias[0] += bias.m_accelerometerXBias; data.AccelBias[1] += bias.m_accelerometerYBias; diff --git a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationsource.h b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationsource.h index ebe23a33f..a51dea708 100644 --- a/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationsource.h +++ b/ground/openpilotgcs/src/plugins/setupwizard/vehicleconfigurationsource.h @@ -77,8 +77,8 @@ public: virtual VehicleConfigurationSource::GPS_SETTING getGPSSetting() const = 0; virtual VehicleConfigurationSource::RADIO_SETTING getRadioSetting() const = 0; - virtual bool isLevellingPerformed() const = 0; - virtual accelGyroBias getLevellingBias() const = 0; + virtual bool isCalibrationPerformed() const = 0; + virtual accelGyroBias getCalibrationBias() const = 0; virtual bool isMotorCalibrationPerformed() const = 0; virtual QList getActuatorSettings() const = 0;