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
78e89fa5
Commit
78e89fa5
authored
May 19, 2014
by
Lorenz Meier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Map toolbar: Ensure status label does not lead to screen flickering
parent
d4e5dabf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
QGCMapToolBar.cc
src/ui/map/QGCMapToolBar.cc
+15
-9
QGCMapToolBar.h
src/ui/map/QGCMapToolBar.h
+3
-0
No files found.
src/ui/map/QGCMapToolBar.cc
View file @
78e89fa5
...
...
@@ -12,7 +12,8 @@ QGCMapToolBar::QGCMapToolBar(QWidget *parent) :
mapTypesMenu
(
this
),
trailSettingsGroup
(
new
QActionGroup
(
this
)),
updateTimesGroup
(
new
QActionGroup
(
this
)),
mapTypesGroup
(
new
QActionGroup
(
this
))
mapTypesGroup
(
new
QActionGroup
(
this
)),
statusMaxLen
(
15
)
{
ui
->
setupUi
(
this
);
}
...
...
@@ -168,11 +169,16 @@ void QGCMapToolBar::setUAVTrailTime()
if
(
ok
)
{
(
map
->
setTrailModeTimed
(
trailTime
));
ui
->
posLabel
->
set
Text
(
tr
(
"Trail mode: Every %1 second%2"
).
arg
(
trailTime
).
arg
((
trailTime
>
1
)
?
"s"
:
""
));
setStatusLabel
Text
(
tr
(
"Trail mode: Every %1 second%2"
).
arg
(
trailTime
).
arg
((
trailTime
>
1
)
?
"s"
:
""
));
}
}
}
void
QGCMapToolBar
::
setStatusLabelText
(
const
QString
&
text
)
{
ui
->
posLabel
->
setText
(
text
.
leftJustified
(
statusMaxLen
,
QChar
(
'.'
),
true
));
}
void
QGCMapToolBar
::
setUAVTrailDistance
()
{
QObject
*
sender
=
QObject
::
sender
();
...
...
@@ -185,7 +191,7 @@ void QGCMapToolBar::setUAVTrailDistance()
if
(
ok
)
{
map
->
setTrailModeDistance
(
trailDistance
);
ui
->
posLabel
->
set
Text
(
tr
(
"Trail mode: Every %1 meter%2"
).
arg
(
trailDistance
).
arg
((
trailDistance
==
1
)
?
"s"
:
""
));
setStatusLabel
Text
(
tr
(
"Trail mode: Every %1 meter%2"
).
arg
(
trailDistance
).
arg
((
trailDistance
==
1
)
?
"s"
:
""
));
}
}
}
...
...
@@ -202,7 +208,7 @@ void QGCMapToolBar::setUpdateInterval()
if
(
ok
)
{
map
->
setUpdateRateLimit
(
time
);
ui
->
posLabel
->
set
Text
(
tr
(
"Limit: %1 second%2"
).
arg
(
time
).
arg
((
time
!=
1.0
f
)
?
"s"
:
""
));
setStatusLabel
Text
(
tr
(
"Limit: %1 second%2"
).
arg
(
time
).
arg
((
time
!=
1.0
f
)
?
"s"
:
""
));
}
}
}
...
...
@@ -219,30 +225,30 @@ void QGCMapToolBar::setMapType()
if
(
ok
)
{
map
->
SetMapType
((
MapType
::
Types
)
mapType
);
ui
->
posLabel
->
set
Text
(
tr
(
"Map: %1"
).
arg
(
mapType
));
setStatusLabel
Text
(
tr
(
"Map: %1"
).
arg
(
mapType
));
}
}
}
void
QGCMapToolBar
::
tileLoadStart
()
{
ui
->
posLabel
->
setText
(
tr
(
"Loading..
"
));
setStatusLabelText
(
tr
(
"Loading
"
));
}
void
QGCMapToolBar
::
tileLoadEnd
()
{
ui
->
posLabel
->
set
Text
(
tr
(
"Finished"
));
setStatusLabel
Text
(
tr
(
"Finished"
));
}
void
QGCMapToolBar
::
tileLoadProgress
(
int
progress
)
{
if
(
progress
==
1
)
{
ui
->
posLabel
->
set
Text
(
tr
(
"1 tile"
));
setStatusLabel
Text
(
tr
(
"1 tile"
));
}
else
if
(
progress
>
0
)
{
ui
->
posLabel
->
set
Text
(
tr
(
"%1 tile"
).
arg
(
progress
));
setStatusLabel
Text
(
tr
(
"%1 tile"
).
arg
(
progress
));
}
else
{
...
...
src/ui/map/QGCMapToolBar.h
View file @
78e89fa5
...
...
@@ -29,6 +29,7 @@ public slots:
void
setUAVTrailDistance
();
void
setUpdateInterval
();
void
setMapType
();
void
setStatusLabelText
(
const
QString
&
text
);
private:
Ui
::
QGCMapToolBar
*
ui
;
...
...
@@ -43,6 +44,8 @@ protected:
QActionGroup
*
trailSettingsGroup
;
QActionGroup
*
updateTimesGroup
;
QActionGroup
*
mapTypesGroup
;
unsigned
statusMaxLen
;
};
#endif // QGCMAPTOOLBAR_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