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
fb9b1767
Commit
fb9b1767
authored
Jan 20, 2021
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plan creator added, area editor improved
parent
42fe8ce4
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
893 additions
and
776 deletions
+893
-776
qgcimages.qrc
qgcimages.qrc
+1
-0
qgroundcontrol.pro
qgroundcontrol.pro
+2
-0
MeasurementPlanCreator.cpp
src/MeasurementComplexItem/MeasurementPlanCreator.cpp
+21
-0
MeasurementPlanCreator.h
src/MeasurementComplexItem/MeasurementPlanCreator.h
+16
-0
MeasurementPlanCreator.png
src/MeasurementComplexItem/MeasurementPlanCreator.png
+0
-0
NemoInterface.cpp
src/MeasurementComplexItem/NemoInterface.cpp
+53
-28
AreaDataEditor.qml
src/MeasurementComplexItem/qml/AreaDataEditor.qml
+175
-162
MeasurementItemEditor.qml
src/MeasurementComplexItem/qml/MeasurementItemEditor.qml
+5
-37
PlanMasterController.cc
src/MissionManager/PlanMasterController.cc
+620
-549
No files found.
qgcimages.qrc
View file @
fb9b1767
...
...
@@ -195,5 +195,6 @@
<file alias="Yield.svg">src/ui/toolbar/Images/Yield.svg</file>
<file alias="ZoomMinus.svg">src/FlightMap/Images/ZoomMinus.svg</file>
<file alias="ZoomPlus.svg">src/FlightMap/Images/ZoomPlus.svg</file>
<file alias="PlanCreator/MeasurementPlanCreator.png">src/MeasurementComplexItem/MeasurementPlanCreator.png</file>
</qresource>
</RCC>
qgroundcontrol.pro
View file @
fb9b1767
...
...
@@ -447,6 +447,7 @@ contains (DEFINES, QGC_ENABLE_PAIRING) {
HEADERS
+=
\
src
/
MeasurementComplexItem
/
IDArray
.
h
\
src
/
MeasurementComplexItem
/
LogicalArray
.
h
\
src
/
MeasurementComplexItem
/
MeasurementPlanCreator
.
h
\
src
/
MeasurementComplexItem
/
TileArray
.
h
\
src
/
MeasurementComplexItem
/
TilePtrArray
.
h
\
src
/
MeasurementComplexItem
/
geometry
/
ProgressArray
.
h
\
...
...
@@ -527,6 +528,7 @@ contains (DEFINES, QGC_ENABLE_PAIRING) {
}
SOURCES
+=
\
src
/
MeasurementComplexItem
/
MeasurementPlanCreator
.
cpp
\
src
/
MeasurementComplexItem
/
geometry
/
GeoArea
.
cc
\
src
/
MeasurementComplexItem
/
geometry
/
MeasurementArea
.
cc
\
src
/
MeasurementComplexItem
/
geometry
/
SafeArea
.
cc
\
...
...
src/MeasurementComplexItem/MeasurementPlanCreator.cpp
0 → 100644
View file @
fb9b1767
#include "MeasurementPlanCreator.h"
#include "MeasurementComplexItem.h"
#include "PlanMasterController.h"
MeasurementPlanCreator
::
MeasurementPlanCreator
(
PlanMasterController
*
planMasterController
,
QObject
*
parent
)
:
PlanCreator
(
planMasterController
,
MeasurementComplexItem
::
name
,
QStringLiteral
(
"/qmlimages/PlanCreator/MeasurementPlanCreator.png"
),
parent
)
{}
void
MeasurementPlanCreator
::
createPlan
(
const
QGeoCoordinate
&
mapCenterCoord
)
{
_planMasterController
->
removeAll
();
VisualMissionItem
*
takeoffItem
=
_missionController
->
insertTakeoffItem
(
mapCenterCoord
,
-
1
);
_missionController
->
insertComplexMissionItem
(
MeasurementComplexItem
::
name
,
mapCenterCoord
,
-
1
);
_missionController
->
insertLandItem
(
mapCenterCoord
,
-
1
);
_missionController
->
setCurrentPlanViewSeqNum
(
takeoffItem
->
sequenceNumber
(),
true
);
}
src/MeasurementComplexItem/MeasurementPlanCreator.h
0 → 100644
View file @
fb9b1767
#ifndef MEASUREMENTCOMPLEXITEMPLANCREATOR_H
#define MEASUREMENTCOMPLEXITEMPLANCREATOR_H
#include "PlanCreator.h"
class
MeasurementPlanCreator
:
public
PlanCreator
{
Q_OBJECT
public:
MeasurementPlanCreator
(
PlanMasterController
*
planMasterController
,
QObject
*
parent
=
nullptr
);
Q_INVOKABLE
void
createPlan
(
const
QGeoCoordinate
&
mapCenterCoord
)
final
;
};
#endif // MEASUREMENTCOMPLEXITEMPLANCREATOR_H
src/MeasurementComplexItem/MeasurementPlanCreator.png
0 → 100644
View file @
fb9b1767
250 KB
src/MeasurementComplexItem/NemoInterface.cpp
View file @
fb9b1767
...
...
@@ -251,7 +251,7 @@ std::shared_future<QVariant>
NemoInterface
::
Impl
::
addTiles
(
const
TilePtrArray
&
tileArray
)
{
using
namespace
nemo_interface
;
qDebug
()
<<
"addTiles called"
;
//
qDebug() << "addTiles called";
if
(
tileArray
.
size
()
>
0
)
{
...
...
@@ -318,7 +318,7 @@ std::shared_future<QVariant>
NemoInterface
::
Impl
::
removeTiles
(
const
IDArray
&
idArray
)
{
using
namespace
nemo_interface
;
qDebug
()
<<
"removeTiles called"
;
//
qDebug() << "removeTiles called";
if
(
idArray
.
size
()
>
0
)
{
...
...
@@ -364,7 +364,7 @@ NemoInterface::Impl::removeTiles(const IDArray &idArray) {
std
::
shared_future
<
QVariant
>
NemoInterface
::
Impl
::
clearTiles
()
{
using
namespace
nemo_interface
;
qDebug
()
<<
"clearTiles called"
;
//
qDebug() << "clearTiles called";
// clear local tiles (_localTiles)
if
(
!
_localTiles
.
empty
())
{
...
...
@@ -396,14 +396,27 @@ std::shared_future<QVariant> NemoInterface::Impl::clearTiles() {
TileArray
NemoInterface
::
Impl
::
getTiles
(
const
IDArray
&
idArray
)
const
{
TileArray
tileArray
;
for
(
const
auto
&
id
:
idArray
)
{
const
auto
it
=
_localTiles
.
find
(
id
);
if
(
it
!=
_localTiles
.
end
())
{
MeasurementTile
copy
;
copy
.
setId
(
it
->
second
->
id
());
copy
.
setProgress
(
it
->
second
->
progress
());
copy
.
setPath
(
it
->
second
->
tile
());
tileArray
.
append
(
std
::
move
(
copy
));
if
(
this
->
ready
())
{
for
(
const
auto
&
id
:
idArray
)
{
const
auto
it
=
_remoteTiles
.
find
(
id
);
if
(
it
!=
_remoteTiles
.
end
())
{
MeasurementTile
copy
;
copy
.
setId
(
it
->
second
->
id
());
copy
.
setProgress
(
it
->
second
->
progress
());
copy
.
setPath
(
it
->
second
->
tile
());
tileArray
.
append
(
std
::
move
(
copy
));
}
}
}
else
{
for
(
const
auto
&
id
:
idArray
)
{
const
auto
it
=
_localTiles
.
find
(
id
);
if
(
it
!=
_localTiles
.
end
())
{
MeasurementTile
copy
;
copy
.
setId
(
it
->
second
->
id
());
copy
.
setProgress
(
it
->
second
->
progress
());
copy
.
setPath
(
it
->
second
->
tile
());
tileArray
.
append
(
std
::
move
(
copy
));
}
}
}
...
...
@@ -413,13 +426,25 @@ TileArray NemoInterface::Impl::getTiles(const IDArray &idArray) const {
TileArray
NemoInterface
::
Impl
::
getAllTiles
()
const
{
TileArray
tileArray
;
for
(
const
auto
&
entry
:
_localTiles
)
{
auto
pTile
=
entry
.
second
;
MeasurementTile
copy
;
copy
.
setId
(
pTile
->
id
());
copy
.
setProgress
(
pTile
->
progress
());
copy
.
setPath
(
pTile
->
tile
());
tileArray
.
append
(
std
::
move
(
copy
));
if
(
this
->
ready
())
{
for
(
const
auto
&
entry
:
_remoteTiles
)
{
auto
pTile
=
entry
.
second
;
MeasurementTile
copy
;
copy
.
setId
(
pTile
->
id
());
copy
.
setProgress
(
pTile
->
progress
());
copy
.
setPath
(
pTile
->
tile
());
tileArray
.
append
(
std
::
move
(
copy
));
}
}
else
{
for
(
const
auto
&
entry
:
_localTiles
)
{
auto
pTile
=
entry
.
second
;
MeasurementTile
copy
;
copy
.
setId
(
pTile
->
id
());
copy
.
setProgress
(
pTile
->
progress
());
copy
.
setPath
(
pTile
->
tile
());
tileArray
.
append
(
std
::
move
(
copy
));
}
}
return
tileArray
;
...
...
@@ -518,7 +543,7 @@ const QString &NemoInterface::Impl::warningString() const {
void
NemoInterface
::
Impl
::
_updateProgress
(
std
::
shared_ptr
<
ProgressArray
>
pArray
,
std
::
promise
<
bool
>
promise
)
{
qDebug
()
<<
"_updateProgress called"
;
//
qDebug() << "_updateProgress called";
bool
error
=
false
;
for
(
auto
itLP
=
pArray
->
begin
();
itLP
!=
pArray
->
end
();)
{
...
...
@@ -799,7 +824,7 @@ void NemoInterface::Impl::_doAction() {
QVariant
NemoInterface
::
Impl
::
_callAddTiles
(
std
::
shared_ptr
<
QVector
<
std
::
shared_ptr
<
const
Tile
>>>
pTileArray
)
{
qDebug
()
<<
"_callAddTiles called"
;
//
qDebug() << "_callAddTiles called";
this
->
_lastCall
=
CALL_NAME
::
ADD_TILES
;
...
...
@@ -900,7 +925,7 @@ QVariant NemoInterface::Impl::_callAddTiles(
QVariant
NemoInterface
::
Impl
::
_callRemoveTiles
(
std
::
shared_ptr
<
IDArray
>
pIdArray
)
{
qDebug
()
<<
"_callRemoveTiles called"
;
//
qDebug() << "_callRemoveTiles called";
this
->
_lastCall
=
CALL_NAME
::
REMOVE_TILES
;
...
...
@@ -995,7 +1020,7 @@ NemoInterface::Impl::_callRemoveTiles(std::shared_ptr<IDArray> pIdArray) {
QVariant
NemoInterface
::
Impl
::
_callClearTiles
()
{
qDebug
()
<<
"_callClearTiles called"
;
//
qDebug() << "_callClearTiles called";
this
->
_lastCall
=
CALL_NAME
::
CLEAR_TILES
;
// create response handler.
...
...
@@ -1068,7 +1093,7 @@ QVariant NemoInterface::Impl::_callClearTiles() {
QVariant
NemoInterface
::
Impl
::
_callGetProgress
(
std
::
shared_ptr
<
IDArray
>
pIdArray
)
{
qDebug
()
<<
"_callGetProgress called"
;
//
qDebug() << "_callGetProgress called";
this
->
_lastCall
=
CALL_NAME
::
GET_PROGRESS
;
...
...
@@ -1168,7 +1193,7 @@ NemoInterface::Impl::_callGetProgress(std::shared_ptr<IDArray> pIdArray) {
}
QVariant
NemoInterface
::
Impl
::
_callGetAllProgress
()
{
qDebug
()
<<
"_callGetAllProgress called"
;
//
qDebug() << "_callGetAllProgress called";
this
->
_lastCall
=
CALL_NAME
::
GET_ALL_PROGRESS
;
...
...
@@ -1279,7 +1304,7 @@ void NemoInterface::Impl::_addTilesRemote(
std
::
shared_ptr
<
QVector
<
std
::
shared_ptr
<
const
Tile
>>>
pTileArray
,
std
::
promise
<
bool
>
promise
)
{
qDebug
()
<<
"_addTilesRemote called"
;
//
qDebug() << "_addTilesRemote called";
auto
pArrayDup
=
std
::
make_shared
<
QVector
<
std
::
shared_ptr
<
Tile
>>>
();
for
(
auto
pTile
:
*
pTileArray
)
{
...
...
@@ -1292,7 +1317,7 @@ void NemoInterface::Impl::_addTilesRemote2(
std
::
shared_ptr
<
QVector
<
std
::
shared_ptr
<
Tile
>>>
pTileArray
,
std
::
promise
<
bool
>
promise
)
{
qDebug
()
<<
"_addTilesRemote2 called"
;
//
qDebug() << "_addTilesRemote2 called";
bool
anyChange
=
false
;
bool
error
=
false
;
...
...
@@ -1326,7 +1351,7 @@ void NemoInterface::Impl::_addTilesRemote2(
void
NemoInterface
::
Impl
::
_removeTilesRemote
(
std
::
shared_ptr
<
IDArray
>
idArray
,
std
::
promise
<
bool
>
promise
)
{
qDebug
()
<<
"_removeTilesRemote called"
;
//
qDebug() << "_removeTilesRemote called";
bool
anyChange
=
false
;
for
(
const
auto
id
:
*
idArray
)
{
...
...
@@ -1351,7 +1376,7 @@ void NemoInterface::Impl::_removeTilesRemote(std::shared_ptr<IDArray> idArray,
}
void
NemoInterface
::
Impl
::
_clearTilesRemote
(
std
::
promise
<
bool
>
promise
)
{
qDebug
()
<<
"_clearTilesRemote called"
;
//
qDebug() << "_clearTilesRemote called";
if
(
_remoteTiles
.
size
()
>
0
)
{
_remoteTiles
.
clear
();
if
(
this
->
_isSynchronized
())
{
...
...
src/MeasurementComplexItem/qml/AreaDataEditor.qml
View file @
fb9b1767
This diff is collapsed.
Click to expand it.
src/MeasurementComplexItem/qml/MeasurementItemEditor.qml
View file @
fb9b1767
...
...
@@ -49,13 +49,12 @@ Rectangle {
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
enabled
:
!
editing
||
editing
&&
correct
enabled
:
!
editing
readonly
property
int
areaEditorIndex
:
0
readonly
property
int
parameterEditorIndex
:
1
readonly
property
int
nemoEditorIndex
:
2
property
bool
editing
:
_missionItem
.
editing
property
bool
correct
:
false
Component.onCompleted
:
currentIndex
=
editing
?
areaEditorIndex
:
parameterEditorIndex
...
...
@@ -71,47 +70,18 @@ Rectangle {
icon.source
:
"
qrc:/res/fish.svg
"
icon.height
:
ScreenTools
.
defaultFontPixelHeight
}
onEditingChanged
:
{
if
(
editing
)
{
areasCorrectTimer
.
start
()
}
else
{
areasCorrectTimer
.
stop
()
}
}
onCurrentIndexChanged
:
{
if
(
currentIndex
===
areaEditorIndex
)
{
_missionItem
.
startEditing
()
}
else
{
_missionItem
.
stopEditing
()
}
}
Timer
{
id
:
areasCorrectTimer
running
:
false
interval
:
100
repeat
:
true
onTriggered
:
{
tabBar
.
correct
=
_missionItem
.
areaData
.
isCorrect
(
false
/*show gui message*/
)
}
}
}
MCI.AreaDataEditor
{
id
:
areaEditor
visible
:
tabBar
.
currentIndex
===
tabBar
.
areaEditorIndex
checked
:
visible
missionItem
:
_root
.
_missionItem
availableWidth
:
mainColumn
.
width
onAbort
:
{
missionItem
.
abortEditing
()
tabBar
.
currentIndex
=
tabBar
.
parameterEditorIndex
onVisibleChanged
:{
if
(
visible
){
_missionItem
.
startEditing
()
}
}
}
...
...
@@ -119,7 +89,6 @@ Rectangle {
id
:
parameterEditor
visible
:
tabBar
.
currentIndex
===
tabBar
.
parameterEditorIndex
checked
:
visible
missionItem
:
_root
.
_missionItem
availableWidth
:
mainColumn
.
width
}
...
...
@@ -128,7 +97,6 @@ Rectangle {
id
:
nemoEditor
visible
:
tabBar
.
currentIndex
===
tabBar
.
nemoEditorIndex
checked
:
visible
missionItem
:
_root
.
_missionItem
availableWidth
:
mainColumn
.
width
}
...
...
src/MissionManager/PlanMasterController.cc
View file @
fb9b1767
This diff is collapsed.
Click to expand it.
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