Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
64178c82
Commit
64178c82
authored
Nov 05, 2012
by
Bryant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed the Clear button in the MAVLink inspector window to actually clear previous messages.
parent
8d0f9620
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
10 deletions
+20
-10
QGCMAVLinkInspector.cc
src/ui/QGCMAVLinkInspector.cc
+19
-9
QGCMAVLinkInspector.h
src/ui/QGCMAVLinkInspector.h
+1
-1
No files found.
src/ui/QGCMAVLinkInspector.cc
View file @
64178c82
...
...
@@ -18,32 +18,35 @@ QGCMAVLinkInspector::QGCMAVLinkInspector(MAVLinkProtocol* protocol, QWidget *par
{
ui
->
setupUi
(
this
);
/
* Insert system */
/
/ Make sure "All" is an option for both the system and components
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
);
// Store metadata for all MAVLink messages.
mavlink_message_info_t
msg_infos
[
256
]
=
MAVLINK_MESSAGE_INFO
;
memcpy
(
messageInfo
,
msg_infos
,
sizeof
(
mavlink_message_info_t
)
*
256
);
// Initialize the received data for all messages to invalid (0xFF)
memset
(
receivedMessages
,
0xFF
,
sizeof
(
mavlink_message_t
)
*
256
);
connect
(
protocol
,
SIGNAL
(
messageReceived
(
LinkInterface
*
,
mavlink_message_t
)),
this
,
SLOT
(
receiveMessage
(
LinkInterface
*
,
mavlink_message_t
)));
// Set up the column headers for the message listing
QStringList
header
;
header
<<
tr
(
"Name"
);
header
<<
tr
(
"Value"
);
header
<<
tr
(
"Type"
);
ui
->
treeWidget
->
setHeaderLabels
(
header
);
connect
(
&
updateTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
refreshView
()));
//
ARM
UI
//
Connect the
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
external connections
connect
(
UASManager
::
instance
(),
SIGNAL
(
UASCreated
(
UASInterface
*
)),
this
,
SLOT
(
addSystem
(
UASInterface
*
)));
connect
(
protocol
,
SIGNAL
(
messageReceived
(
LinkInterface
*
,
mavlink_message_t
)),
this
,
SLOT
(
receiveMessage
(
LinkInterface
*
,
mavlink_message_t
)));
// Start
// Attach the UI's refresh rate to a timer.
connect
(
&
updateTimer
,
SIGNAL
(
timeout
()),
this
,
SLOT
(
refreshView
()));
updateTimer
.
start
(
updateInterval
);
}
...
...
@@ -90,8 +93,15 @@ void QGCMAVLinkInspector::addComponent(int uas, int component, const QString& na
rebuildComponentList
();
}
/**
* Reset the view. This entails clearing all data structures and resetting data from already-
* received messages.
*/
void
QGCMAVLinkInspector
::
clearView
()
{
memset
(
receivedMessages
,
0xFF
,
sizeof
(
mavlink_message_t
)
*
256
);
lastMessageUpdate
.
clear
();
messagesHz
.
clear
();
treeWidgetItems
.
clear
();
ui
->
treeWidget
->
clear
();
}
...
...
src/ui/QGCMAVLinkInspector.h
View file @
64178c82
...
...
@@ -44,7 +44,7 @@ protected:
mavlink_message_t
receivedMessages
[
256
];
///< Available / known messages
QMap
<
int
,
QTreeWidgetItem
*>
treeWidgetItems
;
///< Available tree widget items
QTimer
updateTimer
;
///< Only update at 1 Hz to not overload the GUI
mavlink_message_info_t
messageInfo
[
256
];
mavlink_message_info_t
messageInfo
[
256
];
// Store the metadata for all available MAVLink messages.
// Update one message field
void
updateField
(
int
msgid
,
int
fieldid
,
QTreeWidgetItem
*
item
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment