Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
31c48bba
Commit
31c48bba
authored
Aug 19, 2013
by
Lorenz Meier
Browse files
Merge pull request #339 from tstellanova/config_debug
Speak and show critical messages in message view
parents
f850094f
6865e01c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/ui/uas/QGCMessageView.cc
View file @
31c48bba
#include
"QGCMessageView.h"
#include
"ui_QGCMessageView.h"
#include
"UASManager.h"
#include
"QGCUnconnectedInfoWidget.h"
#include
<QMenu>
#include
<QScrollBar>
#include
"GAudioOutput.h"
#include
"QGCUnconnectedInfoWidget.h"
#include
"UASManager.h"
#include
"ui_QGCMessageView.h"
QGCMessageView
::
QGCMessageView
(
QWidget
*
parent
)
:
QWidget
(
parent
),
activeUAS
(
NULL
),
...
...
@@ -53,7 +57,7 @@ void QGCMessageView::setActiveUAS(UASInterface* uas)
activeUAS
=
uas
;
}
void
QGCMessageView
::
handleTextMessage
(
int
uasid
,
int
comp
onenti
d
,
int
severity
,
QString
text
)
void
QGCMessageView
::
handleTextMessage
(
int
uasid
,
int
comp
I
d
,
int
severity
,
QString
text
)
{
// XXX color messages according to severity
...
...
@@ -64,7 +68,17 @@ void QGCMessageView::handleTextMessage(int uasid, int componentid, int severity,
QScrollBar
*
scroller
=
msgWidget
->
verticalScrollBar
();
UASInterface
*
uas
=
UASManager
::
instance
()
->
getUASForId
(
uasid
);
msgWidget
->
appendHtml
(
QString
(
"<font color=
\"
%1
\"
>[%2:%3] %4</font>
\n
"
).
arg
(
uas
->
getColor
().
name
()).
arg
(
uas
->
getUASName
()).
arg
(
componentid
).
arg
(
text
));
QString
uasName
(
uas
->
getUASName
());
QString
colorName
(
uas
->
getColor
().
name
());
//change styling based on severity
if
(
160
==
severity
)
{
//TODO where is the constant for "critical" severity?
GAudioOutput
::
instance
()
->
say
(
text
.
toLower
());
msgWidget
->
appendHtml
(
QString
(
"<p style=
\"
color:#DC143C;background-color:#FFFACD;font-size:large;font-weight:bold
\"
>[%1:%2] %3</p>"
).
arg
(
uasName
).
arg
(
compId
).
arg
(
text
));
}
else
{
msgWidget
->
appendHtml
(
QString
(
"<p style=
\"
color:%1;font-size:smaller
\"
>[%2:%3] %4</p>"
).
arg
(
colorName
).
arg
(
uasName
).
arg
(
compId
).
arg
(
text
));
}
// Ensure text area scrolls correctly
scroller
->
setValue
(
scroller
->
maximum
());
msgWidget
->
setUpdatesEnabled
(
true
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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