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
b0c57f4b
Commit
b0c57f4b
authored
Feb 20, 2020
by
DoinLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
d52d9f1d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
20 deletions
+26
-20
QGCMapPolygon.h
src/MissionManager/QGCMapPolygon.h
+3
-0
QGCMapPolygonVisuals.qml
src/MissionManager/QGCMapPolygonVisuals.qml
+22
-19
SurveyItemEditor.qml
src/PlanView/SurveyItemEditor.qml
+1
-1
No files found.
src/MissionManager/QGCMapPolygon.h
View file @
b0c57f4b
...
...
@@ -38,6 +38,7 @@ public:
Q_PROPERTY
(
bool
interactive
READ
interactive
WRITE
setInteractive
NOTIFY
interactiveChanged
)
Q_PROPERTY
(
bool
isValid
READ
isValid
NOTIFY
isValidChanged
)
Q_PROPERTY
(
bool
empty
READ
empty
NOTIFY
isEmptyChanged
)
Q_PROPERTY
(
bool
traceMode
MEMBER
_traceMode
NOTIFY
traceModeChanged
)
Q_INVOKABLE
void
clear
(
void
);
Q_INVOKABLE
void
appendVertex
(
const
QGeoCoordinate
&
coordinate
);
...
...
@@ -124,6 +125,7 @@ signals:
void
interactiveChanged
(
bool
interactive
);
bool
isValidChanged
(
void
);
bool
isEmptyChanged
(
void
);
void
traceModeChanged
(
bool
traceMode
);
private
slots
:
void
_polygonModelCountChanged
(
int
count
);
...
...
@@ -146,6 +148,7 @@ private:
bool
_ignoreCenterUpdates
;
bool
_interactive
;
bool
_resetActive
;
bool
_traceMode
=
false
;
};
#endif
src/MissionManager/QGCMapPolygonVisuals.qml
View file @
b0c57f4b
...
...
@@ -38,7 +38,6 @@ Item {
property
bool
_circleRadiusDrag
:
false
property
var
_circleRadiusDragCoord
:
QtPositioning
.
coordinate
()
property
bool
_editCircleRadius
:
false
property
bool
_traceMode
:
false
property
string
_instructionText
:
_polygonToolsText
property
var
_savedVertices
:
[
]
property
bool
_savedCircleMode
...
...
@@ -157,7 +156,7 @@ Item {
addEditingVisuals
()
addToolbarVisuals
()
}
else
{
_
traceMode
=
false
mapPolygon
.
traceMode
=
false
removeEditingVisuals
()
removeToolVisuals
()
}
...
...
@@ -183,16 +182,6 @@ Item {
onInteractiveChanged
:
_handleInteractiveChanged
()
on_TraceModeChanged
:
{
if
(
_traceMode
)
{
_instructionText
=
_traceText
_objMgrTraceVisuals
.
createObject
(
traceMouseAreaComponent
,
mapControl
,
false
)
}
else
{
_instructionText
=
_polygonToolsText
_objMgrTraceVisuals
.
destroyObjects
()
}
}
on_CircleModeChanged
:
{
if
(
_circleMode
)
{
addCircleVisuals
()
...
...
@@ -201,10 +190,24 @@ Item {
}
}
Connections
{
target
:
mapPolygon
onTraceModeChanged
:
{
if
(
mapPolygon
.
traceMode
)
{
_instructionText
=
_traceText
_objMgrTraceVisuals
.
createObject
(
traceMouseAreaComponent
,
mapControl
,
false
)
}
else
{
_instructionText
=
_polygonToolsText
_objMgrTraceVisuals
.
destroyObjects
()
}
}
}
Component.onCompleted
:
{
addCommonVisuals
()
_handleInteractiveChanged
()
}
Component.onDestruction
:
map
.
traceMode
=
false
QGCDynamicObjectManager
{
id
:
_objMgrCommonVisuals
}
QGCDynamicObjectManager
{
id
:
_objMgrToolVisuals
}
...
...
@@ -526,30 +529,30 @@ Item {
QGCButton
{
_horizontalPadding
:
0
text
:
qsTr
(
"
Basic
"
)
visible
:
!
_
traceMode
visible
:
!
mapPolygon
.
traceMode
onClicked
:
_resetPolygon
()
}
QGCButton
{
_horizontalPadding
:
0
text
:
qsTr
(
"
Circular
"
)
visible
:
!
_
traceMode
visible
:
!
mapPolygon
.
traceMode
onClicked
:
_resetCircle
()
}
QGCButton
{
_horizontalPadding
:
0
text
:
_
traceMode
?
qsTr
(
"
Done Tracing
"
)
:
qsTr
(
"
Trace
"
)
text
:
mapPolygon
.
traceMode
?
qsTr
(
"
Done Tracing
"
)
:
qsTr
(
"
Trace
"
)
onClicked
:
{
if
(
_
traceMode
)
{
if
(
mapPolygon
.
traceMode
)
{
if
(
mapPolygon
.
count
<
3
)
{
_restorePreviousVertices
()
}
_
traceMode
=
false
mapPolygon
.
traceMode
=
false
}
else
{
_saveCurrentVertices
()
_circleMode
=
false
_
traceMode
=
true
mapPolygon
.
traceMode
=
true
mapPolygon
.
clear
();
}
}
...
...
@@ -559,7 +562,7 @@ Item {
_horizontalPadding
:
0
text
:
qsTr
(
"
Load KML/SHP...
"
)
onClicked
:
kmlOrSHPLoadDialog
.
openForLoad
()
visible
:
!
_
traceMode
visible
:
!
mapPolygon
.
traceMode
}
}
}
...
...
src/PlanView/SurveyItemEditor.qml
View file @
b0c57f4b
...
...
@@ -80,7 +80,7 @@ Rectangle {
QGCButton
{
text
:
qsTr
(
"
Done With Polygon
"
)
Layout.fillWidth
:
true
enabled
:
missionItem
.
surveyAreaPolygon
.
isValid
enabled
:
missionItem
.
surveyAreaPolygon
.
isValid
&&
!
missionItem
.
surveyAreaPolygon
.
traceMode
onClicked
:
{
if
(
!
_presetsAvailable
)
{
missionItem
.
wizardMode
=
false
...
...
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