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
56781a94
Commit
56781a94
authored
Feb 06, 2020
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
WimaController reset to user QmlObjectListModel
parent
ff537957
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
28 deletions
+26
-28
WimaController.cc
src/Wima/WimaController.cc
+11
-13
WimaController.h
src/Wima/WimaController.h
+15
-15
No files found.
src/Wima/WimaController.cc
View file @
56781a94
...
...
@@ -65,7 +65,7 @@ WimaController::WimaController(QObject *parent)
enableDisableLowBatteryHandling
(
enableLowBatteryHandling
->
rawValue
());
}
QmlObject
Vector
Model
*
WimaController
::
visualItems
()
QmlObject
List
Model
*
WimaController
::
visualItems
()
{
return
&
_visualItems
;
}
...
...
@@ -92,12 +92,12 @@ WimaDataContainer *WimaController::dataContainer()
return
_container
;
}
QmlObject
Vector
Model
*
WimaController
::
missionItems
()
QmlObject
List
Model
*
WimaController
::
missionItems
()
{
return
&
_missionItems
;
}
QmlObject
Vector
Model
*
WimaController
::
currentMissionItems
()
QmlObject
List
Model
*
WimaController
::
currentMissionItems
()
{
return
&
_currentMissionItems
;
}
...
...
@@ -394,12 +394,12 @@ bool WimaController::calcShortestPath(const QGeoCoordinate &start, const QGeoCoo
return
retVal
;
}
bool
WimaController
::
extractCoordinateList
(
QmlObject
Vector
Model
&
missionItems
,
QVector
<
QGeoCoordinate
>
&
coordinateList
)
bool
WimaController
::
extractCoordinateList
(
QmlObject
List
Model
&
missionItems
,
QVector
<
QGeoCoordinate
>
&
coordinateList
)
{
return
extractCoordinateList
(
missionItems
,
coordinateList
,
0
,
missionItems
.
count
()
-
1
);
}
bool
WimaController
::
extractCoordinateList
(
QmlObject
Vector
Model
&
missionItems
,
QVector
<
QGeoCoordinate
>
&
coordinateList
,
int
startIndex
,
int
endIndex
)
bool
WimaController
::
extractCoordinateList
(
QmlObject
List
Model
&
missionItems
,
QVector
<
QGeoCoordinate
>
&
coordinateList
,
int
startIndex
,
int
endIndex
)
{
if
(
startIndex
>=
0
&&
startIndex
<
missionItems
.
count
()
...
...
@@ -427,12 +427,12 @@ bool WimaController::extractCoordinateList(QmlObjectVectorModel &missionItems, Q
return
true
;
}
bool
WimaController
::
extractCoordinateList
(
QmlObject
Vector
Model
&
missionItems
,
QVariantList
&
coordinateList
)
bool
WimaController
::
extractCoordinateList
(
QmlObject
List
Model
&
missionItems
,
QVariantList
&
coordinateList
)
{
return
extractCoordinateList
(
missionItems
,
coordinateList
,
0
,
missionItems
.
count
()
-
1
);
}
bool
WimaController
::
extractCoordinateList
(
QmlObject
Vector
Model
&
missionItems
,
QVariantList
&
coordinateList
,
int
startIndex
,
int
endIndex
)
bool
WimaController
::
extractCoordinateList
(
QmlObject
List
Model
&
missionItems
,
QVariantList
&
coordinateList
,
int
startIndex
,
int
endIndex
)
{
QVector
<
QGeoCoordinate
>
geoCoordintateList
;
...
...
@@ -567,10 +567,9 @@ bool WimaController::fetchContainerData()
_nextPhaseStartWaypointIndex
.
setRawValue
(
reverse
?
_missionItems
.
count
()
:
int
(
1
));
connect
(
&
_nextPhaseStartWaypointIndex
,
&
Fact
::
rawValueChanged
,
this
,
&
WimaController
::
calcNextPhase
);
/*
if
(
!
calcNextPhase
())
return
false
;
*/
emit
visualItemsChanged
();
...
...
@@ -804,10 +803,9 @@ bool WimaController::calcNextPhase()
updateCurrentPath
();
emit
currentMissionItemsChanged
();
qWarning
()
<<
"WimaController::calcNextPhase()"
<<
std
::
chrono
::
duration_cast
<
std
::
chrono
::
milliseconds
>
(
std
::
chrono
::
high_resolution_clock
::
now
()
-
start
).
count
()
<<
" ms"
;
qWarning
()
<<
"WimaController::calcNextPhase() exec time: "
<<
std
::
chrono
::
duration_cast
<
std
::
chrono
::
microseconds
>
(
std
::
chrono
::
high_resolution_clock
::
now
()
-
start
).
count
()
<<
" us"
;
return
true
;
}
...
...
src/Wima/WimaController.h
View file @
56781a94
...
...
@@ -2,7 +2,7 @@
#include <QObject>
#include "QGCMapPolygon.h"
#include "QmlObject
Vector
Model.h"
#include "QmlObject
List
Model.h"
#include "WimaArea.h"
#include "WimaMeasurementArea.h"
...
...
@@ -37,14 +37,14 @@ public:
Q_PROPERTY
(
PlanMasterController
*
masterController
READ
masterController
WRITE
setMasterController
NOTIFY
masterControllerChanged
)
Q_PROPERTY
(
MissionController
*
missionController
READ
missionController
WRITE
setMissionController
NOTIFY
missionControllerChanged
)
Q_PROPERTY
(
QmlObject
VectorModel
*
visualItems
READ
visualItems
NOTIFY
visualItemsChanged
)
Q_PROPERTY
(
QmlObject
ListModel
*
visualItems
READ
visualItems
NOTIFY
visualItemsChanged
)
Q_PROPERTY
(
QString
currentFile
READ
currentFile
NOTIFY
currentFileChanged
)
Q_PROPERTY
(
QStringList
loadNameFilters
READ
loadNameFilters
CONSTANT
)
Q_PROPERTY
(
QStringList
saveNameFilters
READ
saveNameFilters
CONSTANT
)
Q_PROPERTY
(
QString
fileExtension
READ
fileExtension
CONSTANT
)
Q_PROPERTY
(
WimaDataContainer
*
dataContainer
READ
dataContainer
WRITE
setDataContainer
NOTIFY
dataContainerChanged
)
Q_PROPERTY
(
QmlObject
VectorModel
*
missionItems
READ
missionItems
NOTIFY
missionItemsChanged
)
Q_PROPERTY
(
QmlObject
VectorModel
*
currentMissionItems
READ
currentMissionItems
NOTIFY
currentMissionItemsChanged
)
Q_PROPERTY
(
QmlObject
ListModel
*
missionItems
READ
missionItems
NOTIFY
missionItemsChanged
)
Q_PROPERTY
(
QmlObject
ListModel
*
currentMissionItems
READ
currentMissionItems
NOTIFY
currentMissionItemsChanged
)
Q_PROPERTY
(
QVariantList
waypointPath
READ
waypointPath
NOTIFY
waypointPathChanged
)
Q_PROPERTY
(
QVariantList
currentWaypointPath
READ
currentWaypointPath
NOTIFY
currentWaypointPathChanged
)
Q_PROPERTY
(
Fact
*
enableWimaController
READ
enableWimaController
CONSTANT
)
...
...
@@ -67,15 +67,15 @@ public:
// Property accessors
PlanMasterController
*
masterController
(
void
)
{
return
_masterController
;
}
MissionController
*
missionController
(
void
)
{
return
_missionController
;
}
QmlObject
VectorModel
*
visualItems
(
void
);
QmlObject
ListModel
*
visualItems
(
void
);
QString
currentFile
(
void
)
const
{
return
_currentFile
;
}
QStringList
loadNameFilters
(
void
)
const
;
QStringList
saveNameFilters
(
void
)
const
;
QString
fileExtension
(
void
)
const
{
return
wimaFileExtension
;
}
QGCMapPolygon
joinedArea
(
void
)
const
;
WimaDataContainer
*
dataContainer
(
void
);
QmlObject
VectorModel
*
missionItems
(
void
);
QmlObject
VectorModel
*
currentMissionItems
(
void
);
QmlObject
ListModel
*
missionItems
(
void
);
QmlObject
ListModel
*
currentMissionItems
(
void
);
QVariantList
waypointPath
(
void
);
QVariantList
currentWaypointPath
(
void
);
Fact
*
enableWimaController
(
void
);
...
...
@@ -141,13 +141,13 @@ public:
bool
calcShortestPath
(
const
QGeoCoordinate
&
start
,
const
QGeoCoordinate
&
destination
,
QVector
<
QGeoCoordinate
>
&
path
);
/// extracts the coordinates stored in missionItems (list of MissionItems) and stores them in coordinateList
bool
extractCoordinateList
(
QmlObject
Vector
Model
&
missionItems
,
QVector
<
QGeoCoordinate
>
&
coordinateList
);
bool
extractCoordinateList
(
QmlObject
List
Model
&
missionItems
,
QVector
<
QGeoCoordinate
>
&
coordinateList
);
/// extracts the coordinates (between startIndex and endIndex) stored in missionItems (list of MissionItems) and stores them in coordinateList.
bool
extractCoordinateList
(
QmlObject
Vector
Model
&
missionItems
,
QVector
<
QGeoCoordinate
>
&
coordinateList
,
int
startIndex
,
int
endIndex
);
bool
extractCoordinateList
(
QmlObject
List
Model
&
missionItems
,
QVector
<
QGeoCoordinate
>
&
coordinateList
,
int
startIndex
,
int
endIndex
);
/// extracts the coordinates stored in missionItems (list of MissionItems) and stores them in coordinateList
bool
extractCoordinateList
(
QmlObject
Vector
Model
&
missionItems
,
QVariantList
&
coordinateList
);
bool
extractCoordinateList
(
QmlObject
List
Model
&
missionItems
,
QVariantList
&
coordinateList
);
/// extracts the coordinates (between startIndex and endIndex) stored in missionItems (list of MissionItems) and stores them in coordinateList.
bool
extractCoordinateList
(
QmlObject
Vector
Model
&
missionItems
,
QVariantList
&
coordinateList
,
int
startIndex
,
int
endIndex
);
bool
extractCoordinateList
(
QmlObject
List
Model
&
missionItems
,
QVariantList
&
coordinateList
,
int
startIndex
,
int
endIndex
);
signals:
void
masterControllerChanged
(
void
);
...
...
@@ -198,16 +198,16 @@ private:
MissionController
*
_missionController
;
QString
_currentFile
;
// file for saveing
WimaDataContainer
*
_container
;
// container for data exchange with WimaController
QmlObject
VectorModel
_visualItems
;
// contains all visible areas
QmlObject
ListModel
_visualItems
;
// contains all visible areas
WimaJoinedAreaData
_joinedArea
;
// joined area fromed by opArea, serArea, _corridor
WimaMeasurementAreaData
_measurementArea
;
// measurement area
WimaServiceAreaData
_serviceArea
;
// area for supplying
WimaCorridorData
_corridor
;
// corridor connecting opArea and serArea
bool
_localPlanDataValid
;
QmlObject
VectorModel
_missionItems
;
// all mission itmes (Mission Items) generaded by wimaPlaner, displayed in flightView
QmlObject
VectorModel
_currentMissionItems
;
// contains the current mission items, which are a sub set of _missionItems,
QmlObject
ListModel
_missionItems
;
// all mission itmes (Mission Items) generaded by wimaPlaner, displayed in flightView
QmlObject
ListModel
_currentMissionItems
;
// contains the current mission items, which are a sub set of _missionItems,
// _currentMissionItems contains a number of mission items which can be worked off with a single battery chrage
QmlObject
Vector
Model
_missionItemsBuffer
;
// Buffer to store mission items, e.g. for storing _currentMissionItems when smartRTL() is invoked
QmlObject
List
Model
_missionItemsBuffer
;
// Buffer to store mission items, e.g. for storing _currentMissionItems when smartRTL() is invoked
QVariantList
_waypointPath
;
// path connecting the items in _missionItems
QVariantList
_currentWaypointPath
;
// path connecting the items in _currentMissionItems
QGeoCoordinate
_takeoffLandPostion
;
...
...
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