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
e7932490
Commit
e7932490
authored
Nov 16, 2017
by
Andreas Bircher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup
parent
b91d7290
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
35 deletions
+7
-35
QGCLoggingCategory.cc
src/QGCLoggingCategory.cc
+1
-0
Terrain.cc
src/Terrain.cc
+1
-23
Terrain.h
src/Terrain.h
+5
-12
No files found.
src/QGCLoggingCategory.cc
View file @
e7932490
...
...
@@ -79,6 +79,7 @@ void QGCLoggingCategoryRegister::setFilterRulesFromSettings(const QString& comma
}
// Command line rules take precedence, so they go last in the list
_commandLineLoggingOptions
+=
"TerrainLog,TerrainTileLog"
;
if
(
!
_commandLineLoggingOptions
.
isEmpty
())
{
QStringList
logList
=
_commandLineLoggingOptions
.
split
(
","
);
...
...
src/Terrain.cc
View file @
e7932490
...
...
@@ -137,28 +137,6 @@ bool ElevationProvider::cacheTerrainTiles(const QGeoCoordinate& southWest, const
return
true
;
}
bool
ElevationProvider
::
cacheTerrainTiles
(
const
QList
<
QGeoCoordinate
>&
coordinates
)
{
if
(
coordinates
.
length
()
==
0
)
{
return
false
;
}
for
(
const
auto
&
coordinate
:
coordinates
)
{
QString
uniqueTileId
=
_uniqueTileId
(
coordinate
);
_tilesMutex
.
lock
();
if
(
_downloadQueue
.
contains
(
uniqueTileId
)
||
_tiles
.
contains
(
uniqueTileId
))
{
_tilesMutex
.
unlock
();
continue
;
}
_downloadQueue
.
append
(
uniqueTileId
);
_tilesMutex
.
unlock
();
qCDebug
(
TerrainLog
)
<<
"Adding tile to download queue: "
<<
uniqueTileId
;
}
_downloadTiles
();
return
true
;
}
void
ElevationProvider
::
_requestFinished
()
{
QNetworkReply
*
reply
=
qobject_cast
<
QNetworkReply
*>
(
QObject
::
sender
());
...
...
@@ -265,7 +243,7 @@ void ElevationProvider::_downloadTiles(void)
connect
(
networkReply
,
&
QNetworkReply
::
finished
,
this
,
&
ElevationProvider
::
_requestFinishedTile
);
_state
=
State
::
Downloading
;
}
else
if
(
_state
==
State
::
Idle
)
{
}
else
if
(
_state
==
State
::
Idle
&&
_coordinates
.
length
()
>
0
)
{
queryTerrainData
(
_coordinates
);
}
}
...
...
src/Terrain.h
View file @
e7932490
...
...
@@ -52,14 +52,6 @@ public:
*/
bool
queryTerrainData
(
const
QList
<
QGeoCoordinate
>&
coordinates
);
/**
* Cache all data in rectangular region given by list of coordinates.
*
* @param coordinates
* @return true on successful scheduling for download
*/
bool
cacheTerrainTiles
(
const
QList
<
QGeoCoordinate
>&
coordinates
);
/**
* Cache all data in rectangular region given by south west and north east corner.
*
...
...
@@ -70,16 +62,17 @@ public:
bool
cacheTerrainTiles
(
const
QGeoCoordinate
&
southWest
,
const
QGeoCoordinate
&
northEast
);
signals:
/// signal returning requested elevation data
void
terrainData
(
bool
success
,
QList
<
float
>
altitudes
);
private
slots
:
void
_requestFinished
();
void
_requestFinishedTile
();
void
_requestFinished
();
/// slot to handle download of elevation of list of coordinates
void
_requestFinishedTile
();
/// slot to handle download of elevation tiles
private:
QString
_uniqueTileId
(
const
QGeoCoordinate
&
coordinate
);
void
_downloadTiles
(
void
);
QString
_uniqueTileId
(
const
QGeoCoordinate
&
coordinate
);
/// Method to create a unique string for each tile. Format: south_west_north_east as floats.
void
_downloadTiles
(
void
);
/// Method to trigger download of queued tiles, eventually emitting the requested altitudes (if any).
enum
class
State
{
Idle
,
...
...
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