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
754a3ebb
Unverified
Commit
754a3ebb
authored
Sep 01, 2019
by
Don Gagne
Committed by
GitHub
Sep 01, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7747 from DonLakeFlyer/CorridorScanVisual
Corridor scan visuals
parents
789493b7
0d6df9f2
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
170 additions
and
229 deletions
+170
-229
qgroundcontrol.qrc
qgroundcontrol.qrc
+1
-0
QGCMapPolylineVisuals.qml
src/MissionManager/QGCMapPolylineVisuals.qml
+3
-1
CorridorScanMapVisual.qml
src/PlanView/CorridorScanMapVisual.qml
+5
-94
SurveyMapVisual.qml
src/PlanView/SurveyMapVisual.qml
+3
-134
TransectStyleMapVisuals.qml
src/PlanView/TransectStyleMapVisuals.qml
+157
-0
qmldir
src/QmlControls/QGroundControl/Controls/qmldir
+1
-0
No files found.
qgroundcontrol.qrc
View file @
754a3ebb
...
...
@@ -147,6 +147,7 @@
<file alias="QGroundControl/Controls/SurveyMapVisual.qml">src/PlanView/SurveyMapVisual.qml</file>
<file alias="QGroundControl/Controls/ToolStrip.qml">src/QmlControls/ToolStrip.qml</file>
<file alias="QGroundControl/Controls/TransectStyleComplexItemStats.qml">src/PlanView/TransectStyleComplexItemStats.qml</file>
<file alias="QGroundControl/Controls/TransectStyleMapVisuals.qml">src/PlanView/TransectStyleMapVisuals.qml</file>
<file alias="QGroundControl/Controls/VehicleRotationCal.qml">src/QmlControls/VehicleRotationCal.qml</file>
<file alias="QGroundControl/Controls/VehicleSummaryRow.qml">src/QmlControls/VehicleSummaryRow.qml</file>
<file alias="QGroundControl/Controls/ViewWidget.qml">src/ViewWidgets/ViewWidget.qml</file>
...
...
src/MissionManager/QGCMapPolylineVisuals.qml
View file @
754a3ebb
...
...
@@ -20,7 +20,7 @@ import QGroundControl.Controls 1.0
import
QGroundControl
.
FlightMap
1.0
import
QGroundControl
.
ShapeFileHelper
1.0
/// QGC
m
apPolyline map visuals
/// QGC
M
apPolyline map visuals
Item
{
id
:
_root
...
...
@@ -98,6 +98,8 @@ Item {
}
}
onVisibleChanged
:
_polylineComponent
.
visible
=
visible
Component.onCompleted
:
{
addVisuals
()
if
(
interactive
)
{
...
...
src/PlanView/CorridorScanMapVisual.qml
View file @
754a3ebb
...
...
@@ -16,107 +16,18 @@ import QGroundControl 1.0
import
QGroundControl
.
Controls
1.0
/// Corridor Scan Complex Mission Item visuals
Item
{
id
:
_root
TransectStyleMapVisuals
{
property
bool
_currentItem
:
object
.
isCurrentItem
property
var
map
///< Map control to place item in
property
var
_missionItem
:
object
property
var
_entryCoordinate
property
var
_exitCoordinate
property
var
_transectLines
signal
clicked
(
int
sequenceNumber
)
function
_addVisualElements
()
{
_entryCoordinate
=
entryPointComponent
.
createObject
(
map
)
_exitCoordinate
=
exitPointComponent
.
createObject
(
map
)
_transectLines
=
transectsComponent
.
createObject
(
map
)
map
.
addMapItem
(
_entryCoordinate
)
map
.
addMapItem
(
_exitCoordinate
)
map
.
addMapItem
(
_transectLines
)
}
function
_destroyVisualElements
()
{
_entryCoordinate
.
destroy
()
_exitCoordinate
.
destroy
()
_transectLines
.
destroy
()
}
Component.onCompleted
:
{
mapPolylineVisuals
.
addInitialPolyline
()
_addVisualElements
()
}
Component.onDestruction
:
{
_destroyVisualElements
()
}
QGCMapPolygonVisuals
{
mapControl
:
map
mapPolygon
:
object
.
surveyAreaPolygon
interactive
:
false
interiorColor
:
"
green
"
interiorOpacity
:
0.25
}
Component.onCompleted
:
mapPolylineVisuals
.
addInitialPolyline
()
QGCMapPolylineVisuals
{
id
:
mapPolylineVisuals
mapControl
:
map
mapPolyline
:
object
.
corridorPolyline
interactive
:
_
missionItem
.
isC
urrentItem
interactive
:
_
c
urrentItem
lineWidth
:
3
lineColor
:
"
#be781c
"
}
// Entry point
Component
{
id
:
entryPointComponent
MapQuickItem
{
anchorPoint.x
:
sourceItem
.
anchorPointX
anchorPoint.y
:
sourceItem
.
anchorPointY
z
:
QGroundControl
.
zOrderMapItems
coordinate
:
_missionItem
.
coordinate
visible
:
_missionItem
.
coordinate
.
isValid
sourceItem
:
MissionItemIndexLabel
{
index
:
_missionItem
.
sequenceNumber
label
:
"
Entry
"
checked
:
_missionItem
.
isCurrentItem
onClicked
:
_root
.
clicked
(
_missionItem
.
sequenceNumber
)
}
}
}
// Exit point
Component
{
id
:
exitPointComponent
MapQuickItem
{
anchorPoint.x
:
sourceItem
.
anchorPointX
anchorPoint.y
:
sourceItem
.
anchorPointY
z
:
QGroundControl
.
zOrderMapItems
coordinate
:
_missionItem
.
exitCoordinate
visible
:
_missionItem
.
exitCoordinate
.
isValid
sourceItem
:
MissionItemIndexLabel
{
index
:
_missionItem
.
lastSequenceNumber
label
:
"
Exit
"
checked
:
_missionItem
.
isCurrentItem
onClicked
:
_root
.
clicked
(
_missionItem
.
sequenceNumber
)
}
}
}
// Transect lines
Component
{
id
:
transectsComponent
MapPolyline
{
line.color
:
"
white
"
line.width
:
2
path
:
_missionItem
.
visualTransectPoints
}
visible
:
_currentItem
}
}
src/PlanView/SurveyMapVisual.qml
View file @
754a3ebb
...
...
@@ -19,45 +19,8 @@ import QGroundControl.Controls 1.0
import
QGroundControl
.
FlightMap
1.0
/// Survey Complex Mission Item visuals
Item
{
id
:
_root
property
var
map
///< Map control to place item in
property
var
_missionItem
:
object
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
>
1
property
var
_fullTransectsComponent
:
null
property
var
_entryTransectsComponent
:
null
property
var
_exitTransectsComponent
:
null
property
var
_entryCoordinate
property
var
_exitCoordinate
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
)
}
function
_destroyVisualElements
()
{
_fullTransectsComponent
.
destroy
()
_entryTransectsComponent
.
destroy
()
_exitTransectsComponent
.
destroy
()
_entryCoordinate
.
destroy
()
_exitCoordinate
.
destroy
()
}
TransectStyleMapVisuals
{
property
var
_mapPolygon
:
object
.
surveyAreaPolygon
/// Add an initial 4 sided polygon if there is none
function
_addInitialPolygon
()
{
...
...
@@ -90,99 +53,5 @@ Item {
}
}
Component.onCompleted
:
{
_addInitialPolygon
()
_addVisualElements
()
}
Component.onDestruction
:
{
_destroyVisualElements
()
}
QGCMapPolygonVisuals
{
id
:
mapPolygonVisuals
mapControl
:
map
mapPolygon
:
_mapPolygon
interactive
:
_missionItem
.
isCurrentItem
borderWidth
:
1
borderColor
:
"
black
"
interiorColor
:
"
green
"
interiorOpacity
:
0.5
}
// Full set of transects lines. Shown when item is selected.
Component
{
id
:
fullTransectsComponent
MapPolyline
{
line.color
:
"
white
"
line.width
:
2
path
:
_transectPoints
visible
:
_currentItem
}
}
// Entry and exit transect lines only. Used when item is not selected.
Component
{
id
:
entryTransectComponent
MapPolyline
{
line.color
:
"
white
"
line.width
:
2
path
:
_showPartialEntryExit
?
[
_transectPoints
[
0
],
_transectPoints
[
1
]
]
:
[]
visible
:
_showPartialEntryExit
}
}
Component
{
id
:
exitTransectComponent
MapPolyline
{
line.color
:
"
white
"
line.width
:
2
path
:
_showPartialEntryExit
?
[
_transectPoints
[
lastPointIndex
-
1
],
_transectPoints
[
lastPointIndex
]
]
:
[]
visible
:
_showPartialEntryExit
property
int
lastPointIndex
:
_transectPoints
.
length
-
1
}
}
// Entry point
Component
{
id
:
entryPointComponent
MapQuickItem
{
anchorPoint.x
:
sourceItem
.
anchorPointX
anchorPoint.y
:
sourceItem
.
anchorPointY
z
:
QGroundControl
.
zOrderMapItems
coordinate
:
_missionItem
.
coordinate
visible
:
_missionItem
.
exitCoordinate
.
isValid
sourceItem
:
MissionItemIndexLabel
{
index
:
_missionItem
.
sequenceNumber
label
:
"
Entry
"
checked
:
_missionItem
.
isCurrentItem
onClicked
:
_root
.
clicked
(
_missionItem
.
sequenceNumber
)
}
}
}
// Exit point
Component
{
id
:
exitPointComponent
MapQuickItem
{
anchorPoint.x
:
sourceItem
.
anchorPointX
anchorPoint.y
:
sourceItem
.
anchorPointY
z
:
QGroundControl
.
zOrderMapItems
coordinate
:
_missionItem
.
exitCoordinate
visible
:
_missionItem
.
exitCoordinate
.
isValid
sourceItem
:
MissionItemIndexLabel
{
index
:
_missionItem
.
lastSequenceNumber
label
:
"
Exit
"
checked
:
_missionItem
.
isCurrentItem
onClicked
:
_root
.
clicked
(
_missionItem
.
sequenceNumber
)
}
}
}
Component.onCompleted
:
_addInitialPolygon
()
}
src/PlanView/TransectStyleMapVisuals.qml
0 → 100644
View file @
754a3ebb
/****************************************************************************
*
* (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
*
* QGroundControl is licensed according to the terms in the file
* COPYING.md in the root of the source code directory.
*
****************************************************************************/
import
QtQuick
2.3
import
QtQuick
.
Controls
1.2
import
QtLocation
5.3
import
QtPositioning
5.3
import
QGroundControl
1.0
import
QGroundControl
.
ScreenTools
1.0
import
QGroundControl
.
Palette
1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
FlightMap
1.0
/// Base control for both Survey and Corridor Scan map visuals
Item
{
id
:
_root
property
var
map
///< Map control to place item in
property
var
_missionItem
:
object
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
var
_fullTransectsComponent
:
null
property
var
_entryTransectsComponent
:
null
property
var
_exitTransectsComponent
:
null
property
var
_entryCoordinate
property
var
_exitCoordinate
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
)
}
function
_destroyVisualElements
()
{
_fullTransectsComponent
.
destroy
()
_entryTransectsComponent
.
destroy
()
_exitTransectsComponent
.
destroy
()
_entryCoordinate
.
destroy
()
_exitCoordinate
.
destroy
()
}
Component.onCompleted
:
{
_addVisualElements
()
}
Component.onDestruction
:
{
_destroyVisualElements
()
}
// Area polygon
QGCMapPolygonVisuals
{
id
:
mapPolygonVisuals
mapControl
:
map
mapPolygon
:
_mapPolygon
interactive
:
_missionItem
.
isCurrentItem
borderWidth
:
1
borderColor
:
"
black
"
interiorColor
:
"
green
"
interiorOpacity
:
0.5
}
// Full set of transects lines. Shown when item is selected.
Component
{
id
:
fullTransectsComponent
MapPolyline
{
line.color
:
"
white
"
line.width
:
2
path
:
_transectPoints
visible
:
_currentItem
}
}
// Entry and exit transect lines only. Used when item is not selected.
Component
{
id
:
entryTransectComponent
MapPolyline
{
line.color
:
"
white
"
line.width
:
2
path
:
_showPartialEntryExit
?
[
_transectPoints
[
0
],
_transectPoints
[
1
]
]
:
[]
visible
:
_showPartialEntryExit
}
}
Component
{
id
:
exitTransectComponent
MapPolyline
{
line.color
:
"
white
"
line.width
:
2
path
:
_showPartialEntryExit
?
[
_transectPoints
[
lastPointIndex
-
1
],
_transectPoints
[
lastPointIndex
]
]
:
[]
visible
:
_showPartialEntryExit
property
int
lastPointIndex
:
_transectPoints
.
length
-
1
}
}
// Entry point
Component
{
id
:
entryPointComponent
MapQuickItem
{
anchorPoint.x
:
sourceItem
.
anchorPointX
anchorPoint.y
:
sourceItem
.
anchorPointY
z
:
QGroundControl
.
zOrderMapItems
coordinate
:
_missionItem
.
coordinate
visible
:
_missionItem
.
exitCoordinate
.
isValid
sourceItem
:
MissionItemIndexLabel
{
index
:
_missionItem
.
sequenceNumber
label
:
qsTr
(
"
Entry
"
)
checked
:
_missionItem
.
isCurrentItem
onClicked
:
_root
.
clicked
(
_missionItem
.
sequenceNumber
)
}
}
}
// Exit point
Component
{
id
:
exitPointComponent
MapQuickItem
{
anchorPoint.x
:
sourceItem
.
anchorPointX
anchorPoint.y
:
sourceItem
.
anchorPointY
z
:
QGroundControl
.
zOrderMapItems
coordinate
:
_missionItem
.
exitCoordinate
visible
:
_missionItem
.
exitCoordinate
.
isValid
sourceItem
:
MissionItemIndexLabel
{
index
:
_missionItem
.
lastSequenceNumber
label
:
qsTr
(
"
Exit
"
)
checked
:
_missionItem
.
isCurrentItem
onClicked
:
_root
.
clicked
(
_missionItem
.
sequenceNumber
)
}
}
}
}
src/QmlControls/QGroundControl/Controls/qmldir
View file @
754a3ebb
...
...
@@ -80,6 +80,7 @@ SliderSwitch 1.0 SliderSwitch.qml
SubMenuButton 1.0 SubMenuButton.qml
SurveyMapVisuals 1.0 SurveyMapVisuals.qml
TransectStyleComplexItemStats 1.0 TransectStyleComplexItemStats.qml
TransectStyleMapVisuals 1.0 TransectStyleMapVisuals.qml
ToolStrip 1.0 ToolStrip.qml
VehicleRotationCal 1.0 VehicleRotationCal.qml
VehicleSummaryRow 1.0 VehicleSummaryRow.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