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
32a35ac9
Commit
32a35ac9
authored
Mar 16, 2018
by
Andreas Bircher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove tile download queue
parent
96fc6a8c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
25 deletions
+12
-25
Terrain.cc
src/Terrain.cc
+12
-24
Terrain.h
src/Terrain.h
+0
-1
No files found.
src/Terrain.cc
View file @
32a35ac9
...
...
@@ -54,23 +54,18 @@ bool TerrainBatchManager::_getAltitudesForCoordinates(const QList<QGeoCoordinate
if
(
!
_tiles
.
contains
(
tileHash
))
{
qCDebug
(
ElevationProviderLog
)
<<
"Need to download tile "
<<
tileHash
;
if
(
!
_tileDownloadQueue
.
contains
(
tileHash
))
{
// Schedule the fetch task
if
(
_state
!=
State
::
Downloading
)
{
QNetworkRequest
request
=
getQGCMapEngine
()
->
urlFactory
()
->
getTileURL
(
UrlFactory
::
AirmapElevation
,
QGCMapEngine
::
long2elevationTileX
(
coordinate
.
longitude
(),
1
),
QGCMapEngine
::
lat2elevationTileY
(
coordinate
.
latitude
(),
1
),
1
,
&
_networkManager
);
QGeoTileSpec
spec
;
spec
.
setX
(
QGCMapEngine
::
long2elevationTileX
(
coordinate
.
longitude
(),
1
));
spec
.
setY
(
QGCMapEngine
::
lat2elevationTileY
(
coordinate
.
latitude
(),
1
));
spec
.
setZoom
(
1
);
spec
.
setMapId
(
UrlFactory
::
AirmapElevation
);
QGeoTiledMapReplyQGC
*
reply
=
new
QGeoTiledMapReplyQGC
(
&
_networkManager
,
request
,
spec
);
connect
(
reply
,
&
QGeoTiledMapReplyQGC
::
finished
,
this
,
&
TerrainBatchManager
::
_fetchedTile
);
connect
(
reply
,
&
QGeoTiledMapReplyQGC
::
aborted
,
this
,
&
TerrainBatchManager
::
_fetchedTile
);
_state
=
State
::
Downloading
;
}
_tileDownloadQueue
.
append
(
tileHash
);
// Schedule the fetch task
if
(
_state
!=
State
::
Downloading
)
{
QNetworkRequest
request
=
getQGCMapEngine
()
->
urlFactory
()
->
getTileURL
(
UrlFactory
::
AirmapElevation
,
QGCMapEngine
::
long2elevationTileX
(
coordinate
.
longitude
(),
1
),
QGCMapEngine
::
lat2elevationTileY
(
coordinate
.
latitude
(),
1
),
1
,
&
_networkManager
);
QGeoTileSpec
spec
;
spec
.
setX
(
QGCMapEngine
::
long2elevationTileX
(
coordinate
.
longitude
(),
1
));
spec
.
setY
(
QGCMapEngine
::
lat2elevationTileY
(
coordinate
.
latitude
(),
1
));
spec
.
setZoom
(
1
);
spec
.
setMapId
(
UrlFactory
::
AirmapElevation
);
QGeoTiledMapReplyQGC
*
reply
=
new
QGeoTiledMapReplyQGC
(
&
_networkManager
,
request
,
spec
);
connect
(
reply
,
&
QGeoTiledMapReplyQGC
::
finished
,
this
,
&
TerrainBatchManager
::
_fetchedTile
);
connect
(
reply
,
&
QGeoTiledMapReplyQGC
::
aborted
,
this
,
&
TerrainBatchManager
::
_fetchedTile
);
_state
=
State
::
Downloading
;
}
_tilesMutex
.
unlock
();
...
...
@@ -111,13 +106,6 @@ void TerrainBatchManager::_fetchedTile()
// remove from download queue
QGeoTileSpec
spec
=
reply
->
tileSpec
();
QString
hash
=
QGCMapEngine
::
getTileHash
(
UrlFactory
::
AirmapElevation
,
spec
.
x
(),
spec
.
y
(),
spec
.
zoom
());
_tilesMutex
.
lock
();
if
(
_tileDownloadQueue
.
contains
(
hash
))
{
_tileDownloadQueue
.
removeOne
(
hash
);
}
else
{
qCDebug
(
ElevationProviderLog
)
<<
"Loaded elevation tile, but not found in download queue."
;
}
_tilesMutex
.
unlock
();
// handle potential errors
if
(
reply
->
error
()
!=
QGeoTiledMapReply
::
NoError
)
{
...
...
src/Terrain.h
View file @
32a35ac9
...
...
@@ -57,7 +57,6 @@ private:
QMutex
_tilesMutex
;
QHash
<
QString
,
TerrainTile
>
_tiles
;
QStringList
_tileDownloadQueue
;
};
class
ElevationProvider
:
public
QObject
...
...
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