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
8eab3f6e
Commit
8eab3f6e
authored
Nov 14, 2016
by
Don Gagne
Committed by
GitHub
Nov 14, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4213 from DonLakeFlyer/CalMessages
Filter out calibration messages
parents
17f74fe7
e1864d0b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
12 deletions
+13
-12
UASMessageHandler.cc
src/uas/UASMessageHandler.cc
+12
-11
UASMessageHandler.h
src/uas/UASMessageHandler.h
+1
-1
No files found.
src/uas/UASMessageHandler.cc
View file @
8eab3f6e
...
...
@@ -41,7 +41,7 @@ bool UASMessage::severityIsError()
UASMessageHandler
::
UASMessageHandler
(
QGCApplication
*
app
)
:
QGCTool
(
app
)
,
_active
UAS
(
NULL
)
,
_active
Vehicle
(
NULL
)
,
_activeComponent
(
-
1
)
,
_multiComp
(
false
)
,
_errorCount
(
0
)
...
...
@@ -87,27 +87,28 @@ void UASMessageHandler::clearMessages()
void
UASMessageHandler
::
_activeVehicleChanged
(
Vehicle
*
vehicle
)
{
// If we were already attached to an autopilot, disconnect it.
if
(
_activeUAS
)
{
disconnect
(
_activeUAS
,
&
UASInterface
::
textMessageReceived
,
this
,
&
UASMessageHandler
::
handleTextMessage
);
_activeUAS
=
NULL
;
if
(
_activeVehicle
)
{
disconnect
(
_activeVehicle
->
uas
(),
&
UASInterface
::
textMessageReceived
,
this
,
&
UASMessageHandler
::
handleTextMessage
);
_activeVehicle
=
NULL
;
clearMessages
();
emit
textMessageReceived
(
NULL
);
}
// And now if there's an autopilot to follow, set up the UI.
if
(
vehicle
)
{
UAS
*
uas
=
vehicle
->
uas
();
// And now if there's an autopilot to follow, set up the UI.
if
(
vehicle
)
{
// Connect to the new UAS.
clearMessages
();
_active
UAS
=
uas
;
connect
(
uas
,
&
UASInterface
::
textMessageReceived
,
this
,
&
UASMessageHandler
::
handleTextMessage
);
_active
Vehicle
=
vehicle
;
connect
(
_activeVehicle
->
uas
()
,
&
UASInterface
::
textMessageReceived
,
this
,
&
UASMessageHandler
::
handleTextMessage
);
}
}
void
UASMessageHandler
::
handleTextMessage
(
int
,
int
compId
,
int
severity
,
QString
text
)
{
// Hack to prevent calibration messages from cluttering things up
if
(
_activeVehicle
->
px4Firmware
()
&&
text
.
startsWith
(
QStringLiteral
(
"[cal] "
)))
{
return
;
}
// Color the output depending on the message severity. We have 3 distinct cases:
// 1: If we have an ERROR or worse, make it bigger, bolder, and highlight it red.
...
...
src/uas/UASMessageHandler.h
View file @
8eab3f6e
...
...
@@ -144,7 +144,7 @@ private slots:
void
_activeVehicleChanged
(
Vehicle
*
vehicle
);
private:
UASInterface
*
_activeUAS
;
Vehicle
*
_activeVehicle
;
int
_activeComponent
;
bool
_multiComp
;
QVector
<
UASMessage
*>
_messages
;
...
...
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