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
71736dcc
Commit
71736dcc
authored
Apr 04, 2018
by
Gus Grubba
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://github.com/mavlink/qgroundcontrol
into joystickFrequency
parents
51d20e25
ff1ecf4f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
17 deletions
+55
-17
MakeQtTravisTarball.sh
deploy/MakeQtTravisTarball.sh
+10
-15
TerrainQuery.cc
src/Terrain/TerrainQuery.cc
+44
-2
TerrainQuery.h
src/Terrain/TerrainQuery.h
+1
-0
No files found.
deploy/MakeQtTravisTarball.sh
View file @
71736dcc
#!/bin/bash -x
if
[
[
$#
-eq
0
]
]
;
then
echo
'MakeQtTravisTarball.sh QtDirectory QtFullVersion QtBaseVersion
BuildType'
exit
1
if
[
$#
-ne
2
]
;
then
echo
'MakeQtTravisTarball.sh QtDirectory
BuildType'
exit
1
fi
QT_DIRECTORY
=
$1
if
[
!
-d
${
QT_DIRECTORY
}
]
;
then
echo
'Specify directory for Qt Directory
.'
exit
1
echo
'Specify directory for Qt Directory to copy from
.'
exit
1
fi
QT_FULL_VERSION
=
$2
if
[
!
-d
${
QT_DIRECTORY
}
/
${
QT_FULL_VERSION
}
]
;
then
echo
'Qt version directory not found'
exit
1
fi
QT_BASE_VERSION
=
$3
QT_FULL_VERSION
=
5.9.3
QT_BASE_VERSION
=
5.9
QT_BUILD_TYPE
=
$
4
QT_BUILD_TYPE
=
$
2
if
[
!
-d
${
QT_DIRECTORY
}
/
${
QT_FULL_VERSION
}
/
${
QT_BUILD_TYPE
}
]
;
then
echo
'Qt build type directory not found
'
exit
1
echo
'Qt build type directory not found. Specify example: clang_62
'
exit
1
fi
mkdir
-p
Qt
${
QT_BASE_VERSION
}
-
${
QT_BUILD_TYPE
}
/
${
QT_FULL_VERSION
}
/
${
QT_BUILD_TYPE
}
...
...
src/Terrain/TerrainQuery.cc
View file @
71736dcc
...
...
@@ -10,6 +10,7 @@
#include "TerrainQuery.h"
#include "QGCMapEngine.h"
#include "QGeoMapReplyQGC.h"
#include "QGCApplication.h"
#include <QUrl>
#include <QUrlQuery>
...
...
@@ -36,6 +37,11 @@ TerrainAirMapQuery::TerrainAirMapQuery(QObject* parent)
void
TerrainAirMapQuery
::
requestCoordinateHeights
(
const
QList
<
QGeoCoordinate
>&
coordinates
)
{
if
(
qgcApp
()
->
runningUnitTests
())
{
emit
coordinateHeights
(
false
,
QList
<
double
>
());
return
;
}
QString
points
;
foreach
(
const
QGeoCoordinate
&
coord
,
coordinates
)
{
points
+=
QString
::
number
(
coord
.
latitude
(),
'f'
,
10
)
+
","
...
...
@@ -52,6 +58,11 @@ void TerrainAirMapQuery::requestCoordinateHeights(const QList<QGeoCoordinate>& c
void
TerrainAirMapQuery
::
requestPathHeights
(
const
QGeoCoordinate
&
fromCoord
,
const
QGeoCoordinate
&
toCoord
)
{
if
(
qgcApp
()
->
runningUnitTests
())
{
emit
pathHeights
(
false
,
qQNaN
(),
qQNaN
(),
QList
<
double
>
());
return
;
}
QString
points
;
points
+=
QString
::
number
(
fromCoord
.
latitude
(),
'f'
,
10
)
+
","
+
QString
::
number
(
fromCoord
.
longitude
(),
'f'
,
10
)
+
","
;
...
...
@@ -67,6 +78,11 @@ void TerrainAirMapQuery::requestPathHeights(const QGeoCoordinate& fromCoord, con
void
TerrainAirMapQuery
::
requestCarpetHeights
(
const
QGeoCoordinate
&
swCoord
,
const
QGeoCoordinate
&
neCoord
,
bool
statsOnly
)
{
if
(
qgcApp
()
->
runningUnitTests
())
{
emit
carpetHeights
(
false
,
qQNaN
(),
qQNaN
(),
QList
<
QList
<
double
>>
());
return
;
}
QString
points
;
points
+=
QString
::
number
(
swCoord
.
latitude
(),
'f'
,
10
)
+
","
+
QString
::
number
(
swCoord
.
longitude
(),
'f'
,
10
)
+
","
;
...
...
@@ -102,6 +118,17 @@ void TerrainAirMapQuery::_sendQuery(const QString& path, const QUrlQuery& urlQue
}
connect
(
networkReply
,
&
QNetworkReply
::
finished
,
this
,
&
TerrainAirMapQuery
::
_requestFinished
);
connect
(
networkReply
,
QOverload
<
QNetworkReply
::
NetworkError
>::
of
(
&
QNetworkReply
::
error
),
this
,
&
TerrainAirMapQuery
::
_requestError
);
}
void
TerrainAirMapQuery
::
_requestError
(
QNetworkReply
::
NetworkError
code
)
{
QNetworkReply
*
reply
=
qobject_cast
<
QNetworkReply
*>
(
QObject
::
sender
());
if
(
code
!=
QNetworkReply
::
NoError
)
{
qCDebug
(
TerrainQueryLog
)
<<
"_requestError error:url:data"
<<
reply
->
error
()
<<
reply
->
url
()
<<
reply
->
readAll
();
return
;
}
}
void
TerrainAirMapQuery
::
_requestFinished
(
void
)
...
...
@@ -109,7 +136,7 @@ void TerrainAirMapQuery::_requestFinished(void)
QNetworkReply
*
reply
=
qobject_cast
<
QNetworkReply
*>
(
QObject
::
sender
());
if
(
reply
->
error
()
!=
QNetworkReply
::
NoError
)
{
qCDebug
(
TerrainQueryLog
)
<<
"_requestFinished error:
data"
<<
reply
->
error
()
<<
reply
->
readAll
();
qCDebug
(
TerrainQueryLog
)
<<
"_requestFinished error:
url:data"
<<
reply
->
error
()
<<
reply
->
url
()
<<
reply
->
readAll
();
reply
->
deleteLater
();
_requestFailed
();
return
;
...
...
@@ -138,7 +165,7 @@ void TerrainAirMapQuery::_requestFinished(void)
// Send back data
const
QJsonValue
&
jsonData
=
rootObject
[
"data"
];
qCDebug
(
TerrainQueryLog
)
<<
"_requestFinished sucess"
;
qCDebug
(
TerrainQueryLog
)
<<
"_requestFinished suc
c
ess"
;
switch
(
_queryMode
)
{
case
QueryModeCoordinates
:
emit
_parseCoordinateData
(
jsonData
);
...
...
@@ -229,6 +256,11 @@ TerrainOfflineAirMapQuery::TerrainOfflineAirMapQuery(QObject* parent)
void
TerrainOfflineAirMapQuery
::
requestCoordinateHeights
(
const
QList
<
QGeoCoordinate
>&
coordinates
)
{
if
(
qgcApp
()
->
runningUnitTests
())
{
emit
coordinateHeights
(
false
,
QList
<
double
>
());
return
;
}
if
(
coordinates
.
length
()
==
0
)
{
return
;
}
...
...
@@ -238,11 +270,21 @@ void TerrainOfflineAirMapQuery::requestCoordinateHeights(const QList<QGeoCoordin
void
TerrainOfflineAirMapQuery
::
requestPathHeights
(
const
QGeoCoordinate
&
fromCoord
,
const
QGeoCoordinate
&
toCoord
)
{
if
(
qgcApp
()
->
runningUnitTests
())
{
emit
pathHeights
(
false
,
qQNaN
(),
qQNaN
(),
QList
<
double
>
());
return
;
}
_terrainTileManager
->
addPathQuery
(
this
,
fromCoord
,
toCoord
);
}
void
TerrainOfflineAirMapQuery
::
requestCarpetHeights
(
const
QGeoCoordinate
&
swCoord
,
const
QGeoCoordinate
&
neCoord
,
bool
statsOnly
)
{
if
(
qgcApp
()
->
runningUnitTests
())
{
emit
carpetHeights
(
false
,
qQNaN
(),
qQNaN
(),
QList
<
QList
<
double
>>
());
return
;
}
// TODO
Q_UNUSED
(
swCoord
);
Q_UNUSED
(
neCoord
);
...
...
src/Terrain/TerrainQuery.h
View file @
71736dcc
...
...
@@ -67,6 +67,7 @@ public:
void
requestCarpetHeights
(
const
QGeoCoordinate
&
swCoord
,
const
QGeoCoordinate
&
neCoord
,
bool
statsOnly
)
final
;
private
slots
:
void
_requestError
(
QNetworkReply
::
NetworkError
code
);
void
_requestFinished
(
void
);
private:
...
...
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