Commit b2a051df authored by Lorenz Meier's avatar Lorenz Meier

Added clear button to MSG inspector

parent 748c3ef2
......@@ -19,8 +19,8 @@ QGCMAVLinkInspector::QGCMAVLinkInspector(MAVLinkProtocol* protocol, QWidget *par
ui->setupUi(this);
/* Insert system */
ui->systemComboBox->addItem(tr("All Systems"), 0);
ui->componentComboBox->addItem(tr("All Components"), 0);
ui->systemComboBox->addItem(tr("All"), 0);
ui->componentComboBox->addItem(tr("All"), 0);
mavlink_message_info_t msg[256] = MAVLINK_MESSAGE_INFO;
memcpy(messageInfo, msg, sizeof(mavlink_message_info_t)*256);
......@@ -38,6 +38,7 @@ QGCMAVLinkInspector::QGCMAVLinkInspector(MAVLinkProtocol* protocol, QWidget *par
// ARM UI
connect(ui->systemComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(selectDropDownMenuSystem(int)));
connect(ui->componentComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(selectDropDownMenuComponent(int)));
connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clearView()));
// ARM external connections
connect(UASManager::instance(), SIGNAL(UASCreated(UASInterface*)), this, SLOT(addSystem(UASInterface*)));
......@@ -89,6 +90,12 @@ void QGCMAVLinkInspector::addComponent(int uas, int component, const QString& na
rebuildComponentList();
}
void QGCMAVLinkInspector::clearView()
{
treeWidgetItems.clear();
ui->treeWidget->clear();
}
void QGCMAVLinkInspector::refreshView()
{
for (int i = 0; i < 256; ++i)//mavlink_message_t msg, receivedMessages)
......
......@@ -24,6 +24,9 @@ public:
public slots:
void receiveMessage(LinkInterface* link,mavlink_message_t message);
/** @brief Clear all messages */
void clearView();
/** Update view */
void refreshView();
void addSystem(UASInterface* uas);
void addComponent(int uas, int component, const QString& name);
......
......@@ -13,19 +13,10 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QGridLayout" name="gridLayout" columnstretch="2,8">
<layout class="QGridLayout" name="gridLayout" columnstretch="2,8,0,0,0">
<property name="margin">
<number>6</number>
</property>
<item row="2" column="0" colspan="2">
<widget class="QTreeWidget" name="treeWidget">
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label">
<property name="text">
......@@ -36,16 +27,32 @@
<item row="0" column="1">
<widget class="QComboBox" name="systemComboBox"/>
</item>
<item row="1" column="1">
<item row="0" column="3">
<widget class="QComboBox" name="componentComboBox"/>
</item>
<item row="1" column="0">
<item row="0" column="2">
<widget class="QLabel" name="label_2">
<property name="text">
<string>Component</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="clearButton">
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
<item row="2" column="0" colspan="5">
<widget class="QTreeWidget" name="treeWidget">
<column>
<property name="text">
<string notr="true">1</string>
</property>
</column>
</widget>
</item>
</layout>
</widget>
<resources/>
......
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