From 73ce117b9ed78bf7a8d35a104a8b6cd0ffd025c3 Mon Sep 17 00:00:00 2001 From: tstellanova Date: Wed, 7 Aug 2013 18:45:50 -0700 Subject: [PATCH] More signal /slot fixes --- src/uas/QGCUASParamManager.cc | 5 ----- src/uas/QGCUASParamManager.h | 2 +- src/ui/QGCParamWidget.cc | 21 +++++++++++++++------ src/ui/QGCParamWidget.h | 2 +- 4 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/uas/QGCUASParamManager.cc b/src/uas/QGCUASParamManager.cc index 450fe7970..f1cc5fd20 100644 --- a/src/uas/QGCUASParamManager.cc +++ b/src/uas/QGCUASParamManager.cc @@ -30,16 +30,11 @@ QGCUASParamManager::QGCUASParamManager(UASInterface* uas, QWidget *parent) : void parameterUpdated(int compId, QString paramName, QVariant value); - connect(paramDataModel, SIGNAL(parameterUpdated(int, QString , QVariant )), - this, SLOT(handleParameterUpdate(int,QString,QVariant))); // connect(uas, SIGNAL(parameterChanged(int,int,int,int,QString,QVariant)), // this, SLOT(receivedParameterUpdate(int,int,int,int,QString,QVariant))); - // Listen for param list reload finished - connect(paramCommsMgr, SIGNAL(parameterListUpToDate()), - this, SLOT(handleParameterListUpToDate())); diff --git a/src/uas/QGCUASParamManager.h b/src/uas/QGCUASParamManager.h index 4cb6d446c..a5c4b40f2 100644 --- a/src/uas/QGCUASParamManager.h +++ b/src/uas/QGCUASParamManager.h @@ -52,7 +52,7 @@ public slots: /** @brief Request a single parameter by name from the MAV */ virtual void requestParameterUpdate(int component, const QString& parameter); - virtual void handleParameterUpdate(int component, int paramId, const QString& parameterName, QVariant value) = 0; + virtual void handleParameterUpdate(int component, const QString& parameterName, QVariant value) = 0; virtual void handleParameterListUpToDate() = 0; diff --git a/src/ui/QGCParamWidget.cc b/src/ui/QGCParamWidget.cc index 5b4b13723..5ec85bceb 100644 --- a/src/ui/QGCParamWidget.cc +++ b/src/ui/QGCParamWidget.cc @@ -133,17 +133,27 @@ QGCParamWidget::QGCParamWidget(UASInterface* uas, QWidget *parent) : tree->setExpandsOnDoubleClick(true); // Connect signals/slots - connect(this, SIGNAL(parameterChanged(int,QString,QVariant)), mav, SLOT(setParameter(int,QString,QVariant))); - connect(tree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), this, SLOT(parameterItemChanged(QTreeWidgetItem*,int))); +// connect(this, SIGNAL(parameterChanged(int,QString,QVariant)), +// mav, SLOT(setParameter(int,QString,QVariant))); + connect(tree, SIGNAL(itemChanged(QTreeWidgetItem*,int)), + this, SLOT(parameterItemChanged(QTreeWidgetItem*,int))); - // New parameters from UAS - connect(uas, SIGNAL(parameterChanged(int,int,int,int,QString,QVariant)), this, SLOT(receivedParameterUpdate(int,int,int,int,QString,QVariant))); +// // New parameters from UAS +// connect(uas, SIGNAL(parameterChanged(int,int,int,int,QString,QVariant)), this, SLOT(receivedParameterUpdate(int,int,int,int,QString,QVariant))); // connect(&retransmissionTimer, SIGNAL(timeout()), this, SLOT(retransmissionGuardTick())); // connect(this, SIGNAL(requestParameter(int,QString)), uas, SLOT(requestParameter(int,QString))); // connect(this, SIGNAL(requestParameter(int,int)), uas, SLOT(requestParameter(int,int))); + + connect(paramDataModel, SIGNAL(parameterUpdated(int, QString , QVariant )), + this, SLOT(handleParameterUpdate(int,QString,QVariant))); + + // Listen for param list reload finished + connect(paramCommsMgr, SIGNAL(parameterListUpToDate()), + this, SLOT(handleParameterListUpToDate())); + // Get parameters if (uas) { requestAllParamsUpdate(); @@ -331,9 +341,8 @@ void QGCParamWidget::addComponentItem( int compId, QString compName) //} -void QGCParamWidget::handleParameterUpdate(int componentId, int paramId, const QString& paramName, QVariant value) +void QGCParamWidget::handleParameterUpdate(int componentId, const QString& paramName, QVariant value) { - Q_UNUSED(paramId); updateParameterDisplay(componentId, paramName, value); } diff --git a/src/ui/QGCParamWidget.h b/src/ui/QGCParamWidget.h index 49ae50740..5a356b722 100644 --- a/src/ui/QGCParamWidget.h +++ b/src/ui/QGCParamWidget.h @@ -67,7 +67,7 @@ public slots: /** @brief Add a parameter to the list with retransmission / safety checks */ // void receivedParameterUpdate(int uas, int component, int paramCount, int paramId, QString parameterName, QVariant value); - virtual void handleParameterUpdate(int component, int paramId, const QString& parameterName, QVariant value); + virtual void handleParameterUpdate(int component,const QString& parameterName, QVariant value); virtual void handleParameterListUpToDate(); virtual void handleParamStatusMsgUpdate(QString msg, int level); -- 2.22.0