diff --git a/files/images/px4/airframes/flying_wing.png b/files/images/px4/airframes/flying_wing.png new file mode 100644 index 0000000000000000000000000000000000000000..b5baa87dd2b6fc1366feaac3ee43b3eea6947280 Binary files /dev/null and b/files/images/px4/airframes/flying_wing.png differ diff --git a/files/images/px4/airframes/plane_aert.png b/files/images/px4/airframes/plane_aert.png new file mode 100644 index 0000000000000000000000000000000000000000..583d08d01d25dea95eff062b8eef00ba35668d53 Binary files /dev/null and b/files/images/px4/airframes/plane_aert.png differ diff --git a/files/images/px4/airframes/plane_ert.png b/files/images/px4/airframes/plane_ert.png new file mode 100644 index 0000000000000000000000000000000000000000..64d82d2cbf0793a19f40c19739274b8b095726f8 Binary files /dev/null and b/files/images/px4/airframes/plane_ert.png differ diff --git a/qgroundcontrol.pro b/qgroundcontrol.pro index 371688a7f8120e9e64f259c228520a57e7d832d8..383e00dae2e74b4fee37b7efe55233798b3a36aa 100644 --- a/qgroundcontrol.pro +++ b/qgroundcontrol.pro @@ -404,8 +404,7 @@ HEADERS += src/MG.h \ src/ui/QGCMAVLinkInspector.h \ src/ui/MAVLinkDecoder.h \ src/ui/WaypointViewOnlyView.h \ - src/ui/WaypointEditableView.h \ - src/ui/UnconnectedUASInfoWidget.h \ + src/ui/WaypointEditableView.h \ src/ui/QGCRGBDView.h \ src/ui/mavlink/QGCMAVLinkMessageSender.h \ src/ui/firmwareupdate/QGCFirmwareUpdateWidget.h \ diff --git a/qgroundcontrol.qrc b/qgroundcontrol.qrc index 664a8d1f8c587731a12c70576045f9c660ec0a9f..4556712eb230f33c93fbf69afecb22b3619b7fc9 100644 --- a/qgroundcontrol.qrc +++ b/qgroundcontrol.qrc @@ -163,6 +163,9 @@ files/images/px4/airframes/hexa_+.png files/images/px4/airframes/hexa_x.png files/images/px4/airframes/octo_x.png + files/images/px4/airframes/flying_wing.png + files/images/px4/airframes/plane_ert.png + files/images/px4/airframes/plane_aert.png files/styles/Vera.ttf diff --git a/src/uas/QGCUASParamManager.cc b/src/uas/QGCUASParamManager.cc index 68f1ed0dfc53c91e9b9ef5fc3ed9d38811f1ca39..aa4bd8174b8cdc39ea17186516970bf8fdf64bb0 100644 --- a/src/uas/QGCUASParamManager.cc +++ b/src/uas/QGCUASParamManager.cc @@ -40,6 +40,15 @@ void QGCUASParamManager::connectToModelAndComms() connect(paramCommsMgr, SIGNAL(parameterListUpToDate()), this, SIGNAL(parameterListUpToDate())); + + // Pass along data model updates + connect(¶mDataModel, SIGNAL(parameterUpdated(int, QString , QVariant )), + this, SIGNAL(parameterUpdated(int, QString , QVariant ))); + + connect(¶mDataModel, SIGNAL(pendingParamUpdate(int , const QString& , QVariant , bool )), + this, SIGNAL(pendingParamUpdate(int , const QString& , QVariant , bool ))); + + } diff --git a/src/uas/QGCUASParamManager.h b/src/uas/QGCUASParamManager.h index 81a12575a506e291ca0768407f326b51013b6a66..c0cf6cd21add82e16d4d2061a0136a6b7466048c 100644 --- a/src/uas/QGCUASParamManager.h +++ b/src/uas/QGCUASParamManager.h @@ -72,6 +72,12 @@ signals: /** @brief We have received a complete list of all parameters onboard the MAV */ void parameterListUpToDate(); + /** @brief We've received an update of a parameter's value */ + void parameterUpdated(int compId, QString paramName, QVariant value); + + /** @brief Notifies listeners that a param was added to or removed from the pending list */ + void pendingParamUpdate(int compId, const QString& paramName, QVariant value, bool isPending); + public slots: diff --git a/src/ui/QGCBaseParamWidget.cc b/src/ui/QGCBaseParamWidget.cc index d80e53693eadce2dd5469cf82ee854d79db069eb..f1d8d60a73c4c3f868ecb820074165b75a6716b0 100644 --- a/src/ui/QGCBaseParamWidget.cc +++ b/src/ui/QGCBaseParamWidget.cc @@ -53,10 +53,10 @@ void QGCBaseParamWidget::connectToParamManager() paramMgr = mav->getParamManager(); //TODO route via paramManager instead? // Listen to updated param signals from the data model - connect(paramMgr->dataModel(), SIGNAL(parameterUpdated(int, QString , QVariant )), + connect(paramMgr, SIGNAL(parameterUpdated(int, QString , QVariant )), this, SLOT(handleOnboardParamUpdate(int,QString,QVariant))); - connect(paramMgr->dataModel(), SIGNAL(pendingParamUpdate(int , const QString&, QVariant , bool )), + connect(paramMgr, SIGNAL(pendingParamUpdate(int , const QString&, QVariant , bool )), this, SLOT(handlePendingParamUpdate(int , const QString& , QVariant, bool ))); // Listen for param list reload finished @@ -71,10 +71,10 @@ void QGCBaseParamWidget::connectToParamManager() void QGCBaseParamWidget::disconnectFromParamManager() { - disconnect(paramMgr->dataModel(), SIGNAL(parameterUpdated(int, QString , QVariant )), + disconnect(paramMgr, SIGNAL(parameterUpdated(int, QString , QVariant )), this, SLOT(handleOnboardParamUpdate(int,QString,QVariant))); - disconnect(paramMgr->dataModel(), SIGNAL(pendingParamUpdate(int , const QString&, QVariant , bool )), + disconnect(paramMgr, SIGNAL(pendingParamUpdate(int , const QString&, QVariant , bool )), this, SLOT(handlePendingParamUpdate(int , const QString& , QVariant, bool ))); disconnect(paramMgr, SIGNAL(parameterListUpToDate()), diff --git a/src/ui/QGCPX4VehicleConfig.cc b/src/ui/QGCPX4VehicleConfig.cc index 54fa593c31e50d941ee3741ed44385ff61f65a4a..38ae790c24e43d579b09c1cabc7a8d4d4e22a19f 100644 --- a/src/ui/QGCPX4VehicleConfig.cc +++ b/src/ui/QGCPX4VehicleConfig.cc @@ -103,12 +103,18 @@ QGCPX4VehicleConfig::QGCPX4VehicleConfig(QWidget *parent) : ui->radio8Widget->setOrientation(Qt::Horizontal); ui->radio8Widget->setName("Radio 8"); - connect(ui->rcMenuButton,SIGNAL(clicked()),this,SLOT(rcMenuButtonClicked())); - connect(ui->sensorMenuButton,SIGNAL(clicked()),this,SLOT(sensorMenuButtonClicked())); - connect(ui->generalMenuButton,SIGNAL(clicked()),this,SLOT(generalMenuButtonClicked())); - connect(ui->advancedMenuButton,SIGNAL(clicked()),this,SLOT(advancedMenuButtonClicked())); - connect(ui->airframeMenuButton, SIGNAL(clicked()), this, SLOT(airframeMenuButtonClicked())); - connect(ui->firmwareMenuButton, SIGNAL(clicked()), this, SLOT(firmwareButtonClicked())); + connect(ui->rcMenuButton,SIGNAL(clicked()), + this,SLOT(rcMenuButtonClicked())); + connect(ui->sensorMenuButton,SIGNAL(clicked()), + this,SLOT(sensorMenuButtonClicked())); + connect(ui->generalMenuButton,SIGNAL(clicked()), + this,SLOT(generalMenuButtonClicked())); + connect(ui->advancedMenuButton,SIGNAL(clicked()), + this,SLOT(advancedMenuButtonClicked())); + connect(ui->airframeMenuButton, SIGNAL(clicked()), + this, SLOT(airframeMenuButtonClicked())); + connect(ui->firmwareMenuButton, SIGNAL(clicked()), + this, SLOT(firmwareMenuButtonClicked())); ui->rcCalibrationButton->setCheckable(true); connect(ui->rcCalibrationButton, SIGNAL(clicked(bool)), this, SLOT(toggleCalibrationRC(bool))); diff --git a/src/ui/QGCPendingParamWidget.cc b/src/ui/QGCPendingParamWidget.cc index c5fb5a010f0dd57106413191ec5083697e1c17ef..35402d995e3220617509004ce7f46466bee2866c 100644 --- a/src/ui/QGCPendingParamWidget.cc +++ b/src/ui/QGCPendingParamWidget.cc @@ -16,9 +16,9 @@ QGCPendingParamWidget::QGCPendingParamWidget(QObject *parent) : void QGCPendingParamWidget::connectToParamManager() { paramMgr = mav->getParamManager(); - //TODO route via paramManager instead? + // Listen to updated param signals from the data model - connect(paramMgr->dataModel(), SIGNAL(pendingParamUpdate(int , const QString&, QVariant , bool )), + connect(paramMgr, SIGNAL(pendingParamUpdate(int , const QString&, QVariant , bool )), this, SLOT(handlePendingParamUpdate(int , const QString& , QVariant, bool ))); // Listen to communications status messages so we can display them @@ -29,9 +29,8 @@ void QGCPendingParamWidget::connectToParamManager() void QGCPendingParamWidget::disconnectFromParamManager() { - //TODO route via paramManager instead? // Listen to updated param signals from the data model - disconnect(paramMgr->dataModel(), SIGNAL(pendingParamUpdate(int , const QString&, QVariant , bool )), + disconnect(paramMgr, SIGNAL(pendingParamUpdate(int , const QString&, QVariant , bool )), this, SLOT(handlePendingParamUpdate(int , const QString& , QVariant, bool ))); // Listen to communications status messages so we can display them @@ -76,7 +75,40 @@ void QGCPendingParamWidget::handlePendingParamUpdate(int compId, const QString& } else { //we don't display non-pending items - paramItem->parent()->removeChild(paramItem); + QTreeWidgetItem* groupItem = paramItem->parent(); + if (NULL != groupItem) { + tree->setUpdatesEnabled(false); + QTreeWidgetItem* componentItem = NULL; + if (1 == groupItem->childCount()) { + componentItem = groupItem->parent(); + } + + //always remove the actual paramItem from its parent + groupItem->removeChild(paramItem); + + //now we may need to remove the groupItem if it has no more children + if (NULL != componentItem) { + //remove the group from our internal data structures + QMap* compParamGroups = paramGroups.value(compId); + QString groupStr = paramName.section("_", 0, 0, QString::SectionSkipEmpty); + compParamGroups->remove(groupStr); + //remove the group item from componentItems + componentItems->value(compId)->removeChild(groupItem); + // remove the group item from the tree widget itself + componentItem->removeChild(groupItem); + + if (0 == componentItem->childCount()) { + //the component itself no longer has any pending changes: remove it + paramGroups.remove(compId); + componentItems->remove(compId); + QTreeWidgetItem* compTop = tree->takeTopLevelItem(tree->indexOfTopLevelItem(componentItem)); + delete compTop; //we own it after take + } + } + tree->setUpdatesEnabled(true); + tree->update(); + + } } updatingParamNameLock.clear(); diff --git a/src/ui/px4_configuration/QGCPX4AirframeConfig.cc b/src/ui/px4_configuration/QGCPX4AirframeConfig.cc index d660035505d8d99ed9ef37004de85ffdc46cde7a..dbca75cf254a2b99c4fb36551d005c1cfd05d81b 100644 --- a/src/ui/px4_configuration/QGCPX4AirframeConfig.cc +++ b/src/ui/px4_configuration/QGCPX4AirframeConfig.cc @@ -44,6 +44,9 @@ QGCPX4AirframeConfig::QGCPX4AirframeConfig(QWidget *parent) : connect(ui->hComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(hSelected(int))); + ui->hComboBox->addItem(tr("TBS Discovery"), 15); + ui->hComboBox->addItem(tr("H Custom"), 16); + connect(ui->applyButton, SIGNAL(clicked()), this, SLOT(applyAndReboot())); connect(UASManager::instance(), SIGNAL(activeUASSet(UASInterface*)), this, SLOT(setActiveUAS())); diff --git a/src/ui/px4_configuration/QGCPX4AirframeConfig.ui b/src/ui/px4_configuration/QGCPX4AirframeConfig.ui index f73e0e14acd39bbe2edae34df9c32c3d3c064432..e1f64325a1735780d828477ab39ea36074954921 100644 --- a/src/ui/px4_configuration/QGCPX4AirframeConfig.ui +++ b/src/ui/px4_configuration/QGCPX4AirframeConfig.ui @@ -24,7 +24,7 @@ 0 0 - 802 + 762 531 @@ -36,6 +36,10 @@ + + + :/files/images/px4/airframes/plane_aert.png:/files/images/px4/airframes/plane_aert.png + 120 @@ -45,33 +49,7 @@ - - - - Please select - - - - - EasyStar - - - - - EasyStar 2 - - - - - EasyStar 2 w. Ailerons - - - - - Bixler 2 - - - + @@ -89,21 +67,20 @@ + + + :/files/images/px4/airframes/flying_wing.png:/files/images/px4/airframes/flying_wing.png + + + + 120 + 120 + + - - - - Bormatec CamFlyer Q - - - - - FX-61 Phantom - - - + @@ -134,28 +111,7 @@ - - - - AR.Drone Frame - - - - - Arducopter C Frame - - - - - DJI F330 Frame - - - - - DJI F450 Frame - - - + @@ -331,18 +287,7 @@ - - - - Steadydrone - - - - - H Frame Custom - - - + diff --git a/src/ui/uas/UASListWidget.cc b/src/ui/uas/UASListWidget.cc index 2b000d376936e733a5a95a8e00774f1f09d0e33a..a3fab70aaf050abe7f4b8970b82cc849ae4d77dd 100644 --- a/src/ui/uas/UASListWidget.cc +++ b/src/ui/uas/UASListWidget.cc @@ -102,6 +102,9 @@ void UASListWidget::updateStatus() while (i.hasNext()) { i.next(); LinkInterface* link = i.key(); + if (!link) + continue; + ProtocolInterface* p = LinkManager::instance()->getProtocolForLink(link); // Build the tooltip out of the protocol parsing data: received, dropped, and parsing errors.