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