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
ea5de155
Commit
ea5de155
authored
Oct 23, 2018
by
Patrick José Pereira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Terrain: Change from foreach to c++11 for
Signed-off-by:
Patrick José Pereira
<
patrickelectric@gmail.com
>
parent
6c6a8db8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
TerrainQuery.cc
src/Terrain/TerrainQuery.cc
+8
-8
No files found.
src/Terrain/TerrainQuery.cc
View file @
ea5de155
...
...
@@ -46,7 +46,7 @@ void TerrainAirMapQuery::requestCoordinateHeights(const QList<QGeoCoordinate>& c
}
QString
points
;
for
each
(
const
QGeoCoordinate
&
coord
,
coordinates
)
{
for
(
const
QGeoCoordinate
&
coord
:
coordinates
)
{
points
+=
QString
::
number
(
coord
.
latitude
(),
'f'
,
10
)
+
","
+
QString
::
number
(
coord
.
longitude
(),
'f'
,
10
)
+
","
;
}
...
...
@@ -236,7 +236,7 @@ void TerrainAirMapQuery::_parsePathData(const QJsonValue& pathJson)
double
lonStep
=
stepArray
[
1
].
toDouble
();
QList
<
double
>
heights
;
for
each
(
const
QJsonValue
&
profileValue
,
profileArray
)
{
for
(
const
QJsonValue
&
profileValue
:
profileArray
)
{
heights
.
append
(
profileValue
.
toDouble
());
}
...
...
@@ -404,7 +404,7 @@ bool TerrainTileManager::_getAltitudesForCoordinates(const QList<QGeoCoordinate>
{
error
=
false
;
for
each
(
const
QGeoCoordinate
&
coordinate
,
coordinates
)
{
for
(
const
QGeoCoordinate
&
coordinate
:
coordinates
)
{
QString
tileHash
=
_getTileHash
(
coordinate
);
qCDebug
(
TerrainQueryLog
)
<<
"TerrainTileManager::_getAltitudesForCoordinates hash:coordinate"
<<
tileHash
<<
coordinate
;
...
...
@@ -451,7 +451,7 @@ void TerrainTileManager::_tileFailed(void)
{
QList
<
double
>
noAltitudes
;
for
each
(
const
QueuedRequestInfo_t
&
requestInfo
,
_requestQueue
)
{
for
(
const
QueuedRequestInfo_t
&
requestInfo
:
_requestQueue
)
{
if
(
requestInfo
.
queryMode
==
QueryMode
::
QueryModeCoordinates
)
{
requestInfo
.
terrainQueryInterface
->
_signalCoordinateHeights
(
false
,
noAltitudes
);
}
else
if
(
requestInfo
.
queryMode
==
QueryMode
::
QueryModePath
)
{
...
...
@@ -584,7 +584,7 @@ void TerrainAtCoordinateBatchManager::_sendNextBatch(void)
// Convert coordinates to point strings for json query
QList
<
QGeoCoordinate
>
coords
;
int
requestQueueAdded
=
0
;
for
each
(
const
QueuedRequestInfo_t
&
requestInfo
,
_requestQueue
)
{
for
(
const
QueuedRequestInfo_t
&
requestInfo
:
_requestQueue
)
{
SentRequestInfo_t
sentRequestInfo
=
{
requestInfo
.
terrainAtCoordinateQuery
,
false
,
requestInfo
.
coordinates
.
count
()
};
_sentRequests
.
append
(
sentRequestInfo
);
coords
+=
requestInfo
.
coordinates
;
...
...
@@ -604,7 +604,7 @@ void TerrainAtCoordinateBatchManager::_batchFailed(void)
{
QList
<
double
>
noHeights
;
for
each
(
const
SentRequestInfo_t
&
sentRequestInfo
,
_sentRequests
)
{
for
(
const
SentRequestInfo_t
&
sentRequestInfo
:
_sentRequests
)
{
if
(
!
sentRequestInfo
.
queryObjectDestroyed
)
{
disconnect
(
sentRequestInfo
.
terrainAtCoordinateQuery
,
&
TerrainAtCoordinateQuery
::
destroyed
,
this
,
&
TerrainAtCoordinateBatchManager
::
_queryObjectDestroyed
);
sentRequestInfo
.
terrainAtCoordinateQuery
->
_signalTerrainData
(
false
,
noHeights
);
...
...
@@ -663,7 +663,7 @@ void TerrainAtCoordinateBatchManager::_coordinateHeights(bool success, QList<dou
}
int
currentIndex
=
0
;
for
each
(
const
SentRequestInfo_t
&
sentRequestInfo
,
_sentRequests
)
{
for
(
const
SentRequestInfo_t
&
sentRequestInfo
:
_sentRequests
)
{
if
(
!
sentRequestInfo
.
queryObjectDestroyed
)
{
qCDebug
(
TerrainQueryVerboseLog
)
<<
"TerrainAtCoordinateBatchManager::_coordinateHeights returned TerrainCoordinateQuery:count"
<<
sentRequestInfo
.
terrainAtCoordinateQuery
<<
sentRequestInfo
.
cCoord
;
disconnect
(
sentRequestInfo
.
terrainAtCoordinateQuery
,
&
TerrainAtCoordinateQuery
::
destroyed
,
this
,
&
TerrainAtCoordinateBatchManager
::
_queryObjectDestroyed
);
...
...
@@ -730,7 +730,7 @@ void TerrainPolyPathQuery::requestData(const QVariantList& polyPath)
{
QList
<
QGeoCoordinate
>
path
;
for
each
(
const
QVariant
&
geoVar
,
polyPath
)
{
for
(
const
QVariant
&
geoVar
:
polyPath
)
{
path
.
append
(
geoVar
.
value
<
QGeoCoordinate
>
());
}
...
...
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