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