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
70b92823
Commit
70b92823
authored
Nov 07, 2019
by
Gus Grubba
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filter mavlink messages by component ID
parent
4f3c015c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
75 additions
and
13 deletions
+75
-13
MAVLinkInspectorController.cc
src/AnalyzeView/MAVLinkInspectorController.cc
+17
-3
MAVLinkInspectorController.h
src/AnalyzeView/MAVLinkInspectorController.h
+11
-1
MAVLinkInspectorPage.qml
src/AnalyzeView/MAVLinkInspectorPage.qml
+40
-8
MAVLinkMessageButton.qml
src/QmlControls/MAVLinkMessageButton.qml
+7
-1
No files found.
src/AnalyzeView/MAVLinkInspectorController.cc
View file @
70b92823
...
...
@@ -324,10 +324,26 @@ QGCMAVLinkVehicle::append(QGCMAVLinkMessage* message)
emit
m
->
indexChanged
();
}
}
_checkCompID
(
message
);
}
emit
messagesChanged
();
}
//-----------------------------------------------------------------------------
void
QGCMAVLinkVehicle
::
_checkCompID
(
QGCMAVLinkMessage
*
message
)
{
if
(
_compIDsStr
.
isEmpty
())
{
_compIDsStr
<<
tr
(
"All"
);
}
if
(
!
_compIDs
.
contains
(
static_cast
<
int
>
(
message
->
cid
())))
{
int
cid
=
static_cast
<
int
>
(
message
->
cid
());
_compIDs
.
append
(
cid
);
_compIDsStr
<<
QString
::
number
(
cid
);
emit
compIDsChanged
();
}
}
//-----------------------------------------------------------------------------
MAVLinkInspectorController
::
MAVLinkInspectorController
()
{
...
...
@@ -430,9 +446,8 @@ MAVLinkInspectorController::_vehicleRemoved(Vehicle* vehicle)
//-----------------------------------------------------------------------------
void
MAVLinkInspectorController
::
_receiveMessage
(
LinkInterface
*
link
,
mavlink_message_t
message
)
MAVLinkInspectorController
::
_receiveMessage
(
LinkInterface
*
,
mavlink_message_t
message
)
{
Q_UNUSED
(
link
);
QGCMAVLinkMessage
*
m
=
nullptr
;
QGCMAVLinkVehicle
*
v
=
_findVehicle
(
message
.
sysid
);
if
(
!
v
)
{
...
...
@@ -453,7 +468,6 @@ MAVLinkInspectorController::_receiveMessage(LinkInterface* link, mavlink_message
}
else
{
m
->
update
(
&
message
);
}
}
//-----------------------------------------------------------------------------
...
...
src/AnalyzeView/MAVLinkInspectorController.h
View file @
70b92823
...
...
@@ -87,22 +87,32 @@ class QGCMAVLinkVehicle : public QObject {
Q_OBJECT
Q_PROPERTY
(
quint8
id
READ
id
CONSTANT
)
Q_PROPERTY
(
QmlObjectListModel
*
messages
READ
messages
NOTIFY
messagesChanged
)
Q_PROPERTY
(
QList
<
int
>
compIDs
READ
compIDs
NOTIFY
compIDsChanged
)
Q_PROPERTY
(
QStringList
compIDsStr
READ
compIDsStr
NOTIFY
compIDsChanged
)
public:
QGCMAVLinkVehicle
(
QObject
*
parent
,
quint8
id
);
quint8
id
()
{
return
_id
;
}
QmlObjectListModel
*
messages
()
{
return
&
_messages
;
}
QList
<
int
>
compIDs
()
{
return
_compIDs
;
}
QStringList
compIDsStr
()
{
return
_compIDsStr
;
}
QGCMAVLinkMessage
*
findMessage
(
uint32_t
id
,
uint8_t
cid
);
void
append
(
QGCMAVLinkMessage
*
message
);
signals:
void
messagesChanged
();
void
compIDsChanged
();
private:
void
_checkCompID
(
QGCMAVLinkMessage
*
message
);
private:
quint8
_id
;
QmlObjectListModel
_messages
;
//-- List of QGCMAVLinkMessage
QList
<
int
>
_compIDs
;
QStringList
_compIDsStr
;
QmlObjectListModel
_messages
;
//-- List of QGCMAVLinkMessage
};
//-----------------------------------------------------------------------------
...
...
src/AnalyzeView/MAVLinkInspectorPage.qml
View file @
70b92823
...
...
@@ -22,9 +22,11 @@ Item {
anchors.fill
:
parent
anchors.margins
:
ScreenTools
.
defaultFontPixelWidth
property
var
curVehicle
:
controller
?
controller
.
activeVehicle
:
null
property
int
curMessageIndex
:
0
property
var
curMessage
:
curVehicle
&&
curVehicle
.
messages
.
count
?
curVehicle
.
messages
.
get
(
curMessageIndex
)
:
null
property
var
curVehicle
:
controller
?
controller
.
activeVehicle
:
null
property
int
curMessageIndex
:
0
property
var
curMessage
:
curVehicle
&&
curVehicle
.
messages
.
count
?
curVehicle
.
messages
.
get
(
curMessageIndex
)
:
null
property
int
curCompID
:
0
property
bool
selectionValid
:
false
MAVLinkInspectorController
{
id
:
controller
...
...
@@ -35,11 +37,36 @@ Item {
}
//-- Header
QGCLabel
{
RowLayout
{
id
:
header
text
:
qsTr
(
"
Inspect real time MAVLink messages.
"
)
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
QGCLabel
{
text
:
qsTr
(
"
Inspect real time MAVLink messages.
"
)
}
RowLayout
{
Layout.alignment
:
Qt
.
AlignRight
visible
:
curVehicle
?
curVehicle
.
compIDsStr
.
length
>
2
:
false
QGCLabel
{
text
:
qsTr
(
"
Component ID:
"
)
}
QGCComboBox
{
id
:
cidCombo
model
:
curVehicle
?
curVehicle
.
compIDsStr
:
[]
Layout.minimumWidth
:
ScreenTools
.
defaultFontPixelWidth
*
10
currentIndex
:
0
onActivated
:
{
if
(
curVehicle
&&
curVehicle
.
compIDsStr
.
length
>
1
)
{
selectionValid
=
false
if
(
index
<
1
)
curCompID
=
0
else
curCompID
=
curVehicle
.
compIDs
[
index
-
1
]
}
}
}
}
}
//-- Messages (Buttons)
...
...
@@ -59,10 +86,15 @@ Item {
model
:
curVehicle
?
curVehicle
.
messages
:
[]
delegate
:
MAVLinkMessageButton
{
text
:
object
.
name
compID
:
object
.
cid
checked
:
curMessageIndex
===
index
messageHz
:
object
.
messageHz
onClicked
:
curMessageIndex
=
index
Layout.minimumWidth
:
ScreenTools
.
defaultFontPixelWidth
*
36
visible
:
curCompID
===
0
||
curCompID
===
compID
onClicked
:
{
selectionValid
=
true
curMessageIndex
=
index
}
Layout.minimumWidth
:
ScreenTools
.
defaultFontPixelWidth
*
40
}
}
}
...
...
@@ -70,7 +102,7 @@ Item {
//-- Message Data
QGCFlickable
{
id
:
messageGrid
visible
:
curMessage
!==
null
visible
:
curMessage
!==
null
&&
selectionValid
anchors.top
:
buttonGrid
.
top
anchors.bottom
:
parent
.
bottom
anchors.left
:
buttonGrid
.
right
...
...
src/QmlControls/MAVLinkMessageButton.qml
View file @
70b92823
...
...
@@ -25,12 +25,18 @@ Button {
}
property
double
messageHz
:
0
property
int
compID
:
0
contentItem
:
RowLayout
{
QGCLabel
{
text
:
control
.
compID
color
:
checked
?
qgcPal
.
buttonHighlightText
:
qgcPal
.
buttonText
Layout.minimumWidth
:
ScreenTools
.
defaultFontPixelWidth
*
3
}
QGCLabel
{
text
:
control
.
text
color
:
checked
?
qgcPal
.
buttonHighlightText
:
qgcPal
.
buttonText
Layout.minimumWidth
:
ScreenTools
.
defaultFontPixelWidth
*
2
6
Layout.minimumWidth
:
ScreenTools
.
defaultFontPixelWidth
*
2
8
}
QGCLabel
{
color
:
checked
?
qgcPal
.
buttonHighlightText
:
qgcPal
.
buttonText
...
...
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