Commit 5313da41 authored by Lorenz Meier's avatar Lorenz Meier

Merge branch 'config' of github.com:mavlink/qgroundcontrol into config

parents da5eaf93 467a2a11
......@@ -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 \
......
......@@ -163,6 +163,9 @@
<file>files/images/px4/airframes/hexa_+.png</file>
<file>files/images/px4/airframes/hexa_x.png</file>
<file>files/images/px4/airframes/octo_x.png</file>
<file>files/images/px4/airframes/flying_wing.png</file>
<file>files/images/px4/airframes/plane_ert.png</file>
<file>files/images/px4/airframes/plane_aert.png</file>
</qresource>
<qresource prefix="/general">
<file alias="vera.ttf">files/styles/Vera.ttf</file>
......
......@@ -40,6 +40,15 @@ void QGCUASParamManager::connectToModelAndComms()
connect(paramCommsMgr, SIGNAL(parameterListUpToDate()),
this, SIGNAL(parameterListUpToDate()));
// Pass along data model updates
connect(&paramDataModel, SIGNAL(parameterUpdated(int, QString , QVariant )),
this, SIGNAL(parameterUpdated(int, QString , QVariant )));
connect(&paramDataModel, SIGNAL(pendingParamUpdate(int , const QString& , QVariant , bool )),
this, SIGNAL(pendingParamUpdate(int , const QString& , QVariant , bool )));
}
......
......@@ -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:
......
......@@ -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()),
......
......@@ -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)));
......
......@@ -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<QString, QTreeWidgetItem*>* 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();
......
......@@ -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()));
......
......@@ -24,7 +24,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>802</width>
<width>762</width>
<height>531</height>
</rect>
</property>
......@@ -36,6 +36,10 @@
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../qgroundcontrol.qrc">
<normaloff>:/files/images/px4/airframes/plane_aert.png</normaloff>:/files/images/px4/airframes/plane_aert.png</iconset>
</property>
<property name="iconSize">
<size>
<width>120</width>
......@@ -45,33 +49,7 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="planeComboBox">
<item>
<property name="text">
<string>Please select</string>
</property>
</item>
<item>
<property name="text">
<string>EasyStar</string>
</property>
</item>
<item>
<property name="text">
<string>EasyStar 2</string>
</property>
</item>
<item>
<property name="text">
<string>EasyStar 2 w. Ailerons</string>
</property>
</item>
<item>
<property name="text">
<string>Bixler 2</string>
</property>
</item>
</widget>
<widget class="QComboBox" name="planeComboBox"/>
</item>
<item>
<widget class="QLabel" name="label">
......@@ -89,21 +67,20 @@
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../qgroundcontrol.qrc">
<normaloff>:/files/images/px4/airframes/flying_wing.png</normaloff>:/files/images/px4/airframes/flying_wing.png</iconset>
</property>
<property name="iconSize">
<size>
<width>120</width>
<height>120</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="flyingWingComboBox">
<item>
<property name="text">
<string>Bormatec CamFlyer Q</string>
</property>
</item>
<item>
<property name="text">
<string>FX-61 Phantom</string>
</property>
</item>
</widget>
<widget class="QComboBox" name="flyingWingComboBox"/>
</item>
<item>
<widget class="QLabel" name="label_2">
......@@ -134,28 +111,7 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="quadXComboBox">
<item>
<property name="text">
<string>AR.Drone Frame</string>
</property>
</item>
<item>
<property name="text">
<string>Arducopter C Frame</string>
</property>
</item>
<item>
<property name="text">
<string>DJI F330 Frame</string>
</property>
</item>
<item>
<property name="text">
<string>DJI F450 Frame</string>
</property>
</item>
</widget>
<widget class="QComboBox" name="quadXComboBox"/>
</item>
<item>
<widget class="QLabel" name="label_3">
......@@ -331,18 +287,7 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="hComboBox">
<item>
<property name="text">
<string>Steadydrone</string>
</property>
</item>
<item>
<property name="text">
<string>H Frame Custom</string>
</property>
</item>
</widget>
<widget class="QComboBox" name="hComboBox"/>
</item>
<item>
<widget class="QLabel" name="label_9">
......
......@@ -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.
......
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