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
36d52d10
Commit
36d52d10
authored
Aug 23, 2015
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add showErrorsInToolBar support
parent
3cb8ec89
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
UASMessageHandler.cc
src/uas/UASMessageHandler.cc
+5
-0
UASMessageHandler.h
src/uas/UASMessageHandler.h
+13
-5
No files found.
src/uas/UASMessageHandler.cc
View file @
36d52d10
...
...
@@ -60,6 +60,7 @@ UASMessageHandler::UASMessageHandler(QObject *parent)
,
_errorCountTotal
(
0
)
,
_warningCount
(
0
)
,
_normalCount
(
0
)
,
_showErrorsInToolbar
(
false
)
{
connect
(
UASManager
::
instance
(),
SIGNAL
(
activeUASSet
(
UASInterface
*
)),
this
,
SLOT
(
setActiveUAS
(
UASInterface
*
)));
emit
textMessageReceived
(
NULL
);
...
...
@@ -184,6 +185,10 @@ void UASMessageHandler::handleTextMessage(int, int compId, int severity, QString
_mutex
.
unlock
();
emit
textMessageReceived
(
message
);
emit
textMessageCountChanged
(
count
);
if
(
_showErrorsInToolbar
&&
message
->
severityIsError
())
{
qgcApp
()
->
showToolBarMessage
(
message
->
getText
());
}
}
int
UASMessageHandler
::
getErrorCountTotal
()
{
...
...
src/uas/UASMessageHandler.h
View file @
36d52d10
...
...
@@ -81,6 +81,7 @@ class UASMessageHandler : public QGCSingleton
{
Q_OBJECT
DECLARE_QGC_SINGLETON
(
UASMessageHandler
,
UASMessageHandler
)
public:
explicit
UASMessageHandler
(
QObject
*
parent
=
0
);
~
UASMessageHandler
();
...
...
@@ -120,6 +121,10 @@ public:
* @brief Get latest error message
*/
QString
getLatestError
()
{
return
_latestError
;
}
/// Begin to show message which are errors in the toolbar
void
showErrorsInToolbar
(
void
)
{
_showErrorsInToolbar
=
true
;
}
public
slots
:
/**
* @brief Set currently active UAS
...
...
@@ -134,6 +139,7 @@ public slots:
* @param text Message Text
*/
void
handleTextMessage
(
int
uasid
,
int
componentid
,
int
severity
,
QString
text
);
signals:
/**
* @brief Sent out when new message arrives
...
...
@@ -145,6 +151,7 @@ signals:
* @param count The new message count
*/
void
textMessageCountChanged
(
int
count
);
private:
// Stores the UAS that we're currently receiving messages from.
UASInterface
*
_activeUAS
;
...
...
@@ -155,6 +162,7 @@ private:
int
_warningCount
;
int
_normalCount
;
QString
_latestError
;
bool
_showErrorsInToolbar
;
};
#endif // QGCMESSAGEHANDLER_H
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