From 39eb564f6159f80fd9feb9b9a061a2688dcb5634 Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Mon, 8 Dec 2014 14:25:28 -0800 Subject: [PATCH] Removed UAS::requestParameters method This removes confusion as to whether you call UAS::requestParameters (incorrect) or QGCUASParamManager::requestParameterList (correct) from client code. --- src/qgcunittest/MockUAS.h | 1 - src/uas/QGCUASParamManager.cc | 2 ++ src/uas/UAS.cc | 10 ---------- src/uas/UAS.h | 3 --- src/uas/UASInterface.h | 2 -- 5 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/qgcunittest/MockUAS.h b/src/qgcunittest/MockUAS.h index b6bda6975..e9a48d9de 100644 --- a/src/qgcunittest/MockUAS.h +++ b/src/qgcunittest/MockUAS.h @@ -133,7 +133,6 @@ public slots: virtual void setTargetPosition(float x, float y, float z, float yaw) { Q_UNUSED(x); Q_UNUSED(y); Q_UNUSED(z); Q_UNUSED(yaw); Q_ASSERT(false); }; virtual void setLocalOriginAtCurrentGPSPosition() { Q_ASSERT(false); }; virtual void setHomePosition(double lat, double lon, double alt) { Q_UNUSED(lat); Q_UNUSED(lon); Q_UNUSED(alt); Q_ASSERT(false); }; - virtual void requestParameters() { Q_ASSERT(false); }; virtual void requestParameter(int component, const QString& parameter) { Q_UNUSED(component); Q_UNUSED(parameter); Q_ASSERT(false); }; virtual void writeParametersToStorage() { Q_ASSERT(false); }; virtual void readParametersFromStorage() { Q_ASSERT(false); }; diff --git a/src/uas/QGCUASParamManager.cc b/src/uas/QGCUASParamManager.cc index 7212d9caa..f1de5ab4f 100644 --- a/src/uas/QGCUASParamManager.cc +++ b/src/uas/QGCUASParamManager.cc @@ -217,6 +217,8 @@ void QGCUASParamManager::requestRcCalibrationParamsUpdate() { void QGCUASParamManager::_parameterListUpToDate(void) { + qDebug() << "Emitting parameters ready, count:" << paramDataModel.countOnboardParams(); + _parametersReady = true; emit parameterListUpToDate(); } diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 1e7f16d0e..29a618e0e 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -1968,16 +1968,6 @@ int UAS::getCommunicationStatus() const return commStatus; } -void UAS::requestParameters() -{ - mavlink_message_t msg; - mavlink_msg_param_request_list_pack(mavlink->getSystemId(), mavlink->getComponentId(), &msg, this->getUASID(), MAV_COMP_ID_ALL); - sendMessage(msg); - - QDateTime time = QDateTime::currentDateTime(); - qDebug() << __FILE__ << ":" << __LINE__ << time.toString() << "LOADING PARAM LIST"; -} - void UAS::writeParametersToStorage() { mavlink_message_t msg; diff --git a/src/uas/UAS.h b/src/uas/UAS.h index a359de316..ed203a81a 100644 --- a/src/uas/UAS.h +++ b/src/uas/UAS.h @@ -830,9 +830,6 @@ public slots: /** @brief Set current mode of operation, e.g. auto or manual, does not check the arming status, for anything else than arming/disarming operations use setMode instead */ void setModeArm(uint8_t newBaseMode, uint32_t newCustomMode); - /** @brief Request all parameters */ - void requestParameters(); - /** @brief Request a single parameter by name */ void requestParameter(int component, const QString& parameter); /** @brief Request a single parameter by index */ diff --git a/src/uas/UASInterface.h b/src/uas/UASInterface.h index 2d7beb74a..6a6b56660 100644 --- a/src/uas/UASInterface.h +++ b/src/uas/UASInterface.h @@ -315,8 +315,6 @@ public slots: virtual void setLocalOriginAtCurrentGPSPosition() = 0; /** @brief Set world frame origin / home position at this GPS position */ virtual void setHomePosition(double lat, double lon, double alt) = 0; - /** @brief Request all onboard parameters of all components */ - virtual void requestParameters() = 0; /** @brief Request one specific onboard parameter */ virtual void requestParameter(int component, const QString& parameter) = 0; /** @brief Write parameter to permanent storage */ -- 2.22.0