From 190b1d8a4682a851fd713582839321f1a7ed19cb Mon Sep 17 00:00:00 2001 From: Don Gagne Date: Sat, 28 Dec 2013 13:43:14 -0800 Subject: [PATCH] Modify consumers of UASManager and QGCUASParamManager to use new interfaces --- src/uas/UAS.h | 3 ++- src/uas/UASInterface.h | 4 ++-- src/uas/UASParameterCommsMgr.cc | 2 +- src/ui/QGCBaseParamWidget.cc | 4 ++-- src/ui/QGCBaseParamWidget.h | 4 ++-- src/ui/QGCPX4VehicleConfig.h | 2 +- src/ui/QGCVehicleConfig.h | 2 +- src/ui/configuration/FrameTypeConfig.h | 4 +--- src/ui/designer/QGCComboBox.h | 4 ++-- src/ui/map/QGCMapWidget.cc | 2 +- src/ui/px4_configuration/QGCPX4AirframeConfig.h | 2 +- 11 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/uas/UAS.h b/src/uas/UAS.h index 69dc66749..6ea24ad2e 100644 --- a/src/uas/UAS.h +++ b/src/uas/UAS.h @@ -40,6 +40,7 @@ This file is part of the QGROUNDCONTROL project #include "QGCFlightGearLink.h" #include "QGCJSBSimLink.h" #include "QGCXPlaneLink.h" +#include "QGCUASParamManager.h" /** @@ -542,7 +543,7 @@ public: } /** @brief Get reference to the param manager **/ - virtual QGCUASParamManager* getParamManager() { + virtual QGCUASParamManagerInterface* getParamManager() { return ¶mMgr; } diff --git a/src/uas/UASInterface.h b/src/uas/UASInterface.h index c5473df35..e3d59cfc7 100644 --- a/src/uas/UASInterface.h +++ b/src/uas/UASInterface.h @@ -42,7 +42,7 @@ This file is part of the QGROUNDCONTROL project #include "ProtocolInterface.h" #include "UASParameterDataModel.h" #include "UASWaypointManager.h" -#include "QGCUASParamManager.h" +#include "QGCUASParamManagerInterface.h" #include "RadioCalibration/RadioCalibrationData.h" #ifdef QGC_PROTOBUF_ENABLED @@ -156,7 +156,7 @@ public: virtual UASWaypointManager* getWaypointManager(void) = 0; /** @brief Get reference to the param manager **/ - virtual QGCUASParamManager* getParamManager() = 0; + virtual QGCUASParamManagerInterface* getParamManager() = 0; /* COMMUNICATION FLAGS */ diff --git a/src/uas/UASParameterCommsMgr.cc b/src/uas/UASParameterCommsMgr.cc index fe7383d9a..e52b9a83c 100644 --- a/src/uas/UASParameterCommsMgr.cc +++ b/src/uas/UASParameterCommsMgr.cc @@ -2,7 +2,7 @@ #include -#include "QGCUASParamManager.h" +#include "QGCUASParamManagerInterface.h" #include "UASInterface.h" diff --git a/src/ui/QGCBaseParamWidget.cc b/src/ui/QGCBaseParamWidget.cc index f1d8d60a7..29067803b 100644 --- a/src/ui/QGCBaseParamWidget.cc +++ b/src/ui/QGCBaseParamWidget.cc @@ -3,9 +3,9 @@ #include #include #include -#include > +#include -#include "QGCUASParamManager.h" +#include "QGCUASParamManagerInterface.h" #include "UASInterface.h" diff --git a/src/ui/QGCBaseParamWidget.h b/src/ui/QGCBaseParamWidget.h index e9e1309d3..ffb0e9125 100644 --- a/src/ui/QGCBaseParamWidget.h +++ b/src/ui/QGCBaseParamWidget.h @@ -8,7 +8,7 @@ //forward declarations -class QGCUASParamManager; +class QGCUASParamManagerInterface; class UASInterface; @@ -50,7 +50,7 @@ public slots: virtual void loadParametersFromFile(); protected: - QGCUASParamManager* paramMgr; + QGCUASParamManagerInterface* paramMgr; UASInterface* mav; QString updatingParamNameLock; ///< Name of param currently being updated-- used for reducing echo on param change diff --git a/src/ui/QGCPX4VehicleConfig.h b/src/ui/QGCPX4VehicleConfig.h index 55778bc3a..4e287721b 100644 --- a/src/ui/QGCPX4VehicleConfig.h +++ b/src/ui/QGCPX4VehicleConfig.h @@ -276,7 +276,7 @@ protected: bool doneLoadingConfig; UASInterface* mav; ///< The current MAV - QGCUASParamManager* paramMgr; ///< params mgr for the mav + QGCUASParamManagerInterface* paramMgr; ///< params mgr for the mav static const unsigned int chanMax = 14; ///< Maximum number of channels static const unsigned int chanMappedMax = 16; ///< Maximum number of mapped channels (can be higher than input channel count) unsigned int chanCount; ///< Actual channels diff --git a/src/ui/QGCVehicleConfig.h b/src/ui/QGCVehicleConfig.h index d63e32f4f..2d4bf992d 100644 --- a/src/ui/QGCVehicleConfig.h +++ b/src/ui/QGCVehicleConfig.h @@ -158,7 +158,7 @@ protected slots: protected: bool doneLoadingConfig; UASInterface* mav; ///< The current MAV - QGCUASParamManager* paramMgr; ///< params mgr for the mav + QGCUASParamManagerInterface* paramMgr; ///< params mgr for the mav static const unsigned int chanMax = 8; ///< Maximum number of channels unsigned int chanCount; ///< Actual channels int rcType; ///< Type of the remote control diff --git a/src/ui/configuration/FrameTypeConfig.h b/src/ui/configuration/FrameTypeConfig.h index 92d04b95c..f52e92369 100644 --- a/src/ui/configuration/FrameTypeConfig.h +++ b/src/ui/configuration/FrameTypeConfig.h @@ -34,10 +34,8 @@ This file is part of the QGROUNDCONTROL project #include #include "ui_FrameTypeConfig.h" -#include "UASInterface.h" -#include "UASManager.h" -#include "QGCUASParamManager.h" #include "AP2ConfigWidget.h" + class FrameTypeConfig : public AP2ConfigWidget { Q_OBJECT diff --git a/src/ui/designer/QGCComboBox.h b/src/ui/designer/QGCComboBox.h index 2e606a559..a698e1f0e 100644 --- a/src/ui/designer/QGCComboBox.h +++ b/src/ui/designer/QGCComboBox.h @@ -7,7 +7,7 @@ #include "QGCToolWidgetItem.h" -class QGCUASParamManager; +class QGCUASParamManagerInterface; namespace Ui { @@ -52,7 +52,7 @@ protected slots: /** @brief Updates current parameter based on new combobox value */ void comboBoxIndexChanged(QString val); protected: - QGCUASParamManager *paramMgr; ///< Access to parameter manager + QGCUASParamManagerInterface *paramMgr; ///< Access to parameter manager bool visibleEnabled; QString visibleParam; int visibleVal; diff --git a/src/ui/map/QGCMapWidget.cc b/src/ui/map/QGCMapWidget.cc index 4fd49034a..89e56c408 100644 --- a/src/ui/map/QGCMapWidget.cc +++ b/src/ui/map/QGCMapWidget.cc @@ -134,7 +134,7 @@ bool QGCMapWidget::setHomeActionTriggered() QMessageBox::information(0,"Error","Please connect first"); return false; } - UASManager *uasManager = UASManager::instance(); + UASManagerInterface *uasManager = UASManager::instance(); if (!uasManager) { return false; } // Enter an altitude diff --git a/src/ui/px4_configuration/QGCPX4AirframeConfig.h b/src/ui/px4_configuration/QGCPX4AirframeConfig.h index dcbf4abc1..4e4e52a9a 100644 --- a/src/ui/px4_configuration/QGCPX4AirframeConfig.h +++ b/src/ui/px4_configuration/QGCPX4AirframeConfig.h @@ -97,7 +97,7 @@ protected: private: UASInterface* mav; - QGCUASParamManager *paramMgr; + QGCUASParamManagerInterface *paramMgr; QProgressDialog* progress; unsigned pendingParams; enum CONFIG_STATE configState; -- 2.22.0