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
2ff5f135
Commit
2ff5f135
authored
Mar 28, 2019
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
before adding WimaVehicle
parent
03cf8047
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
92 additions
and
35 deletions
+92
-35
qgroundcontrol.pro
qgroundcontrol.pro
+4
-3
WimaController.cc
src/MissionManager/WimaController.cc
+27
-2
WimaController.h
src/MissionManager/WimaController.h
+10
-8
WimaPolygon.cc
src/MissionManager/WimaPolygon.cc
+6
-7
WimaPolygon.h
src/MissionManager/WimaPolygon.h
+16
-15
WimaPolygonContainer.cc
src/MissionManager/WimaPolygonContainer.cc
+5
-0
WimaPolygonContainer.h
src/MissionManager/WimaPolygonContainer.h
+1
-0
WimaVehicle.cc
src/MissionManager/WimaVehicle.cc
+9
-0
WimaVehicle.h
src/MissionManager/WimaVehicle.h
+14
-0
No files found.
qgroundcontrol.pro
View file @
2ff5f135
...
...
@@ -408,13 +408,13 @@ HEADERS += \
src
/
comm
/
MavlinkMessagesTimer
.
h
\
src
/
GPS
/
Drivers
/
src
/
base_station
.
h
\
src
/
MissionManager
/
WimaController
.
h
\
src
/
MissionManager
/
WimaFlyArea
.
h
\
src
/
MissionManager
/
WimaPolygon
.
h
\
src
/
MissionManager
/
WimaServicePolygon
.
h
\
src
/
MissionManager
/
WimaVehicleCorridor
.
h
\
src
/
MissionManager
/
WimaVehicleMeasurementPolygon
.
h
\
src
/
MissionManager
/
WimaGlobalMeasurementPolygon
.
h
\
src
/
MissionManager
/
WimaPolygonContainer
.
h
src
/
MissionManager
/
WimaPolygonContainer
.
h
\
src
/
MissionManager
/
WimaVehicle
.
h
SOURCES
+=
\
src
/
api
/
QGCCorePlugin
.
cc
\
...
...
@@ -429,7 +429,8 @@ SOURCES += \
src
/
MissionManager
/
WimaVehicleCorridor
.
cc
\
src
/
MissionManager
/
WimaVehicleMeasurementPolygon
.
cc
\
src
/
MissionManager
/
WimaGlobalMeasurementPolygon
.
cc
\
src
/
MissionManager
/
WimaPolygonContainer
.
cc
src
/
MissionManager
/
WimaPolygonContainer
.
cc
\
src
/
MissionManager
/
WimaVehicle
.
cc
#
#
Unit
Test
specific
configuration
goes
here
(
requires
full
debug
build
with
all
plugins
)
...
...
src/MissionManager/WimaController.cc
View file @
2ff5f135
...
...
@@ -9,8 +9,6 @@ WimaController::WimaController(QObject *parent) :
}
void
WimaController
::
setMasterController
(
PlanMasterController
*
masterC
)
{
_masterController
=
masterC
;
...
...
@@ -26,6 +24,33 @@ void WimaController::setMissionController(MissionController *missionC)
void
WimaController
::
addGlobalMeasurementArea
()
{
WimaGlobalMeasurementPolygon
*
poly
=
new
WimaGlobalMeasurementPolygon
(
this
);
_visualItems
.
append
(
poly
);
emit
visualItemsChanged
();
}
void
WimaController
::
removeArea
(
int
index
)
{
if
(
index
>
0
&&
index
<
_visualItems
.
size
()){
_visualItems
.
removeAt
(
index
);
emit
visualItemsChanged
();
}
else
{
qWarning
(
"Index out of bounds!"
);
}
}
void
WimaController
::
addServiceArea
()
{
WimaServicePolygon
*
poly
=
new
WimaServicePolygon
(
this
);
_visualItems
.
append
(
poly
);
emit
visualItemsChanged
();
}
void
WimaController
::
recalcVehicleCorridor
()
{
}
...
...
src/MissionManager/WimaController.h
View file @
2ff5f135
...
...
@@ -21,12 +21,13 @@ public:
Q_PROPERTY
(
PlanMasterController
*
masterController
READ
masterController
WRITE
setMasterController
NOTIFY
masterControllerChanged
)
Q_PROPERTY
(
MissionController
*
missionController
READ
missionController
WRITE
setMissionController
NOTIFY
missionControllerChanged
)
Q_PROPERTY
(
QList
<
WimaPolygon
*>
visualItems
READ
visualItems
NOTIFY
visualItemsChanged
)
Q_PROPERTY
(
QList
<
WimaPolygon
*>&
visualItems
READ
visualItems
NOTIFY
visualItemsChanged
)
Q_PROPERTY
(
QList
<
WimaPolygon
*>&
editorItems
READ
editorItems
NOTIFY
visualItemsChanged
)
// Property accessors
PlanMasterController
*
masterController
(
void
)
const
{
return
_masterController
;}
MissionController
*
missionController
(
void
)
const
{
return
_missionController
;}
QList
<
WimaPolygon
*>&
visualItems
(
void
)
const
{
return
}
QList
<
WimaPolygon
*>&
visualItems
(
void
)
{
return
_visualItemsContainer
.
returnFlatList
();
}
...
...
@@ -36,12 +37,8 @@ public:
void
setMissionController
(
MissionController
*
missionController
);
Q_INVOKABLE
void
addGlobalMeasurementArea
();
Q_INVOKABLE
void
remove
GlobalMeasurement
Area
(
int
index
);
Q_INVOKABLE
void
removeArea
(
int
index
);
Q_INVOKABLE
void
addServiceArea
();
Q_INVOKABLE
void
removeServiceArea
(
int
index
);
Q_INVOKABLE
void
recalcVehicleCorridor
();
Q_INVOKABLE
void
recalcVehicleMeasurementArea
();
Q_INVOKABLE
void
startMission
();
Q_INVOKABLE
void
abortMission
();
...
...
@@ -58,10 +55,15 @@ signals:
void
missionControllerChanged
(
void
);
void
visualItemsChanged
(
void
);
private
slots
:
void
recalcVehicleCorridor
();
void
recalcVehicleMeasurementAreas
();
void
recalcAll
();
private:
bool
_planView
;
WimaPolygonContainer
_visualItemsContainer
;
QList
<
WimaPolygon
*>
_visualItems
;
PlanMasterController
*
_masterController
;
MissionController
*
_missionController
;
...
...
src/MissionManager/WimaPolygon.cc
View file @
2ff5f135
...
...
@@ -11,6 +11,7 @@ WimaPolygon::WimaPolygon(QObject *parent) :
WimaPolygon
::
WimaPolygon
(
QGCMapPolygon
*
other
,
QObject
*
parent
)
:
WimaPolygon
(
parent
)
{
delete
_polygon
;
*
_polygon
=
*
other
;
}
...
...
@@ -19,7 +20,7 @@ void WimaPolygon::setMaxAltitude(double alt)
{
if
(
alt
>
0
&&
alt
!=
_maxAltitude
){
_maxAltitude
=
alt
;
emit
maxAltitudeChanged
(
_maxAltitude
);
emit
maxAltitudeChanged
();
}
}
...
...
@@ -28,17 +29,15 @@ void WimaPolygon::setVehicle(Vehicle *vehicle)
{
if
(
_vehicle
!=
vehicle
){
_vehicle
=
vehicle
;
emit
vehicleChanged
(
_vehicle
);
emit
vehicleChanged
();
}
}
Q
mlObjectListModel
*
WimaPolygon
::
splitPolygonArea
(
int
numberOfFractions
)
Q
GCMapPolygon
*
WimaPolygon
::
splitPolygonArea
(
int
numberOfFractions
)
{
if
(
numberOfFractions
>
0
){
_polygonFractions
->
append
(
this
);
emit
polygonFractionsChanged
(
_polygonFractions
);
return
_polygonFractions
;
QGCMapPolygon
*
poly
=
new
QGCMapPolygon
(
this
->
polygon
(),
this
);
return
poly
;
}
return
nullptr
;
}
...
...
src/MissionManager/WimaPolygon.h
View file @
2ff5f135
...
...
@@ -2,6 +2,7 @@
#define WIMAPOLYGON_H
#include "QGCMapPolygon.h"
#include "QGCMapPolyline.h"
#include "Vehicle.h"
#include "qobject.h"
...
...
@@ -16,39 +17,38 @@ public:
Q_PROPERTY
(
double
maxAltitude
READ
maxAltitude
WRITE
setMaxAltitude
NOTIFY
maxAltitudeChanged
)
Q_PROPERTY
(
QString
mapVisualQML
READ
mapVisualQML
CONSTANT
)
Q_PROPERTY
(
QString
editorQML
READ
editorQML
CONSTANT
)
Q_PROPERTY
(
Vehicle
*
vehicle
READ
vehicle
WRITE
setVehicle
NOTIFY
vehicleChanged
)
Q_PROPERTY
(
QGCMapPolygon
*
polygon
READ
polygon
NOTIFY
polygonChanged
)
Q_PROPERTY
(
double
maxAltitude
READ
maxAltitude
WRITE
setMaxAltitude
NOTIFY
maxAltitudeChanged
)
Q_PROPERTY
(
QString
mapVisualQML
READ
mapVisualQML
CONSTANT
)
Q_PROPERTY
(
QString
editorQML
READ
editorQML
CONSTANT
)
Q_PROPERTY
(
Vehicle
*
vehicle
READ
vehicle
WRITE
setVehicle
NOTIFY
vehicleChanged
)
Q_PROPERTY
(
QGCMapPolygon
*
polygon
READ
polygon
NOTIFY
polygonChanged
)
Q_PROPERTY
(
QList
<
WimaPolygon
*>
subPolygons
READ
subPolygons
NOTIFY
subPolygonsChanged
)
Q_PROPERTY
(
QList
<
QGCMapPolyline
*>
subPolylines
READ
subPolylines
NOTIFY
subPolylinesChanged
)
//Property accessors
double
maxAltitude
(
void
)
const
{
return
_maxAltitude
;}
Vehicle
*
vehicle
(
void
)
const
{
return
_vehicle
;}
QGCMapPolygon
*
polygon
(
void
)
const
{
return
_polygon
;}
QList
<
WimaPolygon
*>
subPolygons
(
void
)
const
{
return
_subPolygons
;}
QList
<
QGCMapPolyline
*>
subPolylines
(
void
)
const
{
return
_subPolylines
;}
virtual
QString
mapVisualQML
(
void
)
const
=
0
;
virtual
QString
editorQML
(
void
)
const
=
0
;
virtual
QList
<
WimaPolygon
*>&
subPolygons
(
void
)
{
return
_subPolygons
;}
//Property setters
void
setMaxAltitude
(
double
alt
);
void
setName
(
QString
name
);
void
setVehicle
(
Vehicle
*
vehicle
);
/// Splits the polygon in numberOfFractions fractions with equal area.
/// @param polygonFractions The polygon List to add the fractions to.
/// @param numberOfFractions The number of fractions to split the polygon to.
Q_INVOKABLE
QmlObjectListModel
*
splitPolygonArea
(
int
numberOfFractions
);
QGCMapPolygon
*
splitPolygonArea
(
int
numberOfFractions
);
signals:
void
maxAltitudeChanged
(
double
alt
);
void
vehicleChanged
(
Vehicle
*
vehicle
);
void
maxAltitudeChanged
(
void
);
void
vehicleChanged
(
void
);
void
subPolygons
(
void
);
protected:
QGCMapPolygon
*
extractQGCPolygon
(
void
);
private:
...
...
@@ -57,6 +57,7 @@ private:
Vehicle
*
_vehicle
;
QGCMapPolygon
*
_polygon
;
QList
<
WimaPolygon
*>
_subPolygons
;
QList
<
QGCMapPolyline
*>
_subPolylines
;
};
#endif // WIMAPOLYGON_H
src/MissionManager/WimaPolygonContainer.cc
View file @
2ff5f135
...
...
@@ -64,6 +64,11 @@ QList<WimaPolygon*>& WimaPolygonContainer::returnFlatList()
return
_flatList
;
}
int
WimaPolygonContainer
::
count
()
{
return
_itemList
.
size
();
}
void
WimaPolygonContainer
::
setFlatListDirty
(
void
)
{
_flatListDirty
=
true
;
...
...
src/MissionManager/WimaPolygonContainer.h
View file @
2ff5f135
...
...
@@ -17,6 +17,7 @@ public:
void
removeItem
(
int
itemIndex
);
void
removeItem
(
WimaPolygon
*
polygon
);
QList
<
WimaPolygon
*>&
returnFlatList
();
int
count
(
void
);
signals:
void
itemListChanged
(
void
);
...
...
src/MissionManager/WimaVehicle.cc
0 → 100644
View file @
2ff5f135
#include "WimaVehicle.h"
WimaVehicle
::
WimaVehicle
(
QObject
*
parent
)
:
Vehicle
(
parent
)
{
}
src/MissionManager/WimaVehicle.h
0 → 100644
View file @
2ff5f135
#ifndef WIMAVEHICLE_H
#define WIMAVEHICLE_H
#include <QObject>
#include "Vehicle.h"
class
WimaVehicle
:
public
Vehicle
{
Q_OBJECT
public:
WimaVehicle
(
QObject
*
parent
);
};
#endif // WIMAVEHICLE_H
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