Commit 189135d4 authored by tstellanova's avatar tstellanova

Fixing inter-object wiring

parent e8c6dbb2
......@@ -13,6 +13,12 @@ QGCUASParamManager::QGCUASParamManager(UASInterface* uas, QWidget *parent) :
{
paramDataModel = uas->getParamDataModel();
uas->setParamManager(this);
// Connect retransmission guard
connect(this, SIGNAL(parameterUpdateRequested(int,QString)), this, SLOT(requestParameterUpdate(int,QString)));
connect(this, SIGNAL(parameterUpdateRequestedById(int,int)), mav, SLOT(requestParameter(int,int)));
}
......@@ -29,6 +35,10 @@ void QGCUASParamManager::requestParameterUpdate(int component, const QString& pa
}
}
/**
* Send a request to deliver the list of onboard parameters
* to the MAV.
......@@ -132,7 +142,7 @@ void QGCUASParamManager::retransmissionGuardTick()
if (count < retransmissionBurstRequestSize) {
//qDebug() << __FILE__ << __LINE__ << "RETRANSMISSION GUARD REQUESTS RETRANSMISSION OF PARAM #" << id << "FROM COMPONENT #" << component;
//TODO mavlink msg type for "request parameter set" ?
emit requestParameter(component, id);
emit parameterUpdateRequestedById(component, id);
setParameterStatusMsg(tr("Requested retransmission of #%1").arg(id+1));
count++;
} else {
......
......@@ -27,12 +27,13 @@ protected:
//TODO decouple this UI message display further
virtual void setParameterStatusMsg(const QString& msg);
signals:
void parameterChanged(int component, QString parameter, QVariant value);
void parameterChanged(int component, int parameterIndex, QVariant value);
void parameterListUpToDate(int component);
/** @brief Request a single parameter */
void requestParameter(int component, int parameter);
void parameterUpdateRequested(int component, const QString& parameter);
void parameterUpdateRequestedById(int componentId, int paramId);
public slots:
......@@ -43,8 +44,7 @@ public slots:
/** @brief Check for missing parameters */
virtual void retransmissionGuardTick();
/** @brief Request one single parameter */
/** @brief Request a single parameter by name */
virtual void requestParameterUpdate(int component, const QString& parameter);
protected:
......
......@@ -280,6 +280,7 @@ void UASManager::addUAS(UASInterface* uas)
// Only execute if there is no UAS at this index
if (!systems.contains(uas))
{
qDebug() << "Add new UAS: " << uas->getUASID();
systems.append(uas);
// Set home position on UAV if set in UI
// - this is done on a per-UAV basis
......
......@@ -91,8 +91,9 @@ void ParameterInterface::selectUAS(int index)
void ParameterInterface::addUAS(UASInterface* uas)
{
int uasId = uas->getUASID();
qDebug() << "ParameterInterface::addUAS : " << uasId ;
if (paramWidgets->contains(uasId) ) {
qDebug() << "Already have QGCParamWidget for: " << uasId ;
return;
}
......
......@@ -144,11 +144,15 @@ QGCParamWidget::QGCParamWidget(UASInterface* uas, QWidget *parent) :
// New parameters from UAS
connect(uas, SIGNAL(parameterChanged(int,int,int,int,QString,QVariant)), this, SLOT(receivedParameterUpdate(int,int,int,int,QString,QVariant)));
// Connect retransmission guard
connect(this, SIGNAL(requestParameterByName(int,QString)), uas, SLOT(requestParameterByName(int,QString)));
connect(this, SIGNAL(requestParameterByName(int,int)), uas, SLOT(requestParameterByName(int,int)));
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)));
// Get parameters
if (uas) {
requestAllParamsUpdate();
......
......@@ -59,6 +59,7 @@ signals:
/** @brief A parameter was changed in the widget, NOT onboard */
//void parameterChanged(int component, QString parametername, float value); // defined in QGCUASParamManager already
public slots:
/** @brief Add a component to the list */
void addComponentItem(int uas, int component, QString componentName);
......@@ -69,7 +70,7 @@ public slots:
/** @brief Request list of parameters from MAV */
void requestAllParamsUpdate();
/** @brief Set one parameter, changes value in RAM of MAV */
void setParameter(int component, QString parameterName, QVariant value);
virtual void setParameter(int component, QString parameterName, QVariant value);
/** @brief Set all parameters, changes the value in RAM of MAV */
void setParameters();
/** @brief Write the current parameters to permanent storage (EEPROM/HDD) */
......
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