Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
b25e32e3
Commit
b25e32e3
authored
Jul 12, 2016
by
Don Gagne
Browse files
Use new polygon drawing tool
parent
2c5f081c
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/MissionEditor/SurveyItemEditor.qml
View file @
b25e32e3
...
...
@@ -19,8 +19,7 @@ Rectangle {
//property real availableWidth ///< Width for control
//property var missionItem ///< Mission Item for editor
property
bool
_addPointsMode
:
false
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
QGCPalette
{
id
:
qgcPal
;
colorGroupEnabled
:
true
}
...
...
@@ -32,16 +31,6 @@ Rectangle {
anchors.right
:
parent
.
right
spacing
:
_margin
Connections
{
target
:
editorMap
onMapClicked
:
{
if
(
_addPointsMode
)
{
missionItem
.
addPolygonCoordinate
(
coordinate
)
}
}
}
QGCLabel
{
text
:
qsTr
(
"
Fly a grid pattern over a defined area.
"
)
wrapMode
:
Text
.
WordWrap
...
...
@@ -108,14 +97,29 @@ Rectangle {
}
}
Connections
{
target
:
editorMap
.
polygonDraw
onPolygonStarted
:
{
missionItem
.
clearPolygon
()
}
onPolygonFinished
:
{
for
(
var
i
=
0
;
i
<
coordinates
.
length
;
i
++
)
{
missionItem
.
addPolygonCoordinate
(
coordinates
[
i
])
}
}
}
QGCButton
{
text
:
_addPointsMode
?
qsTr
(
"
Finish Polygon
"
)
:
qsTr
(
"
Draw Polygon
"
)
text
:
editorMap
.
polygonDraw
.
drawingPolygon
?
qsTr
(
"
Finish Polygon
"
)
:
qsTr
(
"
Draw Polygon
"
)
enabled
:
(
editorMap
.
polygonDraw
.
drawingPolygon
&&
editorMap
.
polygonDraw
.
polygonReady
)
||
!
editorMap
.
polygonDraw
.
drawingPolygon
onClicked
:
{
if
(
_addPointsMode
)
{
_addPointsMode
=
false
if
(
editorMap
.
polygonDraw
.
drawingPolygon
)
{
editorMap
.
polygonDraw
.
finishPolygon
()
}
else
{
missionItem
.
clearPolygon
()
_addPointsMode
=
true
editorMap
.
polygonDraw
.
startPolygon
()
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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