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
39913696
Commit
39913696
authored
May 06, 2016
by
Gus Grubba
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3344 from dogmaphobic/messageWindow
Message window
parents
9b2ce21c
cfe2cf55
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
68 additions
and
27 deletions
+68
-27
qgcresources.qrc
qgcresources.qrc
+1
-2
TrashDelete.svg
resources/TrashDelete.svg
+8
-0
TrashDeleteBlack.svg
src/FlightMap/Images/TrashDeleteBlack.svg
+0
-11
Vehicle.cc
src/Vehicle/Vehicle.cc
+5
-0
Vehicle.h
src/Vehicle/Vehicle.h
+3
-0
UASMessageHandler.cc
src/uas/UASMessageHandler.cc
+4
-4
MainWindowInner.qml
src/ui/MainWindowInner.qml
+42
-9
UASMessageView.cc
src/ui/uas/UASMessageView.cc
+5
-1
No files found.
qgcresources.qrc
View file @
39913696
...
...
@@ -126,8 +126,6 @@
<file alias="MapSyncChanged.svg">src/FlightMap/Images/MapSyncChanged.svg</file>
<file alias="MapType.svg">src/FlightMap/Images/MapType.svg</file>
<file alias="MapTypeBlack.svg">src/FlightMap/Images/MapTypeBlack.svg</file>
<file alias="TrashDelete.svg">src/FlightMap/Images/TrashDelete.svg</file>
<file alias="TrashDeleteBlack.svg">src/FlightMap/Images/TrashDeleteBlack.svg</file>
<file alias="Armed.svg">src/ui/toolbar/Images/Armed.svg</file>
<file alias="Battery.svg">src/ui/toolbar/Images/Battery.svg</file>
<file alias="Connect.svg">src/ui/toolbar/Images/Connect.svg</file>
...
...
@@ -174,6 +172,7 @@
<file alias="QGroundControlConnect">resources/QGroundControlConnect.svg</file>
<file alias="SplashScreen">resources/SplashScreen.png</file>
<file alias="Stop">resources/Stop.svg</file>
<file alias="TrashDelete.svg">resources/TrashDelete.svg</file>
<file alias="XDelete.svg">resources/XDelete.svg</file>
<file alias="XDeleteBlack.svg">resources/XDeleteBlack.svg</file>
</qresource>
...
...
src/FlightMap/Imag
es/TrashDelete.svg
→
resourc
es/TrashDelete.svg
View file @
39913696
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version=
"1.1"
id=
"Layer_1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
x=
"0px"
y=
"0px"
viewBox=
"-89 46 72 72"
enable-background=
"new -89 46 72 72"
xml:space=
"preserve"
>
<g>
<path
fill=
"none"
d=
"M-71.309,68.986"
/>
</g>
<rect
x=
"-64.709"
y=
"65.8"
fill=
"#FFFFFF"
width=
"23.417"
height=
"4.797"
/>
<path
fill=
"#FFFFFF"
d=
"M-41.291,72.001h-23.417V98.2h23.417L-41.291,72.001L-41.291,72.001z M-44.381,94.749h-3.24V75.731h3.24
V94.749z M-51.38,94.749h-3.24V75.731h3.24V94.749z M-58.081,94.749h-3.24V75.731h3.24V94.749z"
/>
</svg>
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.2.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version=
"1.1"
id=
"Layer_1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
x=
"0px"
y=
"0px"
viewBox=
"-89 46 72 72"
enable-background=
"new -89 46 72 72"
xml:space=
"preserve"
>
<rect
x=
"-78.911"
y=
"46"
fill=
"#FFFFFF"
width=
"51.822"
height=
"10.66"
/>
<path
fill=
"#FFFFFF"
d=
"M-27.089,59.781h-51.822V118h51.822L-27.089,59.781L-27.089,59.781z M-33.927,110.332h-7.17V68.068h7.17
V110.332z M-49.416,110.332h-7.17V68.068h7.17V110.332z M-64.245,110.332h-7.17V68.068h7.17V110.332z"
/>
</svg>
src/FlightMap/Images/TrashDeleteBlack.svg
deleted
100644 → 0
View file @
9b2ce21c
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg
version=
"1.1"
id=
"Layer_1"
xmlns=
"http://www.w3.org/2000/svg"
xmlns:xlink=
"http://www.w3.org/1999/xlink"
x=
"0px"
y=
"0px"
viewBox=
"-89 46 72 72"
enable-background=
"new -89 46 72 72"
xml:space=
"preserve"
>
<g>
<path
fill=
"none"
d=
"M-71.309,68.986"
/>
</g>
<rect
x=
"-64.709"
y=
"65.8"
fill=
"#231F20"
width=
"23.417"
height=
"4.797"
/>
<path
fill=
"#231F20"
d=
"M-41.291,72.001h-23.417V98.2h23.417L-41.291,72.001L-41.291,72.001z M-44.381,94.749h-3.24V75.731h3.24
V94.749z M-51.38,94.749h-3.24V75.731h3.24V94.749z M-58.081,94.749h-3.24V75.731h3.24V94.749z"
/>
</svg>
src/Vehicle/Vehicle.cc
View file @
39913696
...
...
@@ -922,6 +922,11 @@ QString Vehicle::formatedMessages()
return
messages
;
}
void
Vehicle
::
clearMessages
()
{
qgcApp
()
->
toolbox
()
->
uasMessageHandler
()
->
clearMessages
();
}
void
Vehicle
::
_handletextMessageReceived
(
UASMessage
*
message
)
{
if
(
message
)
...
...
src/Vehicle/Vehicle.h
View file @
39913696
...
...
@@ -363,6 +363,9 @@ public:
/// Reboot vehicle
Q_INVOKABLE
void
rebootVehicle
();
/// Clear Messages
Q_INVOKABLE
void
clearMessages
();
bool
guidedModeSupported
(
void
)
const
;
bool
pauseVehicleSupported
(
void
)
const
;
...
...
src/uas/UASMessageHandler.cc
View file @
39913696
...
...
@@ -145,17 +145,17 @@ void UASMessageHandler::handleTextMessage(int, int compId, int severity, QString
case
MAV_SEVERITY_ALERT
:
case
MAV_SEVERITY_CRITICAL
:
case
MAV_SEVERITY_ERROR
:
style
=
QString
(
"
color: #f95e5e; font-weight:bold
"
);
style
=
QString
(
"
<#E>
"
);
_errorCount
++
;
_errorCountTotal
++
;
break
;
case
MAV_SEVERITY_NOTICE
:
case
MAV_SEVERITY_WARNING
:
style
=
QString
(
"
color: #f9b55e; font-weight:bold
"
);
style
=
QString
(
"
<#I>
"
);
_warningCount
++
;
break
;
default:
style
=
QString
(
"
color: #ffffff; font-weight:bold
"
);
style
=
QString
(
"
<#N>
"
);
_normalCount
++
;
break
;
}
...
...
@@ -200,7 +200,7 @@ void UASMessageHandler::handleTextMessage(int, int compId, int severity, QString
if
(
_multiComp
)
{
compString
=
QString
(
" COMP:%1"
).
arg
(
compId
);
}
message
->
_setFormatedText
(
QString
(
"<
p><font style=
\"
%1
\"
>[%2%3]%4 %5</font></p
>"
).
arg
(
style
).
arg
(
dateString
).
arg
(
compString
).
arg
(
severityText
).
arg
(
text
));
message
->
_setFormatedText
(
QString
(
"<
font style=
\"
%1
\"
>[%2%3]%4 %5</font><br/
>"
).
arg
(
style
).
arg
(
dateString
).
arg
(
compString
).
arg
(
severityText
).
arg
(
text
));
if
(
message
->
severityIsError
())
{
_latestError
=
severityText
+
" "
+
text
;
...
...
src/ui/MainWindowInner.qml
View file @
39913696
...
...
@@ -229,9 +229,16 @@ Item {
}
}
function
formatMessage
(
message
)
{
message
=
message
.
replace
(
new
RegExp
(
"
<#E>
"
,
"
g
"
),
"
color: #f95e5e; font:
"
+
(
ScreenTools
.
defaultFontPointSize
.
toFixed
(
0
)
-
1
)
+
"
pt monospace;
"
);
message
=
message
.
replace
(
new
RegExp
(
"
<#I>
"
,
"
g
"
),
"
color: #f9b55e; font:
"
+
(
ScreenTools
.
defaultFontPointSize
.
toFixed
(
0
)
-
1
)
+
"
pt monospace;
"
);
message
=
message
.
replace
(
new
RegExp
(
"
<#N>
"
,
"
g
"
),
"
color: #ffffff; font:
"
+
(
ScreenTools
.
defaultFontPointSize
.
toFixed
(
0
)
-
1
)
+
"
pt monospace;
"
);
return
message
;
}
onFormatedMessageChanged
:
{
if
(
messageArea
.
visible
)
{
messageText
.
append
(
format
edMessage
)
messageText
.
append
(
format
Message
(
formatedMessage
)
)
//-- Hack to scroll down
messageFlick
.
flick
(
0
,
-
500
)
}
...
...
@@ -242,7 +249,7 @@ Item {
currentPopUp
.
close
()
}
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicleAvailable
)
{
messageText
.
text
=
activeVehicle
.
formatedMessages
messageText
.
text
=
formatMessage
(
activeVehicle
.
formatedMessages
)
//-- Hack to scroll to last message
for
(
var
i
=
0
;
i
<
activeVehicle
.
messageCount
;
i
++
)
messageFlick
.
flick
(
0
,
-
5000
)
...
...
@@ -342,13 +349,11 @@ Item {
//-- System Message Area
Rectangle
{
id
:
messageArea
function
close
()
{
currentPopUp
=
null
messageText
.
text
=
""
messageArea
.
visible
=
false
}
width
:
mainWindow
.
width
*
0.5
height
:
mainWindow
.
height
*
0.5
color
:
Qt
.
rgba
(
0
,
0
,
0
,
0.8
)
...
...
@@ -359,6 +364,13 @@ Item {
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.top
:
parent
.
top
anchors.topMargin
:
tbHeight
+
ScreenTools
.
defaultFontPixelHeight
MouseArea
{
// This MouseArea prevents the Map below it from getting Mouse events. Without this
// things like mousewheel will scroll the Flickable and then scroll the map as well.
anchors.fill
:
parent
preventStealing
:
true
onWheel
:
wheel
.
accepted
=
true
}
QGCFlickable
{
id
:
messageFlick
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
...
...
@@ -372,13 +384,11 @@ Item {
readOnly
:
true
textFormat
:
TextEdit
.
RichText
color
:
"
white
"
font.family
:
ScreenTools
.
normalFontFamily
font.pointSize
:
ScreenTools
.
defaultFontPointSize
}
}
//-- Dismiss System Message
Image
{
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
anchors.top
:
parent
.
top
anchors.right
:
parent
.
right
width
:
ScreenTools
.
isTinyScreen
?
ScreenTools
.
defaultFontPixelHeight
*
1.5
:
ScreenTools
.
defaultFontPixelHeight
...
...
@@ -395,7 +405,30 @@ Item {
}
}
}
//-- Clear Messages
Image
{
anchors.bottom
:
parent
.
bottom
anchors.right
:
parent
.
right
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
height
:
ScreenTools
.
isTinyScreen
?
ScreenTools
.
defaultFontPixelHeight
*
1.5
:
ScreenTools
.
defaultFontPixelHeight
width
:
height
sourceSize.height
:
height
source
:
"
/res/TrashDelete.svg
"
fillMode
:
Image
.
PreserveAspectFit
mipmap
:
true
smooth
:
true
MouseArea
{
anchors.fill
:
parent
onClicked
:
{
if
(
QGroundControl
.
multiVehicleManager
.
activeVehicleAvailable
)
{
activeVehicle
.
clearMessages
();
messageArea
.
close
()
}
}
}
}
}
//-------------------------------------------------------------------------
//-- Critical Message Area
Rectangle
{
...
...
@@ -463,7 +496,7 @@ Item {
//-- Dismiss Critical Message
QGCColoredImage
{
id
:
criticalClose
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
anchors.top
:
parent
.
top
anchors.right
:
parent
.
right
width
:
ScreenTools
.
isTinyScreen
?
ScreenTools
.
defaultFontPixelHeight
*
1.5
:
ScreenTools
.
defaultFontPixelHeight
...
...
@@ -482,7 +515,7 @@ Item {
//-- More text below indicator
QGCColoredImage
{
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
anchors.margins
:
ScreenTools
.
defaultFontPixelHeight
*
0.5
anchors.bottom
:
parent
.
bottom
anchors.right
:
parent
.
right
width
:
ScreenTools
.
isTinyScreen
?
ScreenTools
.
defaultFontPixelHeight
*
1.5
:
ScreenTools
.
defaultFontPixelHeight
...
...
src/ui/uas/UASMessageView.cc
View file @
39913696
...
...
@@ -87,7 +87,11 @@ void UASMessageViewWidget::handleTextMessage(UASMessage *message)
// Turn off updates while we're appending content to avoid breaking the autoscroll behavior
msgWidget
->
setUpdatesEnabled
(
false
);
QScrollBar
*
scroller
=
msgWidget
->
verticalScrollBar
();
msgWidget
->
appendHtml
(
message
->
getFormatedText
());
QString
messages
=
message
->
getFormatedText
();
messages
=
messages
.
replace
(
"<#E>"
,
"color: #f95e5e; font: monospace;"
);
messages
=
messages
.
replace
(
"<#I>"
,
"color: #f9b55e; font: monospace;"
);
messages
=
messages
.
replace
(
"<#N>"
,
"color: #ffffff; font: monospace;"
);
msgWidget
->
appendHtml
(
messages
);
// Ensure text area scrolls correctly
scroller
->
setValue
(
scroller
->
maximum
());
msgWidget
->
setUpdatesEnabled
(
true
);
...
...
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