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
5a5b161e
Commit
5a5b161e
authored
Nov 24, 2020
by
Valentin Platzgummer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
123
parent
be40a955
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
161 additions
and
94 deletions
+161
-94
qgroundcontrol.qrc
qgroundcontrol.qrc
+5
-5
AreaData.h
src/MeasurementComplexItem/AreaData.h
+2
-0
MeasurementArea.cc
src/MeasurementComplexItem/geometry/MeasurementArea.cc
+3
-3
MeasurementArea.h
src/MeasurementComplexItem/geometry/MeasurementArea.h
+1
-1
CircularGeneratorMapVisual.qml
...MeasurementComplexItem/qml/CircularGeneratorMapVisual.qml
+0
-2
DragCoordinate.qml
src/MeasurementComplexItem/qml/DragCoordinate.qml
+0
-1
GeoAreaVisualLoader.qml
src/MeasurementComplexItem/qml/GeoAreaVisualLoader.qml
+11
-9
MeasurementAreaMapVisual.qml
src/MeasurementComplexItem/qml/MeasurementAreaMapVisual.qml
+17
-13
MeasurementItemEditor.qml
src/MeasurementComplexItem/qml/MeasurementItemEditor.qml
+35
-2
MeasurementItemMapVisual.qml
src/MeasurementComplexItem/qml/MeasurementItemMapVisual.qml
+8
-10
SafeAreaMapVisual.qml
src/MeasurementComplexItem/qml/SafeAreaMapVisual.qml
+75
-46
TakeoffItemMapVisual.qml
src/PlanView/TakeoffItemMapVisual.qml
+1
-2
qmldir
src/QmlControls/QGroundControl/Controls/qmldir
+3
-0
No files found.
qgroundcontrol.qrc
View file @
5a5b161e
...
@@ -265,16 +265,16 @@
...
@@ -265,16 +265,16 @@
<file alias="QGroundControl/Controls/CircularGeneratorMapVisual.qml">src/MeasurementComplexItem/qml/CircularGeneratorMapVisual.qml</file>
<file alias="QGroundControl/Controls/CircularGeneratorMapVisual.qml">src/MeasurementComplexItem/qml/CircularGeneratorMapVisual.qml</file>
<file alias="MeasurementItemEditor.qml">src/MeasurementComplexItem/qml/MeasurementItemEditor.qml</file>
<file alias="MeasurementItemEditor.qml">src/MeasurementComplexItem/qml/MeasurementItemEditor.qml</file>
<file alias="QGroundControl/Controls/MeasurementItemMapVisual.qml">src/MeasurementComplexItem/qml/MeasurementItemMapVisual.qml</file>
<file alias="QGroundControl/Controls/MeasurementItemMapVisual.qml">src/MeasurementComplexItem/qml/MeasurementItemMapVisual.qml</file>
<file alias="CoordinateIndicator.qml">src/MeasurementComplexItem/qml/CoordinateIndicator.qml</file>
<file alias="
QGroundControl/Controls/
CoordinateIndicator.qml">src/MeasurementComplexItem/qml/CoordinateIndicator.qml</file>
<file alias="CoordinateIndicatorDrag.qml">src/MeasurementComplexItem/qml/CoordinateIndicatorDrag.qml</file>
<file alias="
QGroundControl/Controls/
CoordinateIndicatorDrag.qml">src/MeasurementComplexItem/qml/CoordinateIndicatorDrag.qml</file>
<file alias="DragCoordinate.qml">src/MeasurementComplexItem/qml/DragCoordinate.qml</file>
<file alias="
QGroundControl/Controls/
DragCoordinate.qml">src/MeasurementComplexItem/qml/DragCoordinate.qml</file>
<file alias="LinearGeneratorEditor.qml">src/MeasurementComplexItem/qml/LinearGeneratorEditor.qml</file>
<file alias="LinearGeneratorEditor.qml">src/MeasurementComplexItem/qml/LinearGeneratorEditor.qml</file>
<file alias="ProgressIndicator.qml">src/MeasurementComplexItem/qml/ProgressIndicator.qml</file>
<file alias="ProgressIndicator.qml">src/MeasurementComplexItem/qml/ProgressIndicator.qml</file>
<file alias="QGroundControl/Controls/GeoAreaVisualLoader.qml">src/MeasurementComplexItem/qml/GeoAreaVisualLoader.qml</file>
<file alias="QGroundControl/Controls/GeoAreaVisualLoader.qml">src/MeasurementComplexItem/qml/GeoAreaVisualLoader.qml</file>
<file alias="MeasurementAreaEditor.qml">src/MeasurementComplexItem/qml/MeasurementAreaEditor.qml</file>
<file alias="MeasurementAreaEditor.qml">src/MeasurementComplexItem/qml/MeasurementAreaEditor.qml</file>
<file alias="MeasurementAreaMapVisual.qml">src/MeasurementComplexItem/qml/MeasurementAreaMapVisual.qml</file>
<file alias="
QGroundControl/Controls/
MeasurementAreaMapVisual.qml">src/MeasurementComplexItem/qml/MeasurementAreaMapVisual.qml</file>
<file alias="SafeAreaEditor.qml">src/MeasurementComplexItem/qml/SafeAreaEditor.qml</file>
<file alias="SafeAreaEditor.qml">src/MeasurementComplexItem/qml/SafeAreaEditor.qml</file>
<file alias="SafeAreaMapVisual.qml">src/MeasurementComplexItem/qml/SafeAreaMapVisual.qml</file>
<file alias="
QGroundControl/Controls/
SafeAreaMapVisual.qml">src/MeasurementComplexItem/qml/SafeAreaMapVisual.qml</file>
<file alias="SetupParameterEditor.qml">src/VehicleSetup/SetupParameterEditor.qml</file>
<file alias="SetupParameterEditor.qml">src/VehicleSetup/SetupParameterEditor.qml</file>
<file alias="SetupView.qml">src/VehicleSetup/SetupView.qml</file>
<file alias="SetupView.qml">src/VehicleSetup/SetupView.qml</file>
<file alias="SimpleItemEditor.qml">src/PlanView/SimpleItemEditor.qml</file>
<file alias="SimpleItemEditor.qml">src/PlanView/SimpleItemEditor.qml</file>
...
...
src/MeasurementComplexItem/AreaData.h
View file @
5a5b161e
...
@@ -17,6 +17,8 @@ public:
...
@@ -17,6 +17,8 @@ public:
AreaData
(
const
AreaData
&
other
,
QObject
*
parent
=
nullptr
);
AreaData
(
const
AreaData
&
other
,
QObject
*
parent
=
nullptr
);
AreaData
&
operator
=
(
const
AreaData
&
other
);
AreaData
&
operator
=
(
const
AreaData
&
other
);
Q_PROPERTY
(
QmlObjectListModel
*
areaList
READ
areaList
NOTIFY
areaListChanged
)
// Member Methodes
// Member Methodes
//!
//!
//! \brief insert Inserts the area if areaList does not contain it.
//! \brief insert Inserts the area if areaList does not contain it.
...
...
src/MeasurementComplexItem/geometry/MeasurementArea.cc
View file @
5a5b161e
...
@@ -68,7 +68,7 @@ const char *MeasurementArea::tileHeightName = "TileHeight";
...
@@ -68,7 +68,7 @@ const char *MeasurementArea::tileHeightName = "TileHeight";
const
char
*
MeasurementArea
::
tileWidthName
=
"TileWidth"
;
const
char
*
MeasurementArea
::
tileWidthName
=
"TileWidth"
;
const
char
*
MeasurementArea
::
minTileAreaName
=
"MinTileAreaPercent"
;
const
char
*
MeasurementArea
::
minTileAreaName
=
"MinTileAreaPercent"
;
const
char
*
MeasurementArea
::
showTilesName
=
"ShowTiles"
;
const
char
*
MeasurementArea
::
showTilesName
=
"ShowTiles"
;
const
char
*
MeasurementArea
::
M
easurementAreaName
=
"Measurement Area"
;
const
char
*
MeasurementArea
::
m
easurementAreaName
=
"Measurement Area"
;
MeasurementArea
::
MeasurementArea
(
QObject
*
parent
)
MeasurementArea
::
MeasurementArea
(
QObject
*
parent
)
:
GeoArea
(
parent
),
:
GeoArea
(
parent
),
...
@@ -162,7 +162,7 @@ void MeasurementArea::saveToJson(QJsonObject &json) {
...
@@ -162,7 +162,7 @@ void MeasurementArea::saveToJson(QJsonObject &json) {
json
[
tileWidthName
]
=
_tileWidth
.
rawValue
().
toDouble
();
json
[
tileWidthName
]
=
_tileWidth
.
rawValue
().
toDouble
();
json
[
minTileAreaName
]
=
_minTileAreaPercent
.
rawValue
().
toDouble
();
json
[
minTileAreaName
]
=
_minTileAreaPercent
.
rawValue
().
toDouble
();
json
[
showTilesName
]
=
_showTiles
.
rawValue
().
toBool
();
json
[
showTilesName
]
=
_showTiles
.
rawValue
().
toBool
();
json
[
areaTypeName
]
=
M
easurementAreaName
;
json
[
areaTypeName
]
=
m
easurementAreaName
;
}
else
{
}
else
{
qCDebug
(
MeasurementAreaLog
)
<<
"saveToJson(): not ready for saveing."
;
qCDebug
(
MeasurementAreaLog
)
<<
"saveToJson(): not ready for saveing."
;
}
}
...
@@ -359,7 +359,7 @@ void MeasurementArea::enableUpdate() {
...
@@ -359,7 +359,7 @@ void MeasurementArea::enableUpdate() {
}
}
void
MeasurementArea
::
init
()
{
void
MeasurementArea
::
init
()
{
this
->
setObjectName
(
M
easurementAreaName
);
this
->
setObjectName
(
m
easurementAreaName
);
connect
(
&
this
->
_tileHeight
,
&
Fact
::
rawValueChanged
,
this
,
connect
(
&
this
->
_tileHeight
,
&
Fact
::
rawValueChanged
,
this
,
&
MeasurementArea
::
deferUpdate
);
&
MeasurementArea
::
deferUpdate
);
connect
(
&
this
->
_tileWidth
,
&
Fact
::
rawValueChanged
,
this
,
connect
(
&
this
->
_tileWidth
,
&
Fact
::
rawValueChanged
,
this
,
...
...
src/MeasurementComplexItem/geometry/MeasurementArea.h
View file @
5a5b161e
...
@@ -71,7 +71,7 @@ public:
...
@@ -71,7 +71,7 @@ public:
static
const
char
*
tileWidthName
;
static
const
char
*
tileWidthName
;
static
const
char
*
minTileAreaName
;
static
const
char
*
minTileAreaName
;
static
const
char
*
showTilesName
;
static
const
char
*
showTilesName
;
static
const
char
*
M
easurementAreaName
;
static
const
char
*
m
easurementAreaName
;
signals:
signals:
void
tilesChanged
();
void
tilesChanged
();
...
...
src/MeasurementComplexItem/qml/CircularGeneratorMapVisual.qml
View file @
5a5b161e
...
@@ -8,7 +8,6 @@ Item {
...
@@ -8,7 +8,6 @@ Item {
// Expects the following properties:
// Expects the following properties:
property
var
map
///< Map control to place item in
property
var
map
///< Map control to place item in
property
var
qgcView
///< QGCView to use for popping dialogs
property
var
generator
property
var
generator
property
bool
checked
:
false
property
bool
checked
:
false
...
@@ -59,7 +58,6 @@ Item {
...
@@ -59,7 +58,6 @@ Item {
property
var
ref
:
_root
.
generator
.
reference
property
var
ref
:
_root
.
generator
.
reference
map
:
_root
.
map
map
:
_root
.
map
qgcView
:
_root
.
qgcView
z
:
QGroundControl
.
zOrderMapItems
z
:
QGroundControl
.
zOrderMapItems
checked
:
_root
.
checked
checked
:
_root
.
checked
coordinate
:
ref
coordinate
:
ref
...
...
src/MeasurementComplexItem/qml/DragCoordinate.qml
View file @
5a5b161e
...
@@ -23,7 +23,6 @@ Item {
...
@@ -23,7 +23,6 @@ Item {
id
:
_root
id
:
_root
property
var
map
///< Map control to place item in
property
var
map
///< Map control to place item in
property
var
qgcView
///< QGCView to use for popping dialogs
property
var
coordinate
property
var
coordinate
property
int
sequenceNumber
property
int
sequenceNumber
property
bool
checked
property
bool
checked
...
...
src/MeasurementComplexItem/qml/GeoAreaVisualLoader.qml
View file @
5a5b161e
...
@@ -21,22 +21,24 @@ import QGroundControl 1.0
...
@@ -21,22 +21,24 @@ import QGroundControl 1.0
Item
{
Item
{
id
:
_root
id
:
_root
property
var
map
///< Map control to place item in
property
var
map
:
undefined
///< Map control to place item in
property
var
qgcView
///< QGCView to use for popping dialogs
property
var
geoArea
:
undefined
///< GeoArea derived class
property
var
geoArea
///< GeoArea derived class
signal
clicked
(
int
sequenceNumber
)
signal
clicked
(
int
sequenceNumber
)
property
var
_visualItem
property
var
_visualItem
:
undefined
Component.onCompleted
:
{
Component.onCompleted
:
{
if
(
geoArea
.
mapVisualQML
)
{
console
.
assert
(
map
!==
undefined
,
"
please set the map property
"
)
var
component
=
Qt
.
createComponent
(
geoArea
.
mapVisualQML
)
console
.
assert
(
geoArea
!==
undefined
,
"
please set the geoArea property
"
)
if
(
_root
.
geoArea
.
mapVisualQML
&&
!
_visualItem
)
{
var
component
=
Qt
.
createComponent
(
_root
.
geoArea
.
mapVisualQML
)
if
(
component
.
status
===
Component
.
Error
)
{
if
(
component
.
status
===
Component
.
Error
)
{
console
.
log
(
"
Error loading Qml:
"
,
geoArea
.
mapVisualQML
,
component
.
errorString
())
console
.
log
(
"
Error loading Qml:
"
,
_root
.
geoArea
.
mapVisualQML
,
component
.
errorString
())
}
}
_
visualItem
=
component
.
createObject
(
map
,
{
"
map
"
:
_root
.
map
,
"
qgcView
"
:
_root
.
qgcView
,
"
geoArea
"
:
_root
.
geoArea
})
_
root
.
_visualItem
=
component
.
createObject
(
_root
.
map
,
{
map
:
_root
.
map
,
geoArea
:
_root
.
geoArea
})
_visualItem
.
clicked
.
connect
(
_root
.
clicked
)
_
root
.
_
visualItem
.
clicked
.
connect
(
_root
.
clicked
)
}
}
}
}
...
...
src/MeasurementComplexItem/qml/MeasurementAreaMapVisual.qml
View file @
5a5b161e
...
@@ -21,23 +21,27 @@ import QGroundControl.FlightMap 1.0
...
@@ -21,23 +21,27 @@ import QGroundControl.FlightMap 1.0
Item
{
Item
{
id
:
_root
id
:
_root
property
var
map
///< Map control to place item in
property
var
map
:
undefined
///< Map control to place item in
property
var
qgcView
///< QGCView to use for popping dialogs
property
var
geoArea
:
undefined
///< GeoArea derived class
property
var
areaItem
///< GeoArea derived class
property
var
opacity
:
0.5
opacity
:
0.3
signal
clicked
(
int
sequenceNumber
)
signal
clicked
(
int
sequenceNumber
)
Component.onCompleted
:
{
console
.
assert
(
map
!==
undefined
,
"
please set the map property
"
)
console
.
assert
(
geoArea
!==
undefined
,
"
please set the geoArea property
"
)
}
// Area polygon
// Area polygon
QGCMapPolygonVisuals
{
QGCMapPolygonVisuals
{
id
:
mapPolygonVisuals
id
:
mapPolygonVisuals
mapControl
:
map
mapPolygon
:
areaItem
mapControl
:
_root
.
map
interactive
:
true
mapPolygon
:
_root
.
geoArea
borderWidth
:
1
interactive
:
geoArea
.
interactive
borderColor
:
"
black
"
borderWidth
:
3
borderColor
:
"
green
"
interiorColor
:
"
green
"
interiorColor
:
"
green
"
altColor
:
QGroundControl
.
globalPalette
.
surveyPolygonTerrainCollision
altColor
:
QGroundControl
.
globalPalette
.
surveyPolygonTerrainCollision
interiorOpacity
:
_root
.
opacity
interiorOpacity
:
_root
.
opacity
...
@@ -82,13 +86,13 @@ Item {
...
@@ -82,13 +86,13 @@ Item {
Repeater
{
Repeater
{
id
:
progressRepeater
id
:
progressRepeater
property
bool
enable
:
areaItem
.
showTiles
.
value
property
bool
enable
:
geoArea
.
showTiles
.
value
model
:
enable
?
areaItem
.
tiles
:
[]
model
:
enable
?
geoArea
.
tiles
:
[]
Item
{
Item
{
property
var
_tileComponent
property
var
_tileComponent
property
int
_progress
:
_root
.
areaItem
.
progress
[
index
]
?
property
int
_progress
:
_root
.
geoArea
.
progress
[
index
]
?
_root
.
areaItem
.
progress
[
index
]
:
0
_root
.
geoArea
.
progress
[
index
]
:
0
Component.onCompleted
:
{
Component.onCompleted
:
{
_tileComponent
=
tileComponent
.
createObject
(
map
)
_tileComponent
=
tileComponent
.
createObject
(
map
)
...
...
src/MeasurementComplexItem/qml/MeasurementItemEditor.qml
View file @
5a5b161e
...
@@ -159,6 +159,36 @@ Rectangle {
...
@@ -159,6 +159,36 @@ Rectangle {
}
}
}
// variant repeater
}
// variant repeater
}
// variant grid
}
// variant grid
ExclusiveGroup
{
id
:
areaGroup
}
Repeater
{
id
:
areaReapeater
model
:
_missionItem
.
areaData
.
areaList
delegate
:
QGCRadioButton
{
text
:
object
.
objectName
Layout.columnSpan
:
2
onCheckedChanged
:
{
updateInteractive
()
}
Component.onCompleted
:
{
if
(
index
===
0
){
checked
=
true
}
}
function
updateInteractive
(){
if
(
checked
){
object
.
interactive
=
true
}
else
{
object
.
interactive
=
false
}
}
}
}
// area Repeater
}
// general grid
}
// general grid
// Generator Editor
// Generator Editor
...
@@ -187,7 +217,9 @@ Rectangle {
...
@@ -187,7 +217,9 @@ Rectangle {
model
:
missionItem
.
generatorNameList
model
:
missionItem
.
generatorNameList
onActivated
:
{
onActivated
:
{
missionItem
.
switchToGenerator
(
index
)
if
(
index
!=
-
1
){
missionItem
.
switchToGenerator
(
index
)
}
}
}
}
}
}
}
...
@@ -207,8 +239,9 @@ Rectangle {
...
@@ -207,8 +239,9 @@ Rectangle {
BusyIndicator
{
BusyIndicator
{
id
:
indicator
id
:
indicator
anchors.horizontalCenter
:
parent
.
horizontalCenter
property
bool
calculating
:
missionItem
.
calculating
property
bool
calculating
:
missionItem
.
calculating
running
:
calculating
running
:
calculating
visible
:
calculating
||
timer
.
running
visible
:
calculating
||
timer
.
running
...
...
src/MeasurementComplexItem/qml/MeasurementItemMapVisual.qml
View file @
5a5b161e
...
@@ -22,11 +22,9 @@ import QGroundControl.FlightMap 1.0
...
@@ -22,11 +22,9 @@ import QGroundControl.FlightMap 1.0
Item
{
Item
{
id
:
_root
id
:
_root
property
var
map
///< Map control to place item in
property
var
map
:
undefined
///< Map control to place item in
property
var
qgcView
///< QGCView to use for popping dialogs
property
var
_missionItem
:
object
property
var
_missionItem
:
object
property
var
_areaData
:
_missionItem
.
areaData
property
bool
_editing
:
_missionItem
.
editing
property
bool
_editing
:
_missionItem
.
editing
property
var
_generator
:
_missionItem
.
generator
property
var
_generator
:
_missionItem
.
generator
...
@@ -52,7 +50,8 @@ Item {
...
@@ -52,7 +50,8 @@ Item {
_addTransectsComponent
()
_addTransectsComponent
()
_addGeneratorVisuals
()
_addGeneratorVisuals
()
var
bbox
=
boundingBox
()
var
bbox
=
boundingBox
()
_areaData
.
initialize
(
bbox
[
0
],
bbox
[
1
])
_missionItem
.
areaData
.
initialize
(
bbox
[
0
],
bbox
[
1
])
console
.
assert
(
map
!=
undefined
,
"
please set the map property
"
)
}
}
Component.onDestruction
:
{
Component.onDestruction
:
{
...
@@ -72,10 +71,10 @@ Item {
...
@@ -72,10 +71,10 @@ Item {
id
:
visualTransectsComponent
id
:
visualTransectsComponent
MapPolyline
{
MapPolyline
{
property
var
transects
:
_missionItem
.
route
property
var
route
:
_missionItem
.
route
line.color
:
"
white
"
line.color
:
"
white
"
line.width
:
2
line.width
:
2
path
:
transects
.
length
>
0
?
transects
:
[]
path
:
route
.
length
>
0
?
route
:
[]
}
}
}
}
...
@@ -120,12 +119,12 @@ Item {
...
@@ -120,12 +119,12 @@ Item {
}
}
// GeoAreas
Repeater
{
Repeater
{
model
:
_areaData
.
areaList
model
:
_
missionItem
.
areaData
.
areaList
delegate
:
GeoAreaVisualLoader
{
delegate
:
GeoAreaVisualLoader
{
map
:
_root
.
map
map
:
_root
.
map
qgcView
:
_root
.
qgcView
geoArea
:
object
geoArea
:
_areaData
.
areaList
[
index
]
}
}
}
}
...
@@ -140,7 +139,6 @@ Item {
...
@@ -140,7 +139,6 @@ Item {
_generatorVisuals
=
_generatorVisuals
=
component
.
createObject
(
_root
,
{
component
.
createObject
(
_root
,
{
"
map
"
:
_root
.
map
,
"
map
"
:
_root
.
map
,
"
qgcView
"
:
_root
.
qgcView
,
"
generator
"
:
_root
.
_generator
,
"
generator
"
:
_root
.
_generator
,
"
checked
"
:
Qt
.
binding
(
"
checked
"
:
Qt
.
binding
(
function
(){
function
(){
...
...
src/MeasurementComplexItem/qml/SafeAreaMapVisual.qml
View file @
5a5b161e
...
@@ -21,42 +21,48 @@ import QGroundControl.FlightMap 1.0
...
@@ -21,42 +21,48 @@ import QGroundControl.FlightMap 1.0
Item
{
Item
{
id
:
_root
id
:
_root
property
var
map
///< Map control to place item in
property
var
map
:
undefined
///< Map control to place item in
property
var
qgcView
///< QGCView to use for popping dialogs
property
var
geoArea
:
undefined
///< GeoArea derived class.
property
var
areaItem
///< GeoArea derived class.
property
var
_polygon
:
areaItem
property
var
_depotVisual
:
undefined
property
var
_depot
:
undefined
property
var
_depotDrag
:
undefined
property
bool
_showDepot
:
areaItem
.
interactive
||
areaItem
.
borderPolygon
.
interactive
property
bool
_showDepot
:
geoArea
.
interactive
opacity
:
0.3
signal
clicked
(
int
sequenceNumber
)
signal
clicked
(
int
sequenceNumber
)
on_ShowDepotChanged
:
{
on_ShowDepotChanged
:
{
if
(
_showDepot
){
if
(
_showDepot
){
_addDepot
()
_addDepotVisual
()
_addDepotDrag
()
}
else
{
}
else
{
_destroyDepot
()
_destroyDepotVisual
()
_destroyDepotDrag
()
}
}
}
}
Component.onCompleted
:
{
Component.onCompleted
:
{
if
(
_showDepot
){
if
(
_showDepot
){
_addDepot
()
_addDepotVisual
()
_addDepotDrag
()
}
}
console
.
assert
(
map
!==
undefined
,
"
please set the map property
"
)
console
.
assert
(
geoArea
!==
undefined
,
"
please set the geoArea property
"
)
}
}
Component.onDestruction
:
{
Component.onDestruction
:
{
_destroyDepot
()
_destroyDepot
Visual
()
}
}
// Area polygon
// Area polygon
QGCMapPolygonVisuals
{
QGCMapPolygonVisuals
{
id
:
mapPolygonVisuals
id
:
mapPolygonVisuals
mapControl
:
map
mapControl
:
map
mapPolygon
:
areaItem
mapPolygon
:
geoArea
interactive
:
tru
e
interactive
:
geoArea
.
interactiv
e
borderWidth
:
1
borderWidth
:
2
borderColor
:
"
bl
ack
"
borderColor
:
"
bl
ue
"
interiorColor
:
"
blue
"
interiorColor
:
"
blue
"
altColor
:
QGroundControl
.
globalPalette
.
surveyPolygonTerrainCollision
altColor
:
QGroundControl
.
globalPalette
.
surveyPolygonTerrainCollision
interiorOpacity
:
_root
.
opacity
interiorOpacity
:
_root
.
opacity
...
@@ -65,49 +71,72 @@ Item {
...
@@ -65,49 +71,72 @@ Item {
// Depot Point.
// Depot Point.
Component
{
Component
{
id
:
depotPointComponent
id
:
depotPointComponent
DragCoordinate
{
property
var
depot
:
_root
.
areaItem
.
depot
MapQuickItem
{
coordinate
:
_root
.
geoArea
.
depot
map
:
_root
.
map
anchorPoint.x
:
sourceItem
.
anchorPointX
qgcView
:
_root
.
qgcView
anchorPoint.y
:
sourceItem
.
anchorPointY
z
:
QGroundControl
.
zOrderMapItems
visible
:
true
checked
:
_root
.
_showDepot
coordinate
:
_root
.
areaItem
.
depot
sourceItem
:
label
:
"
Depot
"
MissionItemIndexLabel
{
checked
:
geoArea
.
interactive
function
syncAndBind
(){
label
:
qsTr
(
"
Launch
"
)
if
(
coordinate
.
latitude
!==
depot
.
latitude
||
highlightSelected
:
true
coordinate
.
longitude
!==
depot
.
longitude
){
onClicked
:
_root
.
clicked
(
0
)
if
(
_root
.
areaItem
.
containsCoordinate
(
coordinate
)){
visible
:
true
_root
.
areaItem
.
depot
=
coordinate
}
}
}
coordinate
=
Qt
.
binding
(
function
(){
return
_root
.
areaItem
.
depot
})
}
}
}
onDragReleased
:
{
Component
{
syncAndBind
()
id
:
depotDragComponent
}
MissionItemIndicatorDrag
{
mapControl
:
_root
.
map
itemIndicator
:
_depot
itemCoordinate
:
geoArea
.
depot
visible
:
geoArea
.
interactive
Component.onCompleted
:
{
property
var
depot
:
geoArea
.
depot
syncAndBind
()
onItemCoordinateChanged
:
{
if
(
itemCoordinate
.
latitude
!==
depot
.
latitude
||
itemCoordinate
.
longitude
!==
depot
.
longitude
){
if
(
_root
.
areaItem
.
containsCoordinate
(
itemCoordinate
)){
_root
.
areaItem
.
depot
=
itemCoordinate
}
}
itemCoordinate
=
Qt
.
binding
(
function
(){
return
_root
.
geoArea
.
depot
})
}
}
}
}
function
_addDepotVisual
()
{
if
(
!
_depotVisual
){
_depotVisual
=
depotPointComponent
.
createObject
(
_root
)
map
.
addMapItem
(
_depotVisual
)
}
}
function
_destroyDepotVisual
()
{
if
(
_depotVisual
){
map
.
removeMapItem
(
_depotVisual
)
_depotVisual
.
destroy
()
_depotVisual
=
undefined
}
}
}
}
function
_addDepot
()
{
function
_addDepotDrag
()
{
if
(
!
_depot
){
if
(
!
_depotDrag
){
_depot
=
depotPointComponent
.
createObject
(
_root
)
_depotDrag
=
depotDragComponent
.
createObject
(
_root
)
map
.
addMapItem
(
_depot
)
}
}
}
}
function
_destroyDepot
()
{
function
_destroyDepotDrag
()
{
if
(
_depot
){
if
(
_depotDrag
){
map
.
removeMapItem
(
_depot
)
_depotDrag
.
destroy
()
_depot
.
destroy
()
_depotDrag
=
undefined
_depot
=
undefined
}
}
}
}
}
}
src/PlanView/TakeoffItemMapVisual.qml
View file @
5a5b161e
...
@@ -117,8 +117,7 @@ Item {
...
@@ -117,8 +117,7 @@ Item {
}
}
}
}
Component
{
Component
{
id
:
launchIndicatorComponent
id
:
launchIndicatorComponent
MapQuickItem
{
MapQuickItem
{
coordinate
:
_missionItem
.
launchCoordinate
coordinate
:
_missionItem
.
launchCoordinate
...
...
src/QmlControls/QGroundControl/Controls/qmldir
View file @
5a5b161e
...
@@ -113,3 +113,6 @@ MAVLinkChart 1.0 MAVLinkChart.qml
...
@@ -113,3 +113,6 @@ MAVLinkChart 1.0 MAVLinkChart.qml
MeasurementItemMapVisual 1.0 MeasurementItemMapVisual.qml
MeasurementItemMapVisual 1.0 MeasurementItemMapVisual.qml
CircularGeneratorMapVisual 1.0 CircularGeneratorMapVisual.qml
CircularGeneratorMapVisual 1.0 CircularGeneratorMapVisual.qml
GeoAreaVisualLoader 1.0 GeoAreaVisualLoader.qml
GeoAreaVisualLoader 1.0 GeoAreaVisualLoader.qml
DragCoordinate 1.0 DragCoordinate.qml
CoordinateIndicator 1.0 CoordinateIndicator.qml
CoordinateIndicatorDrag 1.0 CoordinateIndicatorDrag.qml
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