Commit 5a69605a authored by tstellanova's avatar tstellanova

Fix param widget init

parent f1b83268
...@@ -20,8 +20,6 @@ QGCBaseParamWidget::QGCBaseParamWidget(QWidget *parent) : ...@@ -20,8 +20,6 @@ QGCBaseParamWidget::QGCBaseParamWidget(QWidget *parent) :
QGCBaseParamWidget* QGCBaseParamWidget::initWithUAS(UASInterface *uas) QGCBaseParamWidget* QGCBaseParamWidget::initWithUAS(UASInterface *uas)
{ {
setUAS(uas); setUAS(uas);
layoutWidget();
return this; return this;
} }
...@@ -34,11 +32,16 @@ void QGCBaseParamWidget::setUAS(UASInterface* uas) ...@@ -34,11 +32,16 @@ void QGCBaseParamWidget::setUAS(UASInterface* uas)
clearOnboardParamDisplay(); clearOnboardParamDisplay();
clearPendingParamDisplay(); clearPendingParamDisplay();
} }
mav = uas; mav = uas;
if (mav) {
connectToParamManager(); connectToParamManager();
connectViewSignalsAndSlots(); connectViewSignalsAndSlots();
layoutWidget();
paramMgr->requestParameterListIfEmpty(); paramMgr->requestParameterListIfEmpty();
}
} }
......
...@@ -85,8 +85,13 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) : ...@@ -85,8 +85,13 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) :
//TODO connect buttons here to save/clear actions? //TODO connect buttons here to save/clear actions?
mav = UASManager::instance()->getActiveUAS(); mav = UASManager::instance()->getActiveUAS();
if (!mav) {
qWarning() << "No active mav! ";
}
else {
ui->pendingCommitsWidget->initWithUAS(mav); ui->pendingCommitsWidget->initWithUAS(mav);
ui->pendingCommitsWidget->update(); ui->pendingCommitsWidget->update();
}
//TODO the following methods are not yet implemented //TODO the following methods are not yet implemented
...@@ -872,6 +877,8 @@ void QGCPX4VehicleConfig::setActiveUAS(UASInterface* active) ...@@ -872,6 +877,8 @@ void QGCPX4VehicleConfig::setActiveUAS(UASInterface* active)
paramMgr = mav->getParamManager(); paramMgr = mav->getParamManager();
ui->pendingCommitsWidget->setUAS(mav);
// Reset current state // Reset current state
resetCalibrationRC(); resetCalibrationRC();
//TODO eliminate the separate RC_TYPE call //TODO eliminate the separate RC_TYPE call
......
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