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
980d4aa4
Unverified
Commit
980d4aa4
authored
Sep 04, 2019
by
Don Gagne
Committed by
GitHub
Sep 04, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7764 from DonLakeFlyer/ObjectManager
New QGCDynamicObjectManager support
parents
42e2e8c7
f27fbb7c
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
64 additions
and
37 deletions
+64
-37
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-0
FWLandingPatternMapVisual.qml
src/PlanView/FWLandingPatternMapVisual.qml
+9
-20
StructureScanMapVisual.qml
src/PlanView/StructureScanMapVisual.qml
+6
-8
TransectStyleMapVisuals.qml
src/PlanView/TransectStyleMapVisuals.qml
+6
-9
QGCDynamicObjectManager.qml
src/QmlControls/QGCDynamicObjectManager.qml
+41
-0
qmldir
src/QmlControls/QGroundControl/Controls/qmldir
+1
-0
No files found.
qgroundcontrol.qrc
View file @
980d4aa4
...
...
@@ -104,6 +104,7 @@
<file alias="QGroundControl/Controls/QGCCheckBox.qml">src/QmlControls/QGCCheckBox.qml</file>
<file alias="QGroundControl/Controls/QGCColoredImage.qml">src/QmlControls/QGCColoredImage.qml</file>
<file alias="QGroundControl/Controls/QGCComboBox.qml">src/QmlControls/QGCComboBox.qml</file>
<file alias="QGroundControl/Controls/QGCDynamicObjectManager.qml">src/QmlControls/QGCDynamicObjectManager.qml</file>
<file alias="QGroundControl/Controls/QGCFileDialog.qml">src/QmlControls/QGCFileDialog.qml</file>
<file alias="QGroundControl/Controls/QGCFlickable.qml">src/QmlControls/QGCFlickable.qml</file>
<file alias="QGroundControl/Controls/QGCFlickableHorizontalIndicator.qml">src/QmlControls/QGCFlickableHorizontalIndicator.qml</file>
...
...
src/PlanView/FWLandingPatternMapVisual.qml
View file @
980d4aa4
...
...
@@ -30,7 +30,6 @@ Item {
readonly
property
real
_landingLengthMeters
:
100
property
var
_missionItem
:
object
property
var
_itemVisuals
:
[
]
property
var
_mouseArea
property
var
_dragAreas
:
[
]
property
var
_flightPath
...
...
@@ -39,30 +38,16 @@ Item {
property
var
_landingPointObject
function
hideItemVisuals
()
{
for
(
var
i
=
0
;
i
<
_itemVisuals
.
length
;
i
++
)
{
_itemVisuals
[
i
].
destroy
()
}
_itemVisuals
=
[
]
objMgr
.
destroyObjects
()
}
function
showItemVisuals
()
{
if
(
_itemVisuals
.
length
===
0
)
{
var
itemVisual
=
loiterPointComponent
.
createObject
(
map
)
map
.
addMapItem
(
itemVisual
)
_itemVisuals
.
push
(
itemVisual
)
_loiterPointObject
=
itemVisual
itemVisual
=
landingPointComponent
.
createObject
(
map
)
map
.
addMapItem
(
itemVisual
)
_itemVisuals
.
push
(
itemVisual
)
_landingPointObject
=
itemVisual
if
(
objMgr
.
rgDynamicObjects
.
length
===
0
)
{
_loiterPointObject
=
objMgr
.
createObject
(
loiterPointComponent
,
map
,
true
/* parentObjectIsMap */
)
_landingPointObject
=
objMgr
.
createObject
(
landingPointComponent
,
map
,
true
/* parentObjectIsMap */
)
var
rgComponents
=
[
flightPathComponent
,
loiterRadiusComponent
,
landingAreaComponent
,
landingAreaLabelComponent
,
glideSlopeComponent
,
glideSlopeLabelComponent
]
for
(
var
i
=
0
;
i
<
rgComponents
.
length
;
i
++
)
{
var
obj
=
rgComponents
[
i
].
createObject
(
map
)
_itemVisuals
.
push
(
obj
)
map
.
addMapItem
(
obj
)
}
objMgr
.
createObjects
(
rgComponents
,
map
,
true
/* parentObjectIsMap */
)
}
}
...
...
@@ -98,6 +83,10 @@ Item {
_flightPath
=
[
_missionItem
.
loiterTangentCoordinate
,
_missionItem
.
landingCoordinate
]
}
QGCDynamicObjectManager
{
id
:
objMgr
}
Component.onCompleted
:
{
if
(
_missionItem
.
landingCoordSet
)
{
showItemVisuals
()
...
...
src/PlanView/StructureScanMapVisual.qml
View file @
980d4aa4
...
...
@@ -27,21 +27,15 @@ Item {
property
var
_missionItem
:
object
property
var
_structurePolygon
:
object
.
structurePolygon
property
var
_flightPolygon
:
object
.
flightPolygon
property
var
_entryCoordinate
property
var
_exitCoordinate
signal
clicked
(
int
sequenceNumber
)
function
_addVisualElements
()
{
_entryCoordinate
=
entryPointComponent
.
createObject
(
map
)
_exitCoordinate
=
exitPointComponent
.
createObject
(
map
)
map
.
addMapItem
(
_entryCoordinate
)
map
.
addMapItem
(
_exitCoordinate
)
objMgr
.
createObjects
([
entryPointComponent
,
exitPointComponent
],
map
,
true
/* parentObjectIsMap */
)
}
function
_destroyVisualElements
()
{
_entryCoordinate
.
destroy
()
_exitCoordinate
.
destroy
()
objMgr
.
destroyObjects
()
}
/// Add an initial 4 sided polygon if there is none
...
...
@@ -85,6 +79,10 @@ Item {
_destroyVisualElements
()
}
QGCDynamicObjectManager
{
id
:
objMgr
}
QGCMapPolygonVisuals
{
mapControl
:
map
mapPolygon
:
_structurePolygon
...
...
src/PlanView/TransectStyleMapVisuals.qml
View file @
980d4aa4
...
...
@@ -39,24 +39,17 @@ Item {
property
var
_exitTransectsComponent
:
null
property
var
_entryCoordinate
property
var
_exitCoordinate
property
var
_dynamicComponents
:
[
]
signal
clicked
(
int
sequenceNumber
)
function
_addVisualElements
()
{
var
toAdd
=
[
fullTransectsComponent
,
entryTransectComponent
,
exitTransectComponent
,
entryPointComponent
,
exitPointComponent
,
entryArrow1Component
,
entryArrow2Component
,
exitArrow1Component
,
exitArrow2Component
]
for
(
var
i
=
0
;
i
<
toAdd
.
length
;
i
++
)
{
_dynamicComponents
.
push
(
toAdd
[
i
].
createObject
(
map
))
map
.
addMapItem
(
_dynamicComponents
[
_dynamicComponents
.
length
-
1
])
}
objMgr
.
createObjects
(
toAdd
,
map
,
true
/* parentObjectIsMap */
)
}
function
_destroyVisualElements
()
{
for
(
var
i
=
0
;
i
<
_dynamicComponents
.
length
;
i
++
)
{
_dynamicComponents
[
i
].
destroy
()
}
_dynamicComponents
=
[
]
objMgr
.
destroyObjects
()
}
Component.onCompleted
:
{
...
...
@@ -67,6 +60,10 @@ Item {
_destroyVisualElements
()
}
QGCDynamicObjectManager
{
id
:
objMgr
}
// Area polygon
QGCMapPolygonVisuals
{
id
:
mapPolygonVisuals
...
...
src/QmlControls/QGCDynamicObjectManager.qml
0 → 100644
View file @
980d4aa4
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtQuick
.
Controls
.
Styles
1.4
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
ScreenTools
1.0
/// Provides a standard set of tools for dynamically create/adding/removing Qml objects
Item
{
visible
:
false
property
var
rgDynamicObjects
:
[
]
function
createObject
(
sourceComponent
,
parentObject
,
parentObjectIsMap
)
{
var
obj
=
sourceComponent
.
createObject
(
parentObject
)
rgDynamicObjects
.
push
(
obj
)
if
(
arguments
.
length
<
3
)
{
parentObjectIsMap
=
false
}
if
(
parentObjectIsMap
)
{
map
.
addMapItem
(
obj
)
}
return
obj
}
function
createObjects
(
rgSourceComponents
,
parentObject
,
parentObjectIsMap
)
{
if
(
arguments
.
length
<
3
)
{
parentObjectIsMap
=
false
}
for
(
var
i
=
0
;
i
<
rgSourceComponents
.
length
;
i
++
)
{
createObject
(
rgSourceComponents
[
i
],
parentObject
,
parentObjectIsMap
)
}
}
function
destroyObjects
()
{
for
(
var
i
=
0
;
i
<
rgDynamicObjects
.
length
;
i
++
)
{
rgDynamicObjects
[
i
].
destroy
()
}
rgDynamicObjects
=
[
]
}
}
src/QmlControls/QGroundControl/Controls/qmldir
View file @
980d4aa4
...
...
@@ -42,6 +42,7 @@ QGCButton 1.0 QGCButton.qml
QGCCheckBox 1.0 QGCCheckBox.qml
QGCColoredImage 1.0 QGCColoredImage.qml
QGCComboBox 1.0 QGCComboBox.qml
QGCDynamicObjectManager 1.0 QGCDynamicObjectManager.qml
QGCFileDialog 1.0 QGCFileDialog.qml
QGCFlickable 1.0 QGCFlickable.qml
QGCGroupBox 1.0 QGCGroupBox.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