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
73c468f1
Commit
73c468f1
authored
Sep 01, 2019
by
Don Gagne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change entry/exit, use new MapLineArrow control
parent
e55c1444
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
66 additions
and
22 deletions
+66
-22
TransectStyleMapVisuals.qml
src/PlanView/TransectStyleMapVisuals.qml
+66
-22
No files found.
src/PlanView/TransectStyleMapVisuals.qml
View file @
73c468f1
...
...
@@ -28,35 +28,35 @@ Item {
property
var
_mapPolygon
:
object
.
surveyAreaPolygon
property
bool
_currentItem
:
object
.
isCurrentItem
property
var
_transectPoints
:
_missionItem
.
visualTransectPoints
property
bool
_showPartialEntryExit
:
!
_currentItem
&&
_missionItem
.
turnAroundDistance
.
rawValue
!==
0
&&
_transectPoints
.
length
>=
2
property
int
_transectCount
:
_transectPoints
.
length
/
(
_hasTurnaround
?
4
:
2
)
property
bool
_hasTurnaround
:
_missionItem
.
turnAroundDistance
.
rawValue
!==
0
property
int
_firstTrueTransectIndex
:
_hasTurnaround
?
1
:
0
property
int
_lastTrueTransectIndex
:
_transectPoints
.
length
-
(
_hasTurnaround
?
2
:
1
)
property
int
_lastPointIndex
:
_transectPoints
.
length
-
1
property
bool
_showPartialEntryExit
:
!
_currentItem
&&
_hasTurnaround
&&
_transectPoints
.
length
>=
2
property
var
_fullTransectsComponent
:
null
property
var
_entryTransectsComponent
:
null
property
var
_exitTransectsComponent
:
null
property
var
_entryCoordinate
property
var
_exitCoordinate
property
var
_dynamicComponents
:
[
]
signal
clicked
(
int
sequenceNumber
)
function
_addVisualElements
()
{
_fullTransectsComponent
=
fullTransectsComponent
.
createObject
(
map
)
_entryTransectsComponent
=
entryTransectComponent
.
createObject
(
map
)
_exitTransectsComponent
=
exitTransectComponent
.
createObject
(
map
)
_entryCoordinate
=
entryPointComponent
.
createObject
(
map
)
_exitCoordinate
=
exitPointComponent
.
createObject
(
map
)
map
.
addMapItem
(
_fullTransectsComponent
)
map
.
addMapItem
(
_entryTransectsComponent
)
map
.
addMapItem
(
_exitTransectsComponent
)
map
.
addMapItem
(
_entryCoordinate
)
map
.
addMapItem
(
_exitCoordinate
)
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
])
}
}
function
_destroyVisualElements
()
{
_fullTransectsComponent
.
destroy
()
_entryTransectsComponent
.
destroy
()
_exitTransectsComponent
.
destroy
()
_entryCoordinate
.
destroy
()
_exitCoordinate
.
destroy
()
for
(
var
i
=
0
;
i
<
_dynamicComponents
.
length
;
i
++
)
{
_dynamicComponents
[
i
].
destroy
()
}
_dynamicComponents
=
[
]
}
Component.onCompleted
:
{
...
...
@@ -108,10 +108,8 @@ Item {
MapPolyline
{
line.color
:
"
white
"
line.width
:
2
path
:
_showPartialEntryExit
?
[
_transectPoints
[
lastPointIndex
-
1
],
_transectPoints
[
lastPointIndex
]
]
:
[]
path
:
_showPartialEntryExit
?
[
_transectPoints
[
_lastPointIndex
-
1
],
_transectPoints
[
_
lastPointIndex
]
]
:
[]
visible
:
_showPartialEntryExit
property
int
lastPointIndex
:
_transectPoints
.
length
-
1
}
}
...
...
@@ -128,13 +126,60 @@ Item {
sourceItem
:
MissionItemIndexLabel
{
index
:
_missionItem
.
sequenceNumber
label
:
qsTr
(
"
Entry
"
)
checked
:
_missionItem
.
isCurrentItem
onClicked
:
_root
.
clicked
(
_missionItem
.
sequenceNumber
)
}
}
}
Component
{
id
:
entryArrow1Component
MapLineArrow
{
fromCoord
:
_transectPoints
[
_firstTrueTransectIndex
]
toCoord
:
_transectPoints
[
_firstTrueTransectIndex
+
1
]
exitPosition
:
false
visible
:
_currentItem
}
}
Component
{
id
:
entryArrow2Component
MapLineArrow
{
fromCoord
:
_transectPoints
[
nextTrueTransectIndex
]
toCoord
:
_transectPoints
[
nextTrueTransectIndex
+
1
]
exitPosition
:
false
visible
:
_currentItem
&&
_transectCount
>
3
property
int
nextTrueTransectIndex
:
_firstTrueTransectIndex
+
(
_hasTurnaround
?
4
:
2
)
}
}
Component
{
id
:
exitArrow1Component
MapLineArrow
{
fromCoord
:
_transectPoints
[
_lastTrueTransectIndex
-
1
]
toCoord
:
_transectPoints
[
_lastTrueTransectIndex
]
exitPosition
:
true
visible
:
_currentItem
}
}
Component
{
id
:
exitArrow2Component
MapLineArrow
{
fromCoord
:
_transectPoints
[
prevTrueTransectIndex
-
1
]
toCoord
:
_transectPoints
[
prevTrueTransectIndex
]
exitPosition
:
true
visible
:
_currentItem
&&
_transectCount
>
3
property
int
prevTrueTransectIndex
:
_lastTrueTransectIndex
-
(
_hasTurnaround
?
4
:
2
)
}
}
// Exit point
Component
{
id
:
exitPointComponent
...
...
@@ -148,7 +193,6 @@ Item {
sourceItem
:
MissionItemIndexLabel
{
index
:
_missionItem
.
lastSequenceNumber
label
:
qsTr
(
"
Exit
"
)
checked
:
_missionItem
.
isCurrentItem
onClicked
:
_root
.
clicked
(
_missionItem
.
sequenceNumber
)
}
...
...
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