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
fd63568a
Commit
fd63568a
authored
Nov 12, 2020
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
befor removing .orig files
parent
7e00907d
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
52 additions
and
266 deletions
+52
-266
qgroundcontrol.pro
qgroundcontrol.pro
+0
-2
CircularSurvey.cc
src/Wima/CircularSurvey.cc
+12
-12
CircularGenerator.cpp
src/Wima/Snake/CircularGenerator.cpp
+2
-2
GeneratorBase.h
src/Wima/Snake/GeneratorBase.h
+1
-1
LinearGenerator.cpp
src/Wima/Snake/LinearGenerator.cpp
+2
-2
WimaBridge.h
src/Wima/WimaBridge.h
+3
-3
WimaController.cc
src/Wima/WimaController.cc
+0
-131
WimaController.h
src/Wima/WimaController.h
+0
-81
WimaPlanData.cc
src/Wima/WimaPlanData.cc
+25
-25
WimaPlaner.cc
src/Wima/WimaPlaner.cc
+6
-6
WimaPlaner.h
src/Wima/WimaPlaner.h
+1
-1
No files found.
qgroundcontrol.pro
View file @
fd63568a
...
@@ -499,7 +499,6 @@ HEADERS += \
...
@@ -499,7 +499,6 @@ HEADERS += \
src
/
Wima
/
Geometry
/
WimaArea
.
h
\
src
/
Wima
/
Geometry
/
WimaArea
.
h
\
src
/
Wima
/
Geometry
/
WimaServiceArea
.
h
\
src
/
Wima
/
Geometry
/
WimaServiceArea
.
h
\
src
/
Wima
/
Geometry
/
WimaTrackerPolyline
.
h
\
src
/
Wima
/
Geometry
/
WimaTrackerPolyline
.
h
\
src
/
Wima
/
WimaController
.
h
\
src
/
Wima
/
WimaPlaner
.
h
\
src
/
Wima
/
WimaPlaner
.
h
\
src
/
Wima
/
Geometry
/
WimaMeasurementArea
.
h
\
src
/
Wima
/
Geometry
/
WimaMeasurementArea
.
h
\
src
/
Wima
/
Geometry
/
WimaCorridor
.
h
\
src
/
Wima
/
Geometry
/
WimaCorridor
.
h
\
...
@@ -577,7 +576,6 @@ SOURCES += \
...
@@ -577,7 +576,6 @@ SOURCES += \
src
/
Wima
/
Geometry
/
WimaArea
.
cc
\
src
/
Wima
/
Geometry
/
WimaArea
.
cc
\
src
/
Wima
/
Geometry
/
WimaServiceArea
.
cc
\
src
/
Wima
/
Geometry
/
WimaServiceArea
.
cc
\
src
/
Wima
/
Geometry
/
WimaTrackerPolyline
.
cc
\
src
/
Wima
/
Geometry
/
WimaTrackerPolyline
.
cc
\
src
/
Wima
/
WimaController
.
cc
\
src
/
Wima
/
WimaPlaner
.
cc
\
src
/
Wima
/
WimaPlaner
.
cc
\
src
/
Wima
/
Geometry
/
WimaMeasurementArea
.
cc
\
src
/
Wima
/
Geometry
/
WimaMeasurementArea
.
cc
\
src
/
Wima
/
Geometry
/
WimaCorridor
.
cc
\
src
/
Wima
/
Geometry
/
WimaCorridor
.
cc
\
...
...
src/Wima/CircularSurvey.cc
View file @
fd63568a
...
@@ -42,7 +42,7 @@ CircularSurvey::CircularSurvey(PlanMasterController *masterController,
...
@@ -42,7 +42,7 @@ CircularSurvey::CircularSurvey(PlanMasterController *masterController,
_metaDataMap
(
FactMetaData
::
createMapFromJsonFile
(
_metaDataMap
(
FactMetaData
::
createMapFromJsonFile
(
QStringLiteral
(
":/json/CircularSurvey.SettingsGroup.json"
),
this
)),
QStringLiteral
(
":/json/CircularSurvey.SettingsGroup.json"
),
this
)),
_variant
(
settingsGroup
,
_metaDataMap
[
variantName
]),
_variant
(
settingsGroup
,
_metaDataMap
[
variantName
]),
_
pAreaData
(
std
::
make_shared
<
WimaPlan
Data
>
()),
_
areaData
(
std
::
make_shared
<
Area
Data
>
()),
_pWorker
(
std
::
make_unique
<
RoutingThread
>
())
{
_pWorker
(
std
::
make_unique
<
RoutingThread
>
())
{
Q_UNUSED
(
kmlOrShpFile
)
Q_UNUSED
(
kmlOrShpFile
)
...
@@ -59,9 +59,9 @@ CircularSurvey::CircularSurvey(PlanMasterController *masterController,
...
@@ -59,9 +59,9 @@ CircularSurvey::CircularSurvey(PlanMasterController *masterController,
&
CircularSurvey
::
calculatingChanged
);
&
CircularSurvey
::
calculatingChanged
);
// Register Generators.
// Register Generators.
auto
lg
=
std
::
make_shared
<
routing
::
LinearGenerator
>
(
this
->
_
pA
reaData
);
auto
lg
=
std
::
make_shared
<
routing
::
LinearGenerator
>
(
this
->
_
a
reaData
);
registerGenerator
(
lg
->
name
(),
lg
);
registerGenerator
(
lg
->
name
(),
lg
);
auto
cg
=
std
::
make_shared
<
routing
::
CircularGenerator
>
(
this
->
_
pA
reaData
);
auto
cg
=
std
::
make_shared
<
routing
::
CircularGenerator
>
(
this
->
_
a
reaData
);
registerGenerator
(
cg
->
name
(),
cg
);
registerGenerator
(
cg
->
name
(),
cg
);
}
}
...
@@ -72,15 +72,15 @@ void CircularSurvey::reverse() {
...
@@ -72,15 +72,15 @@ void CircularSurvey::reverse() {
this
->
_rebuildTransects
();
this
->
_rebuildTransects
();
}
}
void
CircularSurvey
::
setPlanData
(
const
WimaPlan
Data
&
d
)
{
void
CircularSurvey
::
setPlanData
(
const
Area
Data
&
d
)
{
*
this
->
_
pA
reaData
=
d
;
*
this
->
_
a
reaData
=
d
;
}
}
const
WimaPlan
Data
&
CircularSurvey
::
planData
()
const
{
const
Area
Data
&
CircularSurvey
::
planData
()
const
{
return
*
this
->
_
pA
reaData
;
return
*
this
->
_
a
reaData
;
}
}
WimaPlanData
&
CircularSurvey
::
planData
()
{
return
*
this
->
_pA
reaData
;
}
AreaData
&
CircularSurvey
::
planData
()
{
return
*
this
->
_a
reaData
;
}
QStringList
CircularSurvey
::
variantNames
()
const
{
return
_variantNames
;
}
QStringList
CircularSurvey
::
variantNames
()
const
{
return
_variantNames
;
}
...
@@ -228,10 +228,10 @@ bool CircularSurvey::_updateWorker() {
...
@@ -228,10 +228,10 @@ bool CircularSurvey::_updateWorker() {
this
->
_variantNames
.
clear
();
this
->
_variantNames
.
clear
();
emit
variantNamesChanged
();
emit
variantNamesChanged
();
if
(
this
->
_
pA
reaData
->
isValid
())
{
if
(
this
->
_
a
reaData
->
isValid
())
{
// Prepare data.
// Prepare data.
auto
origin
=
this
->
_
pA
reaData
->
origin
();
auto
origin
=
this
->
_
a
reaData
->
origin
();
origin
.
setAltitude
(
0
);
origin
.
setAltitude
(
0
);
if
(
!
origin
.
isValid
())
{
if
(
!
origin
.
isValid
())
{
qCDebug
(
CircularSurveyLog
)
qCDebug
(
CircularSurveyLog
)
...
@@ -240,7 +240,7 @@ bool CircularSurvey::_updateWorker() {
...
@@ -240,7 +240,7 @@ bool CircularSurvey::_updateWorker() {
}
}
// Convert safe area.
// Convert safe area.
auto
geoSafeArea
=
this
->
_
pA
reaData
->
joinedArea
().
coordinateList
();
auto
geoSafeArea
=
this
->
_
a
reaData
->
joinedArea
().
coordinateList
();
if
(
!
(
geoSafeArea
.
size
()
>=
3
))
{
if
(
!
(
geoSafeArea
.
size
()
>=
3
))
{
qCDebug
(
CircularSurveyLog
)
qCDebug
(
CircularSurveyLog
)
<<
"_updateWorker(): safe area invalid."
<<
geoSafeArea
;
<<
"_updateWorker(): safe area invalid."
<<
geoSafeArea
;
...
@@ -512,7 +512,7 @@ void CircularSurvey::_recalcCameraShots() { _cameraShots = 0; }
...
@@ -512,7 +512,7 @@ void CircularSurvey::_recalcCameraShots() { _cameraShots = 0; }
void
CircularSurvey
::
_setTransects
(
CircularSurvey
::
PtrRoutingData
pRoute
)
{
void
CircularSurvey
::
_setTransects
(
CircularSurvey
::
PtrRoutingData
pRoute
)
{
// Store solutions.
// Store solutions.
auto
ori
=
this
->
_
pA
reaData
->
origin
();
auto
ori
=
this
->
_
a
reaData
->
origin
();
ori
.
setAltitude
(
0
);
ori
.
setAltitude
(
0
);
const
auto
&
transectsENU
=
pRoute
->
transects
;
const
auto
&
transectsENU
=
pRoute
->
transects
;
QVector
<
Variant
>
variantVector
;
QVector
<
Variant
>
variantVector
;
...
...
src/Wima/Snake/CircularGenerator.cpp
View file @
fd63568a
...
@@ -179,7 +179,7 @@ void CircularGenerator::resetReference() {
...
@@ -179,7 +179,7 @@ void CircularGenerator::resetReference() {
void
CircularGenerator
::
establishConnections
()
{
void
CircularGenerator
::
establishConnections
()
{
if
(
this
->
_d
&&
!
this
->
_connectionsEstablished
)
{
if
(
this
->
_d
&&
!
this
->
_connectionsEstablished
)
{
connect
(
this
->
_d
.
get
(),
&
WimaPlan
Data
::
originChanged
,
this
,
connect
(
this
->
_d
.
get
(),
&
Area
Data
::
originChanged
,
this
,
&
GeneratorBase
::
generatorChanged
);
&
GeneratorBase
::
generatorChanged
);
connect
(
&
this
->
_d
->
measurementArea
(),
connect
(
&
this
->
_d
->
measurementArea
(),
&
WimaMeasurementAreaData
::
progressChanged
,
this
,
&
WimaMeasurementAreaData
::
progressChanged
,
this
,
...
@@ -210,7 +210,7 @@ void CircularGenerator::establishConnections() {
...
@@ -210,7 +210,7 @@ void CircularGenerator::establishConnections() {
void
CircularGenerator
::
deleteConnections
()
{
void
CircularGenerator
::
deleteConnections
()
{
if
(
this
->
_d
&&
this
->
_connectionsEstablished
)
{
if
(
this
->
_d
&&
this
->
_connectionsEstablished
)
{
disconnect
(
this
->
_d
.
get
(),
&
WimaPlan
Data
::
originChanged
,
this
,
disconnect
(
this
->
_d
.
get
(),
&
Area
Data
::
originChanged
,
this
,
&
GeneratorBase
::
generatorChanged
);
&
GeneratorBase
::
generatorChanged
);
disconnect
(
&
this
->
_d
->
measurementArea
(),
disconnect
(
&
this
->
_d
->
measurementArea
(),
&
WimaMeasurementAreaData
::
progressChanged
,
this
,
&
WimaMeasurementAreaData
::
progressChanged
,
this
,
...
...
src/Wima/Snake/GeneratorBase.h
View file @
fd63568a
...
@@ -14,7 +14,7 @@ namespace routing {
...
@@ -14,7 +14,7 @@ namespace routing {
class
GeneratorBase
:
public
QObject
{
class
GeneratorBase
:
public
QObject
{
Q_OBJECT
Q_OBJECT
public:
public:
using
Data
=
std
::
shared_ptr
<
WimaPlan
Data
>
;
using
Data
=
std
::
shared_ptr
<
Area
Data
>
;
using
Generator
=
std
::
function
<
bool
(
snake
::
Transects
&
)
>
;
using
Generator
=
std
::
function
<
bool
(
snake
::
Transects
&
)
>
;
explicit
GeneratorBase
(
QObject
*
parent
=
nullptr
);
explicit
GeneratorBase
(
QObject
*
parent
=
nullptr
);
...
...
src/Wima/Snake/LinearGenerator.cpp
View file @
fd63568a
...
@@ -134,7 +134,7 @@ Fact *LinearGenerator::minLength() { return &_minLength; }
...
@@ -134,7 +134,7 @@ Fact *LinearGenerator::minLength() { return &_minLength; }
void
LinearGenerator
::
establishConnections
()
{
void
LinearGenerator
::
establishConnections
()
{
if
(
this
->
_d
&&
!
this
->
_connectionsEstablished
)
{
if
(
this
->
_d
&&
!
this
->
_connectionsEstablished
)
{
connect
(
this
->
_d
.
get
(),
&
WimaPlan
Data
::
originChanged
,
this
,
connect
(
this
->
_d
.
get
(),
&
Area
Data
::
originChanged
,
this
,
&
GeneratorBase
::
generatorChanged
);
&
GeneratorBase
::
generatorChanged
);
connect
(
&
this
->
_d
->
measurementArea
(),
connect
(
&
this
->
_d
->
measurementArea
(),
&
WimaMeasurementAreaData
::
progressChanged
,
this
,
&
WimaMeasurementAreaData
::
progressChanged
,
this
,
...
@@ -160,7 +160,7 @@ void LinearGenerator::establishConnections() {
...
@@ -160,7 +160,7 @@ void LinearGenerator::establishConnections() {
void
LinearGenerator
::
deleteConnections
()
{
void
LinearGenerator
::
deleteConnections
()
{
if
(
this
->
_d
&&
this
->
_connectionsEstablished
)
{
if
(
this
->
_d
&&
this
->
_connectionsEstablished
)
{
connect
(
this
->
_d
.
get
(),
&
WimaPlan
Data
::
originChanged
,
this
,
connect
(
this
->
_d
.
get
(),
&
Area
Data
::
originChanged
,
this
,
&
GeneratorBase
::
generatorChanged
);
&
GeneratorBase
::
generatorChanged
);
connect
(
&
this
->
_d
->
measurementArea
(),
connect
(
&
this
->
_d
->
measurementArea
(),
&
WimaMeasurementAreaData
::
progressChanged
,
this
,
&
WimaMeasurementAreaData
::
progressChanged
,
this
,
...
...
src/Wima/WimaBridge.h
View file @
fd63568a
...
@@ -21,17 +21,17 @@ class WimaBridge : public QObject {
...
@@ -21,17 +21,17 @@ class WimaBridge : public QObject {
public:
public:
~
WimaBridge
();
~
WimaBridge
();
static
WimaBridge
*
instance
();
static
WimaBridge
*
instance
();
const
WimaPlan
Data
&
planData
()
const
;
const
Area
Data
&
planData
()
const
;
const
QVector
<
int
>
&
progress
()
const
;
const
QVector
<
int
>
&
progress
()
const
;
public
slots
:
public
slots
:
void
setPlanData
(
const
WimaPlan
Data
&
planData
);
void
setPlanData
(
const
Area
Data
&
planData
);
void
setProgress
(
const
QVector
<
int
>
&
p
);
void
setProgress
(
const
QVector
<
int
>
&
p
);
signals:
signals:
void
planDataChanged
();
void
planDataChanged
();
void
progressChanged
();
void
progressChanged
();
private:
private:
WimaPlan
Data
planData_
;
Area
Data
planData_
;
QVector
<
int
>
progress_
;
QVector
<
int
>
progress_
;
};
};
src/Wima/WimaController.cc
deleted
100644 → 0
View file @
7e00907d
#include "WimaController.h"
#include "utilities.h"
#include "MissionController.h"
#include "MissionSettingsItem.h"
#include "PlanMasterController.h"
#include "QGCApplication.h"
#include "QGCLoggingCategory.h"
#include "SettingsManager.h"
#include "SimpleMissionItem.h"
#include "WimaBridge.h"
#include "WimaPlanData.h"
#include "WimaSettings.h"
#include "Snake/QNemoHeartbeat.h"
#include "Snake/QNemoProgress.h"
#include "Snake/SnakeTile.h"
#include "QVector3D"
#include <QScopedPointer>
#define CLIPPER_SCALE 1000000
#include "clipper/clipper.hpp"
#include <memory>
QGC_LOGGING_CATEGORY
(
WimaControllerLog
,
"WimaControllerLog"
)
template
<
typename
T
>
constexpr
typename
std
::
underlying_type
<
T
>::
type
integral
(
T
value
)
{
return
static_cast
<
typename
std
::
underlying_type
<
T
>::
type
>
(
value
);
}
#define EVENT_TIMER_INTERVAL 50 // ms
const
char
*
WimaController
::
areaItemsName
=
"AreaItems"
;
const
char
*
WimaController
::
settingsGroup
=
"WimaController"
;
const
char
*
WimaController
::
enableWimaControllerName
=
"EnableWimaController"
;
WimaController
::
WimaController
(
QObject
*
parent
)
:
QObject
(
parent
),
_joinedArea
(),
_measurementArea
(),
_serviceArea
(),
_corridor
(),
_planDataValid
(
false
),
_metaDataMap
(
FactMetaData
::
createMapFromJsonFile
(
QStringLiteral
(
":/json/WimaController.SettingsGroup.json"
),
this
)),
_enableWimaController
(
settingsGroup
,
_metaDataMap
[
enableWimaControllerName
]){
// PlanData and Progress.
connect
(
WimaBridge
::
instance
(),
&
WimaBridge
::
planDataChanged
,
this
,
&
WimaController
::
planDataChangedHandler
);
connect
(
WimaBridge
::
instance
(),
&
WimaBridge
::
progressChanged
,
this
,
&
WimaController
::
progressChangedHandler
);
}
PlanMasterController
*
WimaController
::
masterController
()
{
return
_masterController
;
}
MissionController
*
WimaController
::
missionController
()
{
return
_missionController
;
}
QmlObjectListModel
*
WimaController
::
visualItems
()
{
return
&
_areas
;
}
Fact
*
WimaController
::
enableWimaController
()
{
return
&
_enableWimaController
;
}
void
WimaController
::
setMasterController
(
PlanMasterController
*
masterC
)
{
_masterController
=
masterC
;
emit
masterControllerChanged
();
}
void
WimaController
::
setMissionController
(
MissionController
*
missionC
)
{
_missionController
=
missionC
;
emit
missionControllerChanged
();
}
void
WimaController
::
planDataChangedHandler
()
{
// reset visual items
_areas
.
clear
();
_measurementArea
=
WimaMeasurementAreaData
();
_serviceArea
=
WimaServiceAreaData
();
_corridor
=
WimaCorridorData
();
_joinedArea
=
WimaJoinedAreaData
();
_planDataValid
=
false
;
emit
visualItemsChanged
();
// Extract areas.
auto
planData
=
WimaBridge
::
instance
()
->
planData
();
// Measurement Area.
if
(
planData
.
measurementArea
().
coordinateList
().
size
()
>=
3
)
{
_measurementArea
=
planData
.
measurementArea
();
_areas
.
append
(
&
_measurementArea
);
// Service Area.
if
(
planData
.
serviceArea
().
coordinateList
().
size
()
>=
3
)
{
_serviceArea
=
planData
.
serviceArea
();
_areas
.
append
(
&
_serviceArea
);
// Joined Area.
if
(
planData
.
joinedArea
().
coordinateList
().
size
()
>=
3
)
{
_joinedArea
=
planData
.
joinedArea
();
_areas
.
append
(
&
_joinedArea
);
_planDataValid
=
true
;
// Corridor.
if
(
planData
.
corridor
().
coordinateList
().
size
()
>=
3
)
{
_corridor
=
planData
.
corridor
();
}
}
}
}
if
(
_planDataValid
)
{
emit
visualItemsChanged
();
}
else
{
_areas
.
clear
();
_measurementArea
=
WimaMeasurementAreaData
();
_serviceArea
=
WimaServiceAreaData
();
_corridor
=
WimaCorridorData
();
_joinedArea
=
WimaJoinedAreaData
();
}
}
void
WimaController
::
progressChangedHandler
()
{
_measurementArea
.
setProgress
(
WimaBridge
::
instance
()
->
progress
());
}
src/Wima/WimaController.h
deleted
100644 → 0
View file @
7e00907d
#
pragma
once
#include <QObject>
#include "QGCMapPolygon.h"
#include "QmlObjectListModel.h"
#include "Geometry/WimaCorridorData.h"
#include "Geometry/WimaJoinedAreaData.h"
#include "Geometry/WimaMeasurementAreaData.h"
#include "Geometry/WimaServiceAreaData.h"
#include "SettingsFact.h"
class
MissionController
;
class
PlanMasterController
;
class
WimaController
:
public
QObject
{
Q_OBJECT
public:
WimaController
(
QObject
*
parent
=
nullptr
);
// Controllers.
Q_PROPERTY
(
PlanMasterController
*
masterController
READ
masterController
WRITE
setMasterController
NOTIFY
masterControllerChanged
)
Q_PROPERTY
(
MissionController
*
missionController
READ
missionController
WRITE
setMissionController
NOTIFY
missionControllerChanged
)
// Wima Data.
Q_PROPERTY
(
QmlObjectListModel
*
visualItems
READ
visualItems
NOTIFY
visualItemsChanged
)
Q_PROPERTY
(
Fact
*
enableWimaController
READ
enableWimaController
CONSTANT
)
// Controllers.
PlanMasterController
*
masterController
(
void
);
MissionController
*
missionController
(
void
);
// Wima Data
QmlObjectListModel
*
visualItems
(
void
);
QGCMapPolygon
joinedArea
(
void
)
const
;
// Settings facts.
Fact
*
enableWimaController
(
void
);
// Property setters
void
setMasterController
(
PlanMasterController
*
masterController
);
void
setMissionController
(
MissionController
*
missionController
);
// static Members
static
const
char
*
areaItemsName
;
static
const
char
*
settingsGroup
;
static
const
char
*
enableWimaControllerName
;
signals:
// Controllers.
void
masterControllerChanged
(
void
);
void
missionControllerChanged
(
void
);
// Wima data.
void
visualItemsChanged
(
void
);
private
slots
:
void
planDataChangedHandler
();
void
progressChangedHandler
();
private:
// Controllers.
PlanMasterController
*
_masterController
;
MissionController
*
_missionController
;
// Wima Data.
QmlObjectListModel
_areas
;
// contains all visible areas
// joined area fromed by opArea, serArea, _corridor
WimaJoinedAreaData
_joinedArea
;
WimaMeasurementAreaData
_measurementArea
;
// measurement area
WimaServiceAreaData
_serviceArea
;
// area for supplying
WimaCorridorData
_corridor
;
// corridor connecting opArea and serArea
bool
_planDataValid
;
// Settings Facts.
QMap
<
QString
,
FactMetaData
*>
_metaDataMap
;
SettingsFact
_enableWimaController
;
// enables or disables the wimaControler
};
src/Wima/WimaPlanData.cc
View file @
fd63568a
#include "WimaPlanData.h"
#include "WimaPlanData.h"
WimaPlanData
::
WimaPlan
Data
(
QObject
*
parent
)
:
QObject
(
parent
)
{}
AreaData
::
Area
Data
(
QObject
*
parent
)
:
QObject
(
parent
)
{}
WimaPlanData
::
WimaPlanData
(
const
WimaPlan
Data
&
other
,
QObject
*
parent
)
AreaData
::
AreaData
(
const
Area
Data
&
other
,
QObject
*
parent
)
:
QObject
(
parent
)
{
:
QObject
(
parent
)
{
*
this
=
other
;
*
this
=
other
;
}
}
WimaPlanData
&
WimaPlanData
::
operator
=
(
const
WimaPlan
Data
&
other
)
{
AreaData
&
AreaData
::
operator
=
(
const
Area
Data
&
other
)
{
this
->
set
(
other
.
measurementArea
());
this
->
set
(
other
.
measurementArea
());
this
->
set
(
other
.
serviceArea
());
this
->
set
(
other
.
serviceArea
());
this
->
set
(
other
.
joinedArea
());
this
->
set
(
other
.
joinedArea
());
...
@@ -16,28 +16,28 @@ WimaPlanData &WimaPlanData::operator=(const WimaPlanData &other) {
...
@@ -16,28 +16,28 @@ WimaPlanData &WimaPlanData::operator=(const WimaPlanData &other) {
return
*
this
;
return
*
this
;
}
}
void
WimaPlan
Data
::
set
(
const
WimaJoinedAreaData
&
areaData
)
{
void
Area
Data
::
set
(
const
WimaJoinedAreaData
&
areaData
)
{
if
(
_joinedArea
!=
areaData
)
{
if
(
_joinedArea
!=
areaData
)
{
_joinedArea
=
areaData
;
_joinedArea
=
areaData
;
emit
joinedAreaChanged
();
emit
joinedAreaChanged
();
}
}
}
}
void
WimaPlan
Data
::
set
(
const
WimaServiceAreaData
&
areaData
)
{
void
Area
Data
::
set
(
const
WimaServiceAreaData
&
areaData
)
{
if
(
_serviceArea
!=
areaData
)
{
if
(
_serviceArea
!=
areaData
)
{
_serviceArea
=
areaData
;
_serviceArea
=
areaData
;
emit
serviceAreaChanged
();
emit
serviceAreaChanged
();
}
}
}
}
void
WimaPlan
Data
::
set
(
const
WimaCorridorData
&
areaData
)
{
void
Area
Data
::
set
(
const
WimaCorridorData
&
areaData
)
{
if
(
_corridor
!=
areaData
)
{
if
(
_corridor
!=
areaData
)
{
_corridor
=
areaData
;
_corridor
=
areaData
;
emit
corridorChanged
();
emit
corridorChanged
();
}
}
}
}
void
WimaPlan
Data
::
set
(
const
WimaMeasurementAreaData
&
areaData
)
{
void
Area
Data
::
set
(
const
WimaMeasurementAreaData
&
areaData
)
{
if
(
_measurementArea
!=
areaData
)
{
if
(
_measurementArea
!=
areaData
)
{
_measurementArea
=
areaData
;
_measurementArea
=
areaData
;
emit
measurementAreaChanged
();
emit
measurementAreaChanged
();
...
@@ -50,28 +50,28 @@ void WimaPlanData::set(const WimaMeasurementAreaData &areaData) {
...
@@ -50,28 +50,28 @@ void WimaPlanData::set(const WimaMeasurementAreaData &areaData) {
}
}
}
}
void
WimaPlan
Data
::
set
(
const
WimaJoinedArea
&
areaData
)
{
void
Area
Data
::
set
(
const
WimaJoinedArea
&
areaData
)
{
if
(
_joinedArea
!=
areaData
)
{
if
(
_joinedArea
!=
areaData
)
{
_joinedArea
=
areaData
;
_joinedArea
=
areaData
;
emit
joinedAreaChanged
();
emit
joinedAreaChanged
();
}
}
}
}
void
WimaPlan
Data
::
set
(
const
WimaServiceArea
&
areaData
)
{
void
Area
Data
::
set
(
const
WimaServiceArea
&
areaData
)
{
if
(
_serviceArea
!=
areaData
)
{
if
(
_serviceArea
!=
areaData
)
{
_serviceArea
=
areaData
;
_serviceArea
=
areaData
;
emit
serviceAreaChanged
();
emit
serviceAreaChanged
();
}
}
}
}
void
WimaPlan
Data
::
set
(
const
WimaCorridor
&
areaData
)
{
void
Area
Data
::
set
(
const
WimaCorridor
&
areaData
)
{
if
(
_corridor
!=
areaData
)
{
if
(
_corridor
!=
areaData
)
{
_corridor
=
areaData
;
_corridor
=
areaData
;
emit
corridorChanged
();
emit
corridorChanged
();
}
}
}
}
void
WimaPlan
Data
::
set
(
const
WimaMeasurementArea
&
areaData
)
{
void
Area
Data
::
set
(
const
WimaMeasurementArea
&
areaData
)
{
if
(
_measurementArea
!=
areaData
)
{
if
(
_measurementArea
!=
areaData
)
{
_measurementArea
=
areaData
;
_measurementArea
=
areaData
;
emit
measurementAreaChanged
();
emit
measurementAreaChanged
();
...
@@ -84,52 +84,52 @@ void WimaPlanData::set(const WimaMeasurementArea &areaData) {
...
@@ -84,52 +84,52 @@ void WimaPlanData::set(const WimaMeasurementArea &areaData) {
}
}
}
}
void
WimaPlanData
::
clear
()
{
*
this
=
WimaPlan
Data
();
}
void
AreaData
::
clear
()
{
*
this
=
Area
Data
();
}
QGeoCoordinate
WimaPlan
Data
::
origin
()
{
return
_origin
;
}
QGeoCoordinate
Area
Data
::
origin
()
{
return
_origin
;
}
bool
WimaPlan
Data
::
isValid
()
{
bool
Area
Data
::
isValid
()
{
return
_measurementArea
.
coordinateList
().
size
()
>=
3
&&
return
_measurementArea
.
coordinateList
().
size
()
>=
3
&&
_serviceArea
.
coordinateList
().
size
()
>=
3
&&
_origin
.
isValid
();
_serviceArea
.
coordinateList
().
size
()
>=
3
&&
_origin
.
isValid
();
}
}
const
WimaJoinedAreaData
&
WimaPlan
Data
::
joinedArea
()
const
{
const
WimaJoinedAreaData
&
Area
Data
::
joinedArea
()
const
{
return
this
->
_joinedArea
;
return
this
->
_joinedArea
;
}
}
const
WimaServiceAreaData
&
WimaPlan
Data
::
serviceArea
()
const
{
const
WimaServiceAreaData
&
Area
Data
::
serviceArea
()
const
{
return
this
->
_serviceArea
;
return
this
->
_serviceArea
;
}
}
const
WimaCorridorData
&
WimaPlan
Data
::
corridor
()
const
{
const
WimaCorridorData
&
Area
Data
::
corridor
()
const
{
return
this
->
_corridor
;
return
this
->
_corridor
;
}
}
const
WimaMeasurementAreaData
&
WimaPlan
Data
::
measurementArea
()
const
{
const
WimaMeasurementAreaData
&
Area
Data
::
measurementArea
()
const
{
return
this
->
_measurementArea
;
return
this
->
_measurementArea
;
}
}
WimaJoinedAreaData
&
WimaPlan
Data
::
joinedArea
()
{
return
this
->
_joinedArea
;
}
WimaJoinedAreaData
&
Area
Data
::
joinedArea
()
{
return
this
->
_joinedArea
;
}
WimaServiceAreaData
&
WimaPlan
Data
::
serviceArea
()
{
return
this
->
_serviceArea
;
}
WimaServiceAreaData
&
Area
Data
::
serviceArea
()
{
return
this
->
_serviceArea
;
}
WimaCorridorData
&
WimaPlan
Data
::
corridor
()
{
return
this
->
_corridor
;
}
WimaCorridorData
&
Area
Data
::
corridor
()
{
return
this
->
_corridor
;
}
WimaMeasurementAreaData
&
WimaPlan
Data
::
measurementArea
()
{
WimaMeasurementAreaData
&
Area
Data
::
measurementArea
()
{
return
this
->
_measurementArea
;
return
this
->
_measurementArea
;
}
}
bool
WimaPlanData
::
operator
==
(
const
WimaPlan
Data
&
other
)
const
{
bool
AreaData
::
operator
==
(
const
Area
Data
&
other
)
const
{
return
this
->
_joinedArea
==
other
.
_joinedArea
&&
return
this
->
_joinedArea
==
other
.
_joinedArea
&&
this
->
_measurementArea
==
other
.
_measurementArea
&&
this
->
_measurementArea
==
other
.
_measurementArea
&&
this
->
_corridor
==
other
.
_corridor
&&
this
->
_corridor
==
other
.
_corridor
&&
this
->
_serviceArea
==
other
.
_serviceArea
;
this
->
_serviceArea
==
other
.
_serviceArea
;
}
}
bool
WimaPlanData
::
operator
!=
(
const
WimaPlan
Data
&
other
)
const
{
bool
AreaData
::
operator
!=
(
const
Area
Data
&
other
)
const
{
return
!
(
*
this
==
other
);
return
!
(
*
this
==
other
);
}
}
void
WimaPlan
Data
::
setOrigin
(
const
QGeoCoordinate
&
origin
)
{
void
Area
Data
::
setOrigin
(
const
QGeoCoordinate
&
origin
)
{
if
(
this
->
_origin
!=
origin
)
{
if
(
this
->
_origin
!=
origin
)
{
this
->
_origin
=
origin
;
this
->
_origin
=
origin
;
emit
originChanged
();
emit
originChanged
();
...
...
src/Wima/WimaPlaner.cc
View file @
fd63568a
...
@@ -783,7 +783,7 @@ void WimaPlaner::updatePolygonInteractivity(int index) {
...
@@ -783,7 +783,7 @@ void WimaPlaner::updatePolygonInteractivity(int index) {
void
WimaPlaner
::
synchronize
()
{
void
WimaPlaner
::
synchronize
()
{
if
(
readyForSynchronization
())
{
if
(
readyForSynchronization
())
{
WimaPlan
Data
planData
;
Area
Data
planData
;
if
(
toPlanData
(
planData
))
{
if
(
toPlanData
(
planData
))
{
WimaBridge
::
instance
()
->
setPlanData
(
planData
);
WimaBridge
::
instance
()
->
setPlanData
(
planData
);
setSynchronized
(
true
);
setSynchronized
(
true
);
...
@@ -926,11 +926,11 @@ void WimaPlaner::setInteractive() {
...
@@ -926,11 +926,11 @@ void WimaPlaner::setInteractive() {
*
*
* \sa WimaController, WimaPlanData
* \sa WimaController, WimaPlanData
*/
*/
bool
WimaPlaner
::
toPlanData
(
WimaPlan
Data
&
planData
)
{
bool
WimaPlaner
::
toPlanData
(
Area
Data
&
planData
)
{
planData
.
set
(
_measurementArea
);
planData
.
append
(
_measurementArea
);
planData
.
set
(
_serviceArea
);
planData
.
append
(
_serviceArea
);
planData
.
set
(
_corridor
);
planData
.
append
(
_corridor
);
planData
.
set
(
_joinedArea
);
planData
.
append
(
_joinedArea
);
return
planData
.
isValid
();
return
planData
.
isValid
();
}
}
...
...
src/Wima/WimaPlaner.h
View file @
fd63568a
...
@@ -153,7 +153,7 @@ signals:
...
@@ -153,7 +153,7 @@ signals:
private:
private:
// Member Functions
// Member Functions
bool
toPlanData
(
WimaPlan
Data
&
planData
);
bool
toPlanData
(
Area
Data
&
planData
);
bool
shortestPath
(
const
QGeoCoordinate
&
start
,
bool
shortestPath
(
const
QGeoCoordinate
&
start
,
const
QGeoCoordinate
&
destination
,
const
QGeoCoordinate
&
destination
,
QVector
<
QGeoCoordinate
>
&
path
);
QVector
<
QGeoCoordinate
>
&
path
);
...
...
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