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
10fc35fb
Unverified
Commit
10fc35fb
authored
Oct 05, 2019
by
Don Gagne
Committed by
GitHub
Oct 05, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7876 from DonLakeFlyer/StructureScan
Structure Scan: Start with no polygon
parents
d6685452
f3ddd277
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
152 additions
and
176 deletions
+152
-176
QGCMapPolygonVisuals.qml
src/MissionManager/QGCMapPolygonVisuals.qml
+2
-2
QGCMapPolylineVisuals.qml
src/MissionManager/QGCMapPolylineVisuals.qml
+2
-2
CorridorScanEditor.qml
src/PlanView/CorridorScanEditor.qml
+1
-1
StructureScanEditor.qml
src/PlanView/StructureScanEditor.qml
+145
-126
StructureScanMapVisual.qml
src/PlanView/StructureScanMapVisual.qml
+2
-45
No files found.
src/MissionManager/QGCMapPolygonVisuals.qml
View file @
10fc35fb
...
...
@@ -525,14 +525,14 @@ Item {
QGCButton
{
_horizontalPadding
:
0
text
:
qsTr
(
"
Basic
Polygon
"
)
text
:
qsTr
(
"
Basic
"
)
visible
:
!
_traceMode
onClicked
:
_resetPolygon
()
}
QGCButton
{
_horizontalPadding
:
0
text
:
qsTr
(
"
Circular
Polygon
"
)
text
:
qsTr
(
"
Circular
"
)
visible
:
!
_traceMode
onClicked
:
_resetCircle
()
}
...
...
src/MissionManager/QGCMapPolylineVisuals.qml
View file @
10fc35fb
...
...
@@ -323,14 +323,14 @@ Item {
QGCButton
{
_horizontalPadding
:
0
text
:
qsTr
(
"
Basic
Corridor
"
)
text
:
qsTr
(
"
Basic
"
)
visible
:
!
_traceMode
onClicked
:
_resetPolyline
()
}
QGCButton
{
_horizontalPadding
:
0
text
:
_traceMode
?
qsTr
(
"
Done Tracing
"
)
:
qsTr
(
"
Trace
Corridor
"
)
text
:
_traceMode
?
qsTr
(
"
Done Tracing
"
)
:
qsTr
(
"
Trace
"
)
onClicked
:
{
if
(
_traceMode
)
{
if
(
mapPolyline
.
count
<
2
)
{
...
...
src/PlanView/CorridorScanEditor.qml
View file @
10fc35fb
...
...
@@ -72,7 +72,7 @@ Rectangle {
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
spacing
:
_margin
visible
:
missionItem
.
surveyAreaPolygon
.
isValid
visible
:
missionItem
.
corridorPolyline
.
isValid
QGCTabBar
{
id
:
tabBar
...
...
src/PlanView/StructureScanEditor.qml
View file @
10fc35fb
This diff is collapsed.
Click to expand it.
src/PlanView/StructureScanMapVisual.qml
View file @
10fc35fb
...
...
@@ -18,7 +18,7 @@ import QGroundControl.Palette 1.0
import
QGroundControl
.
Controls
1.0
import
QGroundControl
.
FlightMap
1.0
/// S
urvey
Complex Mission Item visuals
/// S
tructure Scan
Complex Mission Item visuals
Item
{
id
:
_root
...
...
@@ -34,54 +34,11 @@ Item {
objMgr
.
createObjects
([
entryPointComponent
,
exitPointComponent
],
map
,
true
/* parentObjectIsMap */
)
}
function
_destroyVisualElements
()
{
objMgr
.
destroyObjects
()
}
/// Add an initial 4 sided polygon if there is none
function
_addInitialPolygon
()
{
if
(
_structurePolygon
.
count
<
3
)
{
// Initial polygon is inset to take 2/3rds space
var
rect
=
Qt
.
rect
(
map
.
centerViewport
.
x
,
map
.
centerViewport
.
y
,
map
.
centerViewport
.
width
,
map
.
centerViewport
.
height
)
rect
.
x
+=
(
rect
.
width
*
0.25
)
/
2
rect
.
y
+=
(
rect
.
height
*
0.25
)
/
2
rect
.
width
*=
0.75
rect
.
height
*=
0.75
var
centerCoord
=
map
.
toCoordinate
(
Qt
.
point
(
rect
.
x
+
(
rect
.
width
/
2
),
rect
.
y
+
(
rect
.
height
/
2
)),
false
/* clipToViewPort */
)
var
topLeftCoord
=
map
.
toCoordinate
(
Qt
.
point
(
rect
.
x
,
rect
.
y
),
false
/* clipToViewPort */
)
var
topRightCoord
=
map
.
toCoordinate
(
Qt
.
point
(
rect
.
x
+
rect
.
width
,
rect
.
y
),
false
/* clipToViewPort */
)
var
bottomLeftCoord
=
map
.
toCoordinate
(
Qt
.
point
(
rect
.
x
,
rect
.
y
+
rect
.
height
),
false
/* clipToViewPort */
)
var
bottomRightCoord
=
map
.
toCoordinate
(
Qt
.
point
(
rect
.
x
+
rect
.
width
,
rect
.
y
+
rect
.
height
),
false
/* clipToViewPort */
)
// Adjust polygon to max size
var
maxSize
=
100
var
halfWidthMeters
=
Math
.
min
(
topLeftCoord
.
distanceTo
(
topRightCoord
),
maxSize
)
/
2
var
halfHeightMeters
=
Math
.
min
(
topLeftCoord
.
distanceTo
(
bottomLeftCoord
),
maxSize
)
/
2
topLeftCoord
=
centerCoord
.
atDistanceAndAzimuth
(
halfWidthMeters
,
-
90
).
atDistanceAndAzimuth
(
halfHeightMeters
,
0
)
topRightCoord
=
centerCoord
.
atDistanceAndAzimuth
(
halfWidthMeters
,
90
).
atDistanceAndAzimuth
(
halfHeightMeters
,
0
)
bottomLeftCoord
=
centerCoord
.
atDistanceAndAzimuth
(
halfWidthMeters
,
-
90
).
atDistanceAndAzimuth
(
halfHeightMeters
,
180
)
bottomRightCoord
=
centerCoord
.
atDistanceAndAzimuth
(
halfWidthMeters
,
90
).
atDistanceAndAzimuth
(
halfHeightMeters
,
180
)
_structurePolygon
.
appendVertex
(
topLeftCoord
)
_structurePolygon
.
appendVertex
(
topRightCoord
)
_structurePolygon
.
appendVertex
(
bottomRightCoord
)
_structurePolygon
.
appendVertex
(
bottomLeftCoord
)
}
}
Component.onCompleted
:
{
_addInitialPolygon
()
_addVisualElements
()
}
Component.onDestruction
:
{
_destroyVisualElements
()
}
QGCDynamicObjectManager
{
id
:
objMgr
}
QGCDynamicObjectManager
{
id
:
objMgr
}
QGCMapPolygonVisuals
{
mapControl
:
map
...
...
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