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
6f474c99
Commit
6f474c99
authored
Mar 15, 2018
by
Andreas Bircher
Browse files
compile fix
parent
ec93ab96
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Terrain.cc
View file @
6f474c99
...
...
@@ -41,7 +41,7 @@ void TerrainBatchManager::addQuery(ElevationProvider* elevationProvider, const Q
}
qCDebug
(
ElevationProviderLog
)
<<
"All altitudes taken from cached data"
;
elevationProvider
->
_signalTerrainData
(
true
,
altitudes
);
elevationProvider
->
_signalTerrainData
(
coordinates
.
count
()
==
altitudes
.
count
()
,
altitudes
);
}
}
...
...
@@ -71,6 +71,7 @@ bool TerrainBatchManager::_getAltitudesForCoordinates(const QList<QGeoCoordinate
_tileDownloadQueue
.
append
(
tileHash
);
}
_tilesMutex
.
unlock
();
return
false
;
}
else
{
...
...
@@ -123,11 +124,13 @@ void TerrainBatchManager::_fetchedTile()
}
else
{
qCDebug
(
ElevationProviderLog
)
<<
"Elevation tile fetching returned error. "
<<
reply
->
errorString
();
}
_tileFailed
();
reply
->
deleteLater
();
return
;
}
if
(
!
reply
->
isFinished
())
{
qCDebug
(
ElevationProviderLog
)
<<
"Error in fetching elevation tile. Not finished. "
<<
reply
->
errorString
();
_tileFailed
();
reply
->
deleteLater
();
return
;
}
...
...
@@ -140,6 +143,7 @@ void TerrainBatchManager::_fetchedTile()
if
(
parseError
.
error
!=
QJsonParseError
::
NoError
)
{
qCDebug
(
ElevationProviderLog
)
<<
"Could not parse terrain tile "
<<
parseError
.
errorString
();
qCDebug
(
ElevationProviderLog
)
<<
responseBytes
;
_tileFailed
();
reply
->
deleteLater
();
return
;
}
...
...
@@ -162,7 +166,7 @@ void TerrainBatchManager::_fetchedTile()
for
(
int
i
=
_requestQueue
.
count
()
-
1
;
i
>=
0
;
i
--
)
{
QList
<
float
>
altitudes
;
if
(
_getAltitudesForCoordinates
(
_requestQueue
[
i
].
coordinates
,
altitudes
))
{
_requestQueue
[
i
].
elevationProvider
->
_signalTerrainData
(
true
,
altitudes
);
_requestQueue
[
i
].
elevationProvider
->
_signalTerrainData
(
_requestQueue
[
i
].
coordinates
.
count
()
==
altitudes
.
count
()
,
altitudes
);
_requestQueue
.
removeAt
(
i
);
}
}
...
...
@@ -192,3 +196,8 @@ bool ElevationProvider::queryTerrainData(const QList<QGeoCoordinate>& coordinate
return
false
;
}
void
ElevationProvider
::
_signalTerrainData
(
bool
success
,
QList
<
float
>&
altitudes
)
{
emit
terrainData
(
success
,
altitudes
);
}
src/Terrain.h
View file @
6f474c99
...
...
@@ -34,7 +34,6 @@ public:
void
addQuery
(
ElevationProvider
*
elevationProvider
,
const
QList
<
QGeoCoordinate
>&
coordinates
);
private
slots
:
void
_requestFinished
(
void
);
void
_fetchedTile
(
void
);
/// slot to handle fetched elevation tiles
private:
...
...
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