Commit abed8afe authored by tstellanova's avatar tstellanova

fixing signals / slots

parent 4e19c3a0
......@@ -18,9 +18,9 @@ QGCUASParamManager::QGCUASParamManager(UASInterface* uas, QWidget *parent) :
loadParamMetaInfoCSV();
// Connect retransmission guard
connect(this, SIGNAL(parameterUpdateRequested(int,QString)),
this, SLOT(requestParameterUpdate(int,QString)));
// // Connect retransmission guard
// connect(this, SIGNAL(parameterUpdateRequested(int,QString)),
// this, SLOT(requestParameterUpdate(int,QString)));
// //TODO connect in paramCommsMgr instead
// connect(this, SIGNAL(parameterUpdateRequestedById(int,int)),
......@@ -28,10 +28,10 @@ QGCUASParamManager::QGCUASParamManager(UASInterface* uas, QWidget *parent) :
// New parameters from UAS
void parameterUpdated(int compId, int paramId, QString paramName, QVariant value);
void parameterUpdated(int compId, QString paramName, QVariant value);
connect(paramDataModel, SIGNAL(parameterUpdated(int, int, QString , QVariant )),
this, SLOT(handleParameterUpdate(int,int,int,QString,QVariant)));
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)));
......
......@@ -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 paramCount, int paramId, const QString& parameterName, QVariant value) = 0;
virtual void handleParameterUpdate(int component, int paramId, const QString& parameterName, QVariant value) = 0;
virtual void handleParameterListUpToDate() = 0;
......
......@@ -114,12 +114,12 @@ void UASParameterDataModel::addComponent(int compId)
}
void UASParameterDataModel::handleParameterUpdate(int componentId, QString& key, QVariant& value)
void UASParameterDataModel::handleParameterUpdate(int compId, QString& key, QVariant& value)
{
//verify that the value requested by the user matches the set value
//if it doesn't match, leave the pending parameter in the pending list!
if (pendingParameters.contains(componentId)) {
QMap<QString , QVariant> *pendingParams = pendingParameters.value(componentId);
if (pendingParameters.contains(compId)) {
QMap<QString , QVariant> *pendingParams = pendingParameters.value(compId);
if ((NULL != pendingParams) && pendingParams->contains(key)) {
QVariant reqVal = pendingParams->value(key);
if (reqVal == value) {
......@@ -131,7 +131,10 @@ void UASParameterDataModel::handleParameterUpdate(int componentId, QString& key,
}
}
setOnboardParameter(componentId,key, value);
setOnboardParameter(compId,key,value);
emit parameterUpdated(compId,key,value);
}
bool UASParameterDataModel::getOnboardParameterValue(int componentId, const QString& key, QVariant& value) const
......
......@@ -87,7 +87,8 @@ public:
signals:
void parameterUpdated(int compId, int paramId, QString paramName, QVariant value);
/** @brief We've received an update of a parameter's value */
void parameterUpdated(int compId, QString paramName, QVariant value);
public slots:
......
......@@ -331,9 +331,8 @@ void QGCParamWidget::addComponentItem( int compId, QString compName)
//}
void QGCParamWidget::handleParameterUpdate(int componentId, int paramCount, int paramId, const QString& paramName, QVariant value)
void QGCParamWidget::handleParameterUpdate(int componentId, int paramId, const QString& paramName, QVariant value)
{
Q_UNUSED(paramCount);
Q_UNUSED(paramId);
updateParameterDisplay(componentId, paramName, value);
}
......
......@@ -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 paramCount, int paramId, const QString& parameterName, QVariant value);
virtual void handleParameterUpdate(int component, int paramId, const QString& parameterName, QVariant value);
virtual void handleParameterListUpToDate();
virtual void handleParamStatusMsgUpdate(QString msg, int level);
......
......@@ -149,7 +149,7 @@ void UASListWidget::addUAS(UASInterface* uas)
QList<LinkInterface*>* x = uas->getLinks();
if (x->size())
{
LinkInterface* li = x->at(0);
LinkInterface* li = x->first();
// Find an existing QGroupBox for this LinkInterface or create a
// new one.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment