From a24fd253b4f0218e9af5ed5173865ec9c33a9a8d Mon Sep 17 00:00:00 2001 From: m_thread Date: Tue, 3 Feb 2015 22:24:57 +0100 Subject: [PATCH] OP-1628 Fixed review comments. --- .../src/plugins/uploader/oplinkwatchdog.cpp | 26 +++++++++---------- .../src/plugins/uploader/oplinkwatchdog.h | 12 ++++----- .../plugins/uploader/uploadergadgetwidget.cpp | 12 ++++----- .../plugins/uploader/uploadergadgetwidget.h | 2 +- 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ground/openpilotgcs/src/plugins/uploader/oplinkwatchdog.cpp b/ground/openpilotgcs/src/plugins/uploader/oplinkwatchdog.cpp index b0e66a010..b8370171c 100644 --- a/ground/openpilotgcs/src/plugins/uploader/oplinkwatchdog.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/oplinkwatchdog.cpp @@ -38,9 +38,9 @@ OPLinkWatchdog::OPLinkWatchdog() : QObject(), Q_ASSERT(pm); UAVObjectManager *objManager = pm->getObject(); Q_ASSERT(objManager); - m_oplinkStatus = OPLinkStatus::GetInstance(objManager); - Q_ASSERT(m_oplinkStatus); - connect(m_oplinkStatus, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(onOPLinkStatusUpdate())); + m_opLinkStatus = OPLinkStatus::GetInstance(objManager); + Q_ASSERT(m_opLinkStatus); + connect(m_opLinkStatus, SIGNAL(objectUpdated(UAVObject*)), this, SLOT(onOPLinkStatusUpdate())); m_watchdog = new QTimer(this); connect(m_watchdog, SIGNAL(timeout()), this, SLOT(onTimeout())); onOPLinkStatusUpdate(); @@ -53,38 +53,38 @@ OPLinkWatchdog::~OPLinkWatchdog() void OPLinkWatchdog::onOPLinkStatusUpdate() { m_watchdog->stop(); - quint8 type = m_oplinkStatus->getBoardType(); + quint8 type = m_opLinkStatus->getBoardType(); if (!m_isConnected) { switch (type) { case 3: - m_oplinkType = OPLINK_STANDALONE; + m_opLinkType = OPLINK_MINI; m_isConnected = true; emit connected(); - emit standaloneConnected(); + emit opLinkMiniConnected(); break; case 9: - m_oplinkType = OPLINK_REVOLUTION; + m_opLinkType = OPLINK_REVOLUTION; m_isConnected = true; emit connected(); - emit revolutionConnected(); + emit opLinkRevolutionConnected(); break; default: m_isConnected = false; - m_oplinkType = OPLINK_UNKNOWN; + m_opLinkType = OPLINK_UNKNOWN; return; } - qDebug() << "OPLink connected"; + qDebug() << "OPLinkWatchdog - OPLink connected"; } - m_watchdog->start(m_oplinkStatus->getMetadata().flightTelemetryUpdatePeriod * 3); + m_watchdog->start(m_opLinkStatus->getMetadata().flightTelemetryUpdatePeriod * 3); } void OPLinkWatchdog::onTimeout() { if (m_isConnected) { m_isConnected = false; - m_oplinkType = OPLINK_UNKNOWN; - qDebug() << "OPLink disconnected"; + m_opLinkType = OPLINK_UNKNOWN; + qDebug() << "OPLinkWatchdog - OPLink disconnected"; emit disconnected(); } } diff --git a/ground/openpilotgcs/src/plugins/uploader/oplinkwatchdog.h b/ground/openpilotgcs/src/plugins/uploader/oplinkwatchdog.h index 4e4544410..a215c1db9 100644 --- a/ground/openpilotgcs/src/plugins/uploader/oplinkwatchdog.h +++ b/ground/openpilotgcs/src/plugins/uploader/oplinkwatchdog.h @@ -35,7 +35,7 @@ class OPLinkWatchdog : public QObject { Q_OBJECT public: enum OPLinkType { - OPLINK_STANDALONE, + OPLINK_MINI, OPLINK_REVOLUTION, OPLINK_UNKNOWN }; @@ -43,12 +43,12 @@ public: OPLinkWatchdog(); ~OPLinkWatchdog(); bool isConnected() const { return m_isConnected; } - OPLinkWatchdog::OPLinkType oplinkType() const { return m_oplinkType; } + OPLinkWatchdog::OPLinkType opLinkType() const { return m_opLinkType; } signals: void connected(); - void standaloneConnected(); - void revolutionConnected(); + void opLinkMiniConnected(); + void opLinkRevolutionConnected(); void disconnected(); private slots: @@ -57,8 +57,8 @@ private slots: private: bool m_isConnected; - OPLinkType m_oplinkType; + OPLinkType m_opLinkType; QTimer* m_watchdog; - OPLinkStatus* m_oplinkStatus; + OPLinkStatus* m_opLinkStatus; }; #endif // OPLINKWATCHDOG_H diff --git a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp index c28bcd7e2..f47ddd4f1 100644 --- a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp +++ b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.cpp @@ -142,7 +142,7 @@ UploaderGadgetWidget::UploaderGadgetWidget(QWidget *parent) : QWidget(parent) m_currentIAPStep = IAP_STATE_READY; m_resetOnly = false; m_dfu = NULL; - m_autoupdateClosing = false; + m_autoUpdateClosing = false; // Listen to autopilot connection events ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance(); @@ -673,8 +673,8 @@ bool UploaderGadgetWidget::autoUpdateCapable() bool UploaderGadgetWidget::autoUpdate(bool erase) { if (m_oplinkwatchdog.isConnected() && - m_oplinkwatchdog.oplinkType() == OPLinkWatchdog::OPLINK_STANDALONE) { - emit progressUpdate(FAILURE, QVariant(tr("To upgrade OPLink board please disconnect it from the USB port, " + m_oplinkwatchdog.opLinkType() == OPLinkWatchdog::OPLINK_MINI) { + emit progressUpdate(FAILURE, QVariant(tr("To upgrade the OPLinkMini board please disconnect it from the USB port, " "press the Upgrade again button and follow instructions on screen."))); emit autoUpdateFailed(); return false; @@ -1028,7 +1028,7 @@ void UploaderGadgetWidget::finishAutoUpdate() { disconnect(this, SIGNAL(progressUpdate(uploader::ProgressStep, QVariant)), this, SLOT(autoUpdateStatus(uploader::ProgressStep, QVariant))); m_config->autoUpdateOkButton->setEnabled(true); - m_autoupdateClosing = true; + m_autoUpdateClosing = true; // wait a bit and "close" auto update QTimer::singleShot(AUTOUPDATE_CLOSE_TIMEOUT, this, SLOT(closeAutoUpdate())); @@ -1036,12 +1036,12 @@ void UploaderGadgetWidget::finishAutoUpdate() void UploaderGadgetWidget::closeAutoUpdate() { - if (m_autoupdateClosing) { + if (m_autoUpdateClosing) { m_config->autoUpdateGroupBox->setVisible(false); m_config->buttonFrame->setEnabled(true); m_config->splitter->setEnabled(true); } - m_autoupdateClosing = false; + m_autoUpdateClosing = false; } void UploaderGadgetWidget::autoUpdateStatus(uploader::ProgressStep status, QVariant value) diff --git a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.h b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.h index e0baed025..2ef3c8d09 100644 --- a/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.h +++ b/ground/openpilotgcs/src/plugins/uploader/uploadergadgetwidget.h @@ -147,7 +147,7 @@ private: IAPStep m_currentIAPStep; bool m_resetOnly; OPLinkWatchdog m_oplinkwatchdog; - bool m_autoupdateClosing; + bool m_autoUpdateClosing; void clearLog(); QString getPortDevice(const QString &friendName);