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
e63bb142
Commit
e63bb142
authored
Jul 08, 2019
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
about to add SphericalGeometryCalculus class
parent
32c7f879
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
142 additions
and
86 deletions
+142
-86
qgroundcontrol.pro
qgroundcontrol.pro
+4
-2
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+4
-1
SphericalGeometryCalculus.cc
src/Wima/SphericalGeometryCalculus.cc
+6
-0
SphericalGeometryCalculus.h
src/Wima/SphericalGeometryCalculus.h
+17
-0
WimaArea.h
src/Wima/WimaArea.h
+2
-2
WimaAreaData.cc
src/Wima/WimaAreaData.cc
+12
-41
WimaAreaData.h
src/Wima/WimaAreaData.h
+2
-0
WimaController.cc
src/Wima/WimaController.cc
+17
-21
WimaController.h
src/Wima/WimaController.h
+1
-1
WimaCorridorData.cpp
src/Wima/WimaCorridorData.cpp
+12
-2
WimaCorridorData.h
src/Wima/WimaCorridorData.h
+4
-0
WimaJoinedAreaData.cc
src/Wima/WimaJoinedAreaData.cc
+13
-2
WimaJoinedAreaData.h
src/Wima/WimaJoinedAreaData.h
+4
-0
WimaMeasurementAreaData.cc
src/Wima/WimaMeasurementAreaData.cc
+14
-2
WimaMeasurementAreaData.h
src/Wima/WimaMeasurementAreaData.h
+4
-0
WimaPlanData.cc
src/Wima/WimaPlanData.cc
+3
-3
WimaPlanData.h
src/Wima/WimaPlanData.h
+3
-2
WimaPlaner.cc
src/Wima/WimaPlaner.cc
+1
-1
WimaServiceAreaData.cc
src/Wima/WimaServiceAreaData.cc
+16
-6
WimaServiceAreaData.h
src/Wima/WimaServiceAreaData.h
+3
-0
No files found.
qgroundcontrol.pro
View file @
e63bb142
...
...
@@ -423,7 +423,8 @@ HEADERS += \
src
/
Wima
/
WimaMeasurementAreaData
.
h
\
src
/
Wima
/
WimaPlanData
.
h
\
src
/
Wima
/
WimaJoinedArea
.
h
\
src
/
Wima
/
WimaJoinedAreaData
.
h
src
/
Wima
/
WimaJoinedAreaData
.
h
\
src
/
Wima
/
SphericalGeometryCalculus
.
h
SOURCES
+=
\
src
/
api
/
QGCCorePlugin
.
cc
\
src
/
api
/
QGCOptions
.
cc
\
...
...
@@ -445,7 +446,8 @@ SOURCES += \
src
/
Wima
/
WimaPlanData
.
cc
\
src
/
Wima
/
WimaMeasurementAreaData
.
cc
\
src
/
Wima
/
WimaJoinedArea
.
cc
\
src
/
Wima
/
WimaJoinedAreaData
.
cc
src
/
Wima
/
WimaJoinedAreaData
.
cc
\
src
/
Wima
/
SphericalGeometryCalculus
.
cc
#
#
Unit
Test
specific
configuration
goes
here
(
requires
full
debug
build
with
all
plugins
)
...
...
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
e63bb142
...
...
@@ -200,7 +200,10 @@ FlightMap {
delegate
:
MapPolygon
{
path
:
object
.
path
;
border.color
:
"
black
"
color
:
"
green
"
color
:
object
.
type
===
"
WimaJoinedAreaData
"
?
"
gray
"
:
object
.
type
===
"
WimaServiceAreaData
"
?
"
yellow
"
:
object
.
type
===
"
WimaMeasurementAreaData
"
?
"
green
"
:
"
transparent
"
opacity
:
0.25
z
:
QGroundControl
.
zOrderTrajectoryLines
-
1
}
...
...
src/Wima/SphericalGeometryCalculus.cc
0 → 100644
View file @
e63bb142
#include "SphericalGeometryCalculus.h"
SphericalGeometryCalculus
::
SphericalGeometryCalculus
(
QObject
*
parent
)
:
QObject
(
parent
)
{
}
src/Wima/SphericalGeometryCalculus.h
0 → 100644
View file @
e63bb142
#ifndef SPHERICALGEOMETRYCALCULUS_H
#define SPHERICALGEOMETRYCALCULUS_H
#include <QObject>
class
SphericalGeometryCalculus
:
public
QObject
{
Q_OBJECT
public:
explicit
SphericalGeometryCalculus
(
QObject
*
parent
=
nullptr
);
signals:
public
slots
:
};
#endif // SPHERICALGEOMETRYCALCULUS_H
\ No newline at end of file
src/Wima/WimaArea.h
View file @
e63bb142
...
...
@@ -28,8 +28,8 @@ public:
double
maxAltitude
(
void
)
const
{
return
_maxAltitude
;}
// overrides from WimaArea
virtual
QString
mapVisualQML
(
void
)
const
;
virtual
QString
editorQML
(
void
)
const
;
virtual
QString
mapVisualQML
(
void
)
const
{
return
""
;
}
virtual
QString
editorQML
(
void
)
const
{
return
""
;
}
// Member Methodes
int
getClosestVertexIndex
(
const
QGeoCoordinate
&
coordinate
)
const
;
...
...
src/Wima/WimaAreaData.cc
View file @
e63bb142
...
...
@@ -6,47 +6,6 @@ WimaAreaData::WimaAreaData(QObject *parent)
_maxAltitude
=
0
;
}
WimaAreaData
::
WimaAreaData
(
const
WimaAreaData
&
other
,
QObject
*
parent
)
:
QObject
(
parent
)
{
*
this
=
other
;
}
WimaAreaData
::
WimaAreaData
(
const
WimaArea
&
other
,
QObject
*
parent
)
:
QObject
(
parent
)
{
*
this
=
other
;
}
/*!
* \fn WimaAreaData &WimaAreaData::operator=(const WimaAreaData &otherData)
*
* Copies the maximum altitude and the path of the \c WimaAreaData \a otherData to the calling object.
* Returns a reference to the calling object.
*/
WimaAreaData
&
WimaAreaData
::
operator
=
(
const
WimaAreaData
&
otherData
)
{
setMaxAltitude
(
otherData
.
maxAltitude
());
setPath
(
otherData
.
path
());
return
*
this
;
}
/*!
* \overload operator=()
*
* Copies the maximum altitude and the path of \c WimaArea \a otherArea to the calling object.
* Returns a reference to the calling object.
*/
WimaAreaData
&
WimaAreaData
::
operator
=
(
const
WimaArea
&
otherArea
)
{
setMaxAltitude
(
otherArea
.
maxAltitude
());
setPath
(
otherArea
.
coordinateList
());
return
*
this
;
}
/*!
* \fn double WimaAreaData::maxAltitude()
*
...
...
@@ -88,9 +47,21 @@ void WimaAreaData::setPath(const QVariantList &coordinateList)
_path
.
append
(
coordinateList
);
}
/*!
* \fn void WimaAreaData::assign(const WimaAreaData &other)
*
* Assigns \a other to the invoking object
*/
void
WimaAreaData
::
assign
(
const
WimaAreaData
&
other
)
{
setMaxAltitude
(
other
.
maxAltitude
());
setPath
(
other
.
path
());
}
void
WimaAreaData
::
assign
(
const
WimaArea
&
other
)
{
setMaxAltitude
(
other
.
maxAltitude
());
setPath
(
other
.
path
());
}
...
...
src/Wima/WimaAreaData.h
View file @
e63bb142
...
...
@@ -12,6 +12,7 @@ class WimaAreaData : public QObject // Abstract class for all WimaAreaData deriv
public:
Q_PROPERTY
(
const
QVariantList
path
READ
path
NOTIFY
pathChanged
)
Q_PROPERTY
(
QString
type
READ
type
CONSTANT
)
WimaAreaData
(
QObject
*
parent
=
nullptr
);
//WimaAreaData(const WimaAreaData &other, QObject *parent = nullptr);
...
...
@@ -35,6 +36,7 @@ public slots:
protected:
void
assign
(
const
WimaAreaData
&
other
);
void
assign
(
const
WimaArea
&
other
);
private:
// Member Functions
...
...
src/Wima/WimaController.cc
View file @
e63bb142
...
...
@@ -145,6 +145,7 @@ void WimaController::containerDataValidChanged(bool valid)
qWarning
(
"WimaController::containerDataValidChanged(): No container assigned!"
);
}
_localPlanDataValid
=
false
;
_visualItems
.
clear
();
WimaPlanData
planData
=
_container
->
pull
();
// extract list with WimaAreas
...
...
@@ -152,58 +153,53 @@ void WimaController::containerDataValidChanged(bool valid)
int
areaCounter
=
0
;
int
numAreas
=
4
;
// extract only numAreas Areas, if there are more they are invalid and ignored
bool
joinedAreaAssigned
=
false
;
qWarning
()
<<
QString
(
"List Size: %1"
).
arg
(
areaList
.
size
());
for
(
int
i
=
0
;
i
<
areaList
.
size
();
i
++
)
{
const
WimaAreaData
*
areaData
=
areaList
[
i
];
qWarning
()
<<
areaData
->
type
();
if
(
areaData
->
type
()
==
WimaServiceAreaData
::
typeString
)
{
// is it a service area?
//_serviceArea = *qobject_cast<
WimaServiceAreaData*>(areaData);
_serviceArea
=
*
qobject_cast
<
const
WimaServiceAreaData
*>
(
areaData
);
qWarning
(
"Service area, wuhuuu!"
);
areaCounter
++
;
_visualItems
.
append
(
&
_serviceArea
);
continue
;
}
/*WimaMeasurementAreaData *measurementAreaData = qobject_cast<WimaMeasurementAreaData*>(areaData);
if (measurementAreaData != nullptr) { // is it a measurement area?
_measurementArea = *measurementAreaData;
if
(
areaData
->
type
()
==
WimaMeasurementAreaData
::
typeString
)
{
// is it a measurement area?
_measurementArea
=
*
qobject_cast
<
const
WimaMeasurementAreaData
*>
(
areaData
);
qWarning
(
"Measurement area, wuhuuu!"
);
areaCounter
++
;
_visualItems
.
append
(
&
_measurementArea
);
continue
;
}
WimaCorridorData *corridorAreaData = qobject_cast<WimaCorridorData*>(areaData);
if (corridorAreaData != nullptr) { // is it a corridor?
_corridor = *corridorAreaData;
qWarning("Corridor, wuhuuu!");
if
(
areaData
->
type
()
==
WimaCorridorData
::
typeString
)
{
// is it a corridor?
_corridor
=
*
qobject_cast
<
const
WimaCorridorData
*>
(
areaData
);
qWarning
(
"WimaCorridorData, wuhuuu!"
);
areaCounter
++
;
//_visualItems.append(&_corridor); // not needed
continue
;
}
if (
!joinedAreaAssigned) { // first WimaAreaData object is assumed to be the joined Area
_joinedArea =
*areaData
;
qWarning("
Joined are
a, wuhuuu!");
if
(
areaData
->
type
()
==
WimaJoinedAreaData
::
typeString
)
{
// is it a corridor?
_joinedArea
=
*
qobject_cast
<
const
WimaJoinedAreaData
*>
(
areaData
)
;
qWarning
(
"
WimaJoinedAreaDat
a, wuhuuu!"
);
areaCounter
++
;
joinedAreaAssigned = true
;
_visualItems
.
append
(
&
_joinedArea
)
;
continue
;
}
*/
}
if
(
areaCounter
>=
numAreas
)
break
;
}
// append areas to _visualItems, don't append _corridor, it's not necessary to display it in flyView
_visualItems
.
clear
();
//_visualItems.append(&_measurementArea);
//_visualItems.append(&_serviceArea);
_visualItems
.
append
(
&
_joinedArea
);
_localPlanDataValid
=
true
;
if
(
areaCounter
==
numAreas
)
_localPlanDataValid
=
true
;
}
else
{
_localPlanDataValid
=
false
;
_visualItems
.
clear
();
...
...
src/Wima/WimaController.h
View file @
e63bb142
...
...
@@ -98,7 +98,7 @@ private:
QString
_currentFile
;
// file for saveing
WimaDataContainer
*
_container
;
// container for data exchange with WimaController
QmlObjectListModel
_visualItems
;
// contains all visible areas
Wima
AreaData
_joinedArea
;
// joined area fromed by opArea, serArea, _corridor
Wima
JoinedAreaData
_joinedArea
;
// joined area fromed by opArea, serArea, _corridor
WimaMeasurementAreaData
_measurementArea
;
// measurement area
WimaServiceAreaData
_serviceArea
;
// area for supplying
WimaCorridorData
_corridor
;
// corridor connecting opArea and serArea
...
...
src/Wima/WimaCorridorData.cpp
View file @
e63bb142
...
...
@@ -27,7 +27,7 @@ WimaCorridorData::WimaCorridorData(const WimaCorridor &other, QObject *parent)
*/
WimaCorridorData
&
WimaCorridorData
::
operator
=
(
const
WimaCorridorData
&
other
)
{
WimaAreaData
::
operator
=
(
other
);
this
->
assign
(
other
);
return
*
this
;
}
...
...
@@ -39,7 +39,7 @@ WimaCorridorData &WimaCorridorData::operator=(const WimaCorridorData &other)
*/
WimaCorridorData
&
WimaCorridorData
::
operator
=
(
const
WimaCorridor
&
other
)
{
WimaAreaData
::
operator
=
(
other
);
this
->
assign
(
other
);
return
*
this
;
}
...
...
@@ -49,6 +49,16 @@ QString WimaCorridorData::type() const
return
this
->
typeString
;
}
void
WimaCorridorData
::
assign
(
const
WimaCorridorData
&
corridorData
)
{
WimaAreaData
::
assign
(
corridorData
);
}
void
WimaCorridorData
::
assign
(
const
WimaCorridor
&
corridor
)
{
WimaAreaData
::
assign
(
corridor
);
}
/*!
* \class WimaAreaData::WimaCorridorData
...
...
src/Wima/WimaCorridorData.h
View file @
e63bb142
...
...
@@ -27,6 +27,10 @@ signals:
public
slots
:
protected:
void
assign
(
const
WimaCorridorData
&
corridorData
);
void
assign
(
const
WimaCorridor
&
corridor
);
private:
};
src/Wima/WimaJoinedAreaData.cc
View file @
e63bb142
...
...
@@ -27,7 +27,7 @@ WimaJoinedAreaData::WimaJoinedAreaData(const WimaJoinedArea &other, QObject *par
*/
WimaJoinedAreaData
&
WimaJoinedAreaData
::
operator
=
(
const
WimaJoinedAreaData
&
other
)
{
WimaAreaData
::
operator
=
(
other
);
assign
(
other
);
return
*
this
;
}
...
...
@@ -39,7 +39,7 @@ WimaJoinedAreaData &WimaJoinedAreaData::operator=(const WimaJoinedAreaData &othe
*/
WimaJoinedAreaData
&
WimaJoinedAreaData
::
operator
=
(
const
WimaJoinedArea
&
other
)
{
WimaAreaData
::
operator
=
(
other
);
assign
(
other
);
return
*
this
;
}
...
...
@@ -48,6 +48,17 @@ QString WimaJoinedAreaData::type() const
return
this
->
typeString
;
}
void
WimaJoinedAreaData
::
assign
(
const
WimaJoinedAreaData
&
other
)
{
WimaAreaData
::
assign
(
other
);
}
void
WimaJoinedAreaData
::
assign
(
const
WimaJoinedArea
&
other
)
{
WimaAreaData
::
assign
(
other
);
}
/*!
* \class WimaAreaData::WimaJoinedAreaData
...
...
src/Wima/WimaJoinedAreaData.h
View file @
e63bb142
...
...
@@ -26,6 +26,10 @@ signals:
public
slots
:
protected:
void
assign
(
const
WimaJoinedAreaData
&
other
);
void
assign
(
const
WimaJoinedArea
&
other
);
private:
};
src/Wima/WimaMeasurementAreaData.cc
View file @
e63bb142
...
...
@@ -27,7 +27,7 @@ WimaMeasurementAreaData::WimaMeasurementAreaData(const WimaMeasurementArea &othe
*/
WimaMeasurementAreaData
&
WimaMeasurementAreaData
::
operator
=
(
const
WimaMeasurementAreaData
&
other
)
{
WimaAreaData
::
operator
=
(
other
);
assign
(
other
);
return
*
this
;
}
...
...
@@ -39,7 +39,7 @@ WimaMeasurementAreaData &WimaMeasurementAreaData::operator=(const WimaMeasuremen
*/
WimaMeasurementAreaData
&
WimaMeasurementAreaData
::
operator
=
(
const
WimaMeasurementArea
&
other
)
{
WimaAreaData
::
operator
=
(
other
);
assign
(
other
);
return
*
this
;
}
...
...
@@ -49,4 +49,16 @@ QString WimaMeasurementAreaData::type() const
return
this
->
typeString
;
}
void
WimaMeasurementAreaData
::
assign
(
const
WimaMeasurementAreaData
&
other
)
{
WimaAreaData
::
assign
(
other
);
}
void
WimaMeasurementAreaData
::
assign
(
const
WimaMeasurementArea
&
other
)
{
WimaAreaData
::
assign
(
other
);
}
src/Wima/WimaMeasurementAreaData.h
View file @
e63bb142
...
...
@@ -28,6 +28,10 @@ signals:
public
slots
:
protected:
void
assign
(
const
WimaMeasurementAreaData
&
other
);
void
assign
(
const
WimaMeasurementArea
&
other
);
private:
// see WimaMeasurementArea.h for explanation
};
src/Wima/WimaPlanData.cc
View file @
e63bb142
...
...
@@ -24,8 +24,8 @@ WimaPlanData &WimaPlanData::operator=(const WimaPlanData &other)
_areaList
.
clear
();
for
(
int
i
=
0
;
i
<
areaList
.
size
();
i
++
)
{
const
WimaAreaData
*
areaData
=
areaList
[
i
];
if
(
areaData
->
type
()
==
Wima
AreaData
::
typeString
)
{
this
->
append
(
*
areaData
);
if
(
areaData
->
type
()
==
WimaJoined
AreaData
::
typeString
)
{
this
->
append
(
*
qobject_cast
<
const
WimaJoinedAreaData
*>
(
areaData
)
);
}
else
if
(
areaData
->
type
()
==
WimaServiceAreaData
::
typeString
)
{
this
->
append
(
*
qobject_cast
<
const
WimaServiceAreaData
*>
(
areaData
));
}
else
if
(
areaData
->
type
()
==
WimaMeasurementAreaData
::
typeString
)
{
...
...
@@ -44,7 +44,7 @@ WimaPlanData &WimaPlanData::operator=(const WimaPlanData &other)
*
* Adds a WimaAreaData item.
*/
void
WimaPlanData
::
append
(
const
WimaAreaData
&
areaData
)
void
WimaPlanData
::
append
(
const
Wima
Joined
AreaData
&
areaData
)
{
_joinedArea
=
areaData
;
...
...
src/Wima/WimaPlanData.h
View file @
e63bb142
...
...
@@ -6,6 +6,7 @@
#include "WimaServiceAreaData.h"
#include "WimaCorridorData.h"
#include "WimaMeasurementAreaData.h"
#include "WimaJoinedAreaData.h"
class
WimaPlanData
:
QObject
{
...
...
@@ -16,7 +17,7 @@ public:
WimaPlanData
&
operator
=
(
const
WimaPlanData
&
other
);
// Member Methodes
void
append
(
const
Wima
AreaData
&
areaData
);
void
append
(
const
Wima
JoinedAreaData
&
areaData
);
void
append
(
const
WimaServiceAreaData
&
areaData
);
void
append
(
const
WimaCorridorData
&
areaData
);
void
append
(
const
WimaMeasurementAreaData
&
areaData
);
...
...
@@ -30,7 +31,7 @@ signals:
void
areaListChanged
();
private:
Wima
AreaData
_joinedArea
;
Wima
JoinedAreaData
_joinedArea
;
WimaServiceAreaData
_serviceArea
;
WimaCorridorData
_corridor
;
WimaMeasurementAreaData
_measurementArea
;
...
...
src/Wima/WimaPlaner.cc
View file @
e63bb142
...
...
@@ -516,7 +516,7 @@ bool WimaPlaner::recalcJoinedArea(QString &errorString)
}
// join service area, op area and corridor
_joinedArea
.
WimaArea
::
operator
=
(
_serviceArea
);
_joinedArea
.
setPath
(
_serviceArea
.
path
()
);
_joinedArea
.
join
(
_corridor
);
if
(
!
_joinedArea
.
join
(
_measurementArea
)
)
{
errorString
.
append
(
tr
(
"Not able to join areas. Service area and measurement are"
...
...
src/Wima/WimaServiceAreaData.cc
View file @
e63bb142
...
...
@@ -23,18 +23,14 @@ WimaServiceAreaData::WimaServiceAreaData(const WimaServiceArea &other, QObject *
WimaServiceAreaData
&
WimaServiceAreaData
::
operator
=
(
const
WimaServiceAreaData
&
otherData
)
{
WimaAreaData
::
operator
=
(
otherData
);
setLandPosition
(
otherData
.
landPosition
());
setTakeOffPosition
(
otherData
.
takeOffPosition
());
this
->
assign
(
otherData
);
return
*
this
;
}
WimaServiceAreaData
&
WimaServiceAreaData
::
operator
=
(
const
WimaServiceArea
&
otherArea
)
{
WimaAreaData
::
operator
=
(
otherArea
);
setLandPosition
(
otherArea
.
landPosition
());
setTakeOffPosition
(
otherArea
.
takeOffPosition
());
this
->
assign
(
otherArea
);
return
*
this
;
}
...
...
@@ -93,6 +89,20 @@ void WimaServiceAreaData::setLandPosition(const QGeoCoordinate &newCoordinate)
}
}
void
WimaServiceAreaData
::
assign
(
const
WimaServiceAreaData
&
other
)
{
WimaAreaData
::
assign
(
other
);
setLandPosition
(
other
.
landPosition
());
setTakeOffPosition
(
other
.
takeOffPosition
());
}
void
WimaServiceAreaData
::
assign
(
const
WimaServiceArea
&
other
)
{
WimaAreaData
::
assign
(
other
);
setLandPosition
(
other
.
landPosition
());
setTakeOffPosition
(
other
.
takeOffPosition
());
}
/*!
* \class WimaAreaData::WimaServiceAreaData
...
...
src/Wima/WimaServiceAreaData.h
View file @
e63bb142
...
...
@@ -34,6 +34,9 @@ public slots:
void
setTakeOffPosition
(
const
QGeoCoordinate
&
newCoordinate
);
void
setLandPosition
(
const
QGeoCoordinate
&
newCoordinate
);
protected:
void
assign
(
const
WimaServiceAreaData
&
other
);
void
assign
(
const
WimaServiceArea
&
other
);
private:
// see WimaServieArea.h for explanation
QGeoCoordinate
_takeOffPosition
;
...
...
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