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
d7dbdf08
Commit
d7dbdf08
authored
May 07, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move MAVLink decoder in its own low priority thread
parent
5e06a09c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
2 deletions
+19
-2
MAVLinkDecoder.cc
src/ui/MAVLinkDecoder.cc
+16
-1
MAVLinkDecoder.h
src/ui/MAVLinkDecoder.h
+3
-1
No files found.
src/ui/MAVLinkDecoder.cc
View file @
d7dbdf08
...
...
@@ -2,8 +2,12 @@
#include "UASManager.h"
MAVLinkDecoder
::
MAVLinkDecoder
(
MAVLinkProtocol
*
protocol
,
QObject
*
parent
)
:
Q
Object
(
parent
)
Q
Thread
(
parent
)
{
// We're doing it wrong - because the Qt folks got the API wrong:
// http://blog.qt.digia.com/blog/2010/06/17/youre-doing-it-wrong/
moveToThread
(
this
);
mavlink_message_info_t
msg
[
256
]
=
MAVLINK_MESSAGE_INFO
;
memcpy
(
messageInfo
,
msg
,
sizeof
(
mavlink_message_info_t
)
*
256
);
memset
(
receivedMessages
,
0
,
sizeof
(
mavlink_message_t
)
*
256
);
...
...
@@ -46,6 +50,17 @@ MAVLinkDecoder::MAVLinkDecoder(MAVLinkProtocol* protocol, QObject *parent) :
// textMessageFilter.insert(MAVLINK_MSG_ID_HIGHRES_IMU, false);
connect
(
protocol
,
SIGNAL
(
messageReceived
(
LinkInterface
*
,
mavlink_message_t
)),
this
,
SLOT
(
receiveMessage
(
LinkInterface
*
,
mavlink_message_t
)));
start
(
LowPriority
);
}
/**
* @brief Runs the thread
*
**/
void
MAVLinkDecoder
::
run
()
{
exec
();
}
void
MAVLinkDecoder
::
receiveMessage
(
LinkInterface
*
link
,
mavlink_message_t
message
)
...
...
src/ui/MAVLinkDecoder.h
View file @
d7dbdf08
...
...
@@ -4,12 +4,14 @@
#include <QObject>
#include "MAVLinkProtocol.h"
class
MAVLinkDecoder
:
public
Q
Object
class
MAVLinkDecoder
:
public
Q
Thread
{
Q_OBJECT
public:
MAVLinkDecoder
(
MAVLinkProtocol
*
protocol
,
QObject
*
parent
=
0
);
void
run
();
signals:
void
textMessageReceived
(
int
uasid
,
int
componentid
,
int
severity
,
const
QString
&
text
);
void
valueChanged
(
const
int
uasId
,
const
QString
&
name
,
const
QString
&
unit
,
const
QVariant
&
value
,
const
quint64
msec
);
...
...
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