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
48370879
Commit
48370879
authored
Mar 19, 2017
by
Don Gagne
Committed by
GitHub
Mar 19, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #4799 from DonLakeFlyer/SurveyBugs
Survey bugs
parents
7dd9e3c1
fe70b116
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
35 additions
and
57 deletions
+35
-57
FlightDisplayViewMap.qml
src/FlightDisplay/FlightDisplayViewMap.qml
+1
-1
FlightMap.qml
src/FlightMap/FlightMap.qml
+0
-26
MissionItemIndicatorDrag.qml
src/FlightMap/MapItems/MissionItemIndicatorDrag.qml
+1
-1
PolygonEditor.qml
src/FlightMap/MapItems/PolygonEditor.qml
+2
-2
MapScale.qml
src/FlightMap/MapScale.qml
+2
-2
FWLandingPatternMapVisual.qml
src/MissionEditor/FWLandingPatternMapVisual.qml
+1
-1
MissionEditor.qml
src/MissionEditor/MissionEditor.qml
+2
-2
SurveyItemEditor.qml
src/MissionEditor/SurveyItemEditor.qml
+8
-5
SurveyMapVisual.qml
src/MissionEditor/SurveyMapVisual.qml
+4
-4
SurveyMissionItem.cc
src/MissionManager/SurveyMissionItem.cc
+10
-9
OfflineMap.qml
src/QtLocationPlugin/QMLControl/OfflineMap.qml
+4
-4
No files found.
src/FlightDisplay/FlightDisplayViewMap.qml
View file @
48370879
...
...
@@ -303,7 +303,7 @@ FlightMap {
flightWidgets
.
guidedModeBar
.
state
=
"
Shown
"
}
else
{
if
(
flightWidgets
.
gotoEnabled
)
{
_gotoHereCoordinate
=
flightMap
.
toCoordinate
(
Qt
.
point
(
mouse
.
x
,
mouse
.
y
))
_gotoHereCoordinate
=
flightMap
.
toCoordinate
(
Qt
.
point
(
mouse
.
x
,
mouse
.
y
)
,
false
/* clipToViewPort */
)
flightWidgets
.
guidedModeBar
.
confirmAction
(
flightWidgets
.
guidedModeBar
.
confirmGoTo
)
}
}
...
...
src/FlightMap/FlightMap.qml
View file @
48370879
...
...
@@ -56,32 +56,6 @@ Map {
return
dist
}
function
calculateScale
()
{
var
coord1
,
coord2
,
dist
,
text
,
f
f
=
0
coord1
=
_map
.
toCoordinate
(
Qt
.
point
(
0
,
scale
.
y
))
coord2
=
_map
.
toCoordinate
(
Qt
.
point
(
0
+
scaleImage
.
sourceSize
.
width
,
scale
.
y
))
dist
=
Math
.
round
(
coord1
.
distanceTo
(
coord2
))
if
(
dist
===
0
)
{
// not visible
}
else
{
for
(
var
i
=
0
;
i
<
scaleLengths
.
length
-
1
;
i
++
)
{
if
(
dist
<
(
scaleLengths
[
i
]
+
scaleLengths
[
i
+
1
])
/
2
)
{
f
=
scaleLengths
[
i
]
/
dist
dist
=
scaleLengths
[
i
]
break
;
}
}
if
(
f
===
0
)
{
f
=
dist
/
scaleLengths
[
i
]
dist
=
scaleLengths
[
i
]
}
}
text
=
formatDistance
(
dist
)
scaleImage
.
width
=
(
scaleImage
.
sourceSize
.
width
*
f
)
-
2
*
scaleImageLeft
.
sourceSize
.
width
scaleText
.
text
=
text
}
function
setVisibleRegion
(
region
)
{
// This works around a bug on Qt where if you set a visibleRegion and then the user moves or zooms the map
// and then you set the same visibleRegion the map will not move/scale appropriately since it thinks there
...
...
src/FlightMap/MapItems/MissionItemIndicatorDrag.qml
View file @
48370879
...
...
@@ -44,7 +44,7 @@ Rectangle {
function
liveDrag
()
{
if
(
!
itemDragger
.
_preventCoordinateBindingLoop
&&
itemDrag
.
drag
.
active
)
{
var
point
=
Qt
.
point
(
itemDragger
.
x
+
_touchMarginHorizontal
+
itemIndicator
.
anchorPoint
.
x
,
itemDragger
.
y
+
_touchMarginVertical
+
itemIndicator
.
anchorPoint
.
y
)
var
coordinate
=
map
.
toCoordinate
(
point
)
var
coordinate
=
map
.
toCoordinate
(
point
,
false
/* clipToViewPort */
)
itemDragger
.
_preventCoordinateBindingLoop
=
true
coordinate
.
altitude
=
itemCoordinate
.
altitude
itemCoordinate
=
coordinate
...
...
src/FlightMap/MapItems/PolygonEditor.qml
View file @
48370879
...
...
@@ -231,7 +231,7 @@ Item {
}
}
var
clickCoordinate
=
map
.
toCoordinate
(
Qt
.
point
(
mouse
.
x
,
mouse
.
y
))
var
clickCoordinate
=
map
.
toCoordinate
(
Qt
.
point
(
mouse
.
x
,
mouse
.
y
)
,
false
/* clipToViewPort */
)
var
polygonPath
=
_newPolygon
.
path
if
(
polygonPath
.
length
==
0
)
{
// Add first coordinate
...
...
@@ -275,7 +275,7 @@ Item {
return
}
if
(
_newPolygon
.
path
.
length
)
{
var
dragCoordinate
=
map
.
toCoordinate
(
Qt
.
point
(
mouse
.
x
,
mouse
.
y
))
var
dragCoordinate
=
map
.
toCoordinate
(
Qt
.
point
(
mouse
.
x
,
mouse
.
y
)
,
false
/* clipToViewPort */
)
var
polygonPath
=
_newPolygon
.
path
if
(
justClicked
){
// Add new drag coordinate
...
...
src/FlightMap/MapScale.qml
View file @
48370879
...
...
@@ -111,8 +111,8 @@ Item {
function
calculateScale
()
{
var
scaleLinePixelLength
=
100
var
leftCoord
=
mapControl
.
toCoordinate
(
Qt
.
point
(
0
,
scale
.
y
))
var
rightCoord
=
mapControl
.
toCoordinate
(
Qt
.
point
(
scaleLinePixelLength
,
scale
.
y
))
var
leftCoord
=
mapControl
.
toCoordinate
(
Qt
.
point
(
0
,
scale
.
y
)
,
false
/* clipToViewPort */
)
var
rightCoord
=
mapControl
.
toCoordinate
(
Qt
.
point
(
scaleLinePixelLength
,
scale
.
y
)
,
false
/* clipToViewPort */
)
var
scaleLineMeters
=
Math
.
round
(
leftCoord
.
distanceTo
(
rightCoord
))
if
(
QGroundControl
.
settingsManager
.
unitsSettings
.
distanceUnits
.
value
==
UnitsSettings
.
DistanceUnitsFeet
)
{
...
...
src/MissionEditor/FWLandingPatternMapVisual.qml
View file @
48370879
...
...
@@ -147,7 +147,7 @@ Item {
anchors.fill
:
map
onClicked
:
{
var
coordinate
=
map
.
toCoordinate
(
Qt
.
point
(
mouse
.
x
,
mouse
.
y
))
var
coordinate
=
map
.
toCoordinate
(
Qt
.
point
(
mouse
.
x
,
mouse
.
y
)
,
false
/* clipToViewPort */
)
coordinate
.
latitude
=
coordinate
.
latitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
longitude
=
coordinate
.
longitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
altitude
=
coordinate
.
altitude
.
toFixed
(
_decimalPlaces
)
...
...
src/MissionEditor/MissionEditor.qml
View file @
48370879
...
...
@@ -382,7 +382,7 @@ QGCView {
return
}
var
coordinate
=
editorMap
.
toCoordinate
(
Qt
.
point
(
mouse
.
x
,
mouse
.
y
))
var
coordinate
=
editorMap
.
toCoordinate
(
Qt
.
point
(
mouse
.
x
,
mouse
.
y
)
,
false
/* clipToViewPort */
)
coordinate
.
latitude
=
coordinate
.
latitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
longitude
=
coordinate
.
longitude
.
toFixed
(
_decimalPlaces
)
coordinate
.
altitude
=
coordinate
.
altitude
.
toFixed
(
_decimalPlaces
)
...
...
@@ -429,7 +429,7 @@ QGCView {
function
liveDrag
()
{
if
(
!
itemDragger
.
preventCoordinateBindingLoop
&&
Drag
.
active
)
{
var
point
=
Qt
.
point
(
itemDragger
.
x
+
(
itemDragger
.
width
/
2
),
itemDragger
.
y
+
(
itemDragger
.
height
/
2
))
var
coordinate
=
editorMap
.
toCoordinate
(
point
)
var
coordinate
=
editorMap
.
toCoordinate
(
point
,
false
/* clipToViewPort */
)
coordinate
.
altitude
=
itemDragger
.
coordinateItem
.
coordinate
.
altitude
itemDragger
.
preventCoordinateBindingLoop
=
true
itemDragger
.
coordinateItem
.
coordinate
=
coordinate
...
...
src/MissionEditor/SurveyItemEditor.qml
View file @
48370879
...
...
@@ -48,12 +48,15 @@ Rectangle {
break
;
}
}
missionItem
.
cameraOrientationFixed
=
false
if
(
index
==
-
1
)
{
gridTypeCombo
.
currentIndex
=
_gridTypeManual
}
else
{
var
listIndex
=
index
-
_gridTypeCamera
gridTypeCombo
.
currentIndex
=
index
missionItem
.
cameraOrientationFixed
=
_vehicleCameraList
[
listIndex
].
fixedOrientation
if
(
index
!=
1
)
{
// Specific camera is selected
missionItem
.
cameraOrientationFixed
=
_vehicleCameraList
[
index
-
_gridTypeCamera
].
fixedOrientation
}
}
}
}
...
...
@@ -228,7 +231,7 @@ Rectangle {
QGCRadioButton
{
width
:
_editFieldWidth
text
:
"
Landscape
"
checked
:
missionItem
.
cameraOrientationLandscape
.
value
==
1
checked
:
!!
missionItem
.
cameraOrientationLandscape
.
value
exclusiveGroup
:
cameraOrientationGroup
onClicked
:
missionItem
.
cameraOrientationLandscape
.
value
=
1
}
...
...
@@ -236,7 +239,7 @@ Rectangle {
QGCRadioButton
{
id
:
cameraOrientationPortrait
text
:
"
Portrait
"
checked
:
missionItem
.
cameraOrientationLandscape
.
value
==
0
checked
:
!
missionItem
.
cameraOrientationLandscape
.
value
exclusiveGroup
:
cameraOrientationGroup
onClicked
:
missionItem
.
cameraOrientationLandscape
.
value
=
0
}
...
...
@@ -372,7 +375,7 @@ Rectangle {
QGCRadioButton
{
id
:
fixedAltitudeRadio
text
:
qsTr
(
"
Altitude
"
)
checked
:
missionItem
.
fixedValueIsAltitude
.
value
checked
:
!!
missionItem
.
fixedValueIsAltitude
.
value
exclusiveGroup
:
fixedValueGroup
onClicked
:
missionItem
.
fixedValueIsAltitude
.
value
=
1
}
...
...
src/MissionEditor/SurveyMapVisual.qml
View file @
48370879
...
...
@@ -81,10 +81,10 @@ Item {
var
topRight
=
Qt
.
point
(
rect
.
x
+
rect
.
width
,
rect
.
y
)
var
bottomLeft
=
Qt
.
point
(
rect
.
x
,
rect
.
y
+
rect
.
height
)
var
bottomRight
=
Qt
.
point
(
rect
.
x
+
rect
.
width
,
rect
.
y
+
rect
.
height
)
_missionItem
.
addPolygonCoordinate
(
map
.
toCoordinate
(
topLeft
))
_missionItem
.
addPolygonCoordinate
(
map
.
toCoordinate
(
topRight
))
_missionItem
.
addPolygonCoordinate
(
map
.
toCoordinate
(
bottomRight
))
_missionItem
.
addPolygonCoordinate
(
map
.
toCoordinate
(
bottomLeft
))
_missionItem
.
addPolygonCoordinate
(
map
.
toCoordinate
(
topLeft
,
false
/* clipToViewPort */
))
_missionItem
.
addPolygonCoordinate
(
map
.
toCoordinate
(
topRight
,
false
/* clipToViewPort */
))
_missionItem
.
addPolygonCoordinate
(
map
.
toCoordinate
(
bottomRight
,
false
/* clipToViewPort */
))
_missionItem
.
addPolygonCoordinate
(
map
.
toCoordinate
(
bottomLeft
,
false
/* clipToViewPort */
))
}
}
...
...
src/MissionManager/SurveyMissionItem.cc
View file @
48370879
...
...
@@ -108,15 +108,16 @@ SurveyMissionItem::SurveyMissionItem(Vehicle* vehicle, QObject* parent)
connect
(
&
_cameraTriggerDistanceFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_generateGrid
);
connect
(
&
_gridAltitudeFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_updateCoordinateAltitude
);
// Signal to Qml when camera value changes to it can recalc
connect
(
&
_groundResolutionFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraValueChanged
);
connect
(
&
_frontalOverlapFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraValueChanged
);
connect
(
&
_sideOverlapFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraValueChanged
);
connect
(
&
_cameraSensorWidthFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraValueChanged
);
connect
(
&
_cameraSensorHeightFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraValueChanged
);
connect
(
&
_cameraResolutionWidthFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraValueChanged
);
connect
(
&
_cameraResolutionHeightFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraValueChanged
);
connect
(
&
_cameraFocalLengthFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraValueChanged
);
// Signal to Qml when camera value changes so it can recalc
connect
(
&
_groundResolutionFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraValueChanged
);
connect
(
&
_frontalOverlapFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraValueChanged
);
connect
(
&
_sideOverlapFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraValueChanged
);
connect
(
&
_cameraSensorWidthFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraValueChanged
);
connect
(
&
_cameraSensorHeightFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraValueChanged
);
connect
(
&
_cameraResolutionWidthFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraValueChanged
);
connect
(
&
_cameraResolutionHeightFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraValueChanged
);
connect
(
&
_cameraFocalLengthFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraValueChanged
);
connect
(
&
_cameraOrientationLandscapeFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraValueChanged
);
connect
(
&
_cameraTriggerFact
,
&
Fact
::
valueChanged
,
this
,
&
SurveyMissionItem
::
_cameraTriggerChanged
);
...
...
src/QtLocationPlugin/QMLControl/OfflineMap.qml
View file @
48370879
...
...
@@ -55,7 +55,7 @@ QGCView {
Component.onCompleted
:
{
QGroundControl
.
mapEngineManager
.
loadTileSets
()
updateMap
()
savedCenter
=
_map
.
toCoordinate
(
Qt
.
point
(
_map
.
width
/
2
,
_map
.
height
/
2
))
savedCenter
=
_map
.
toCoordinate
(
Qt
.
point
(
_map
.
width
/
2
,
_map
.
height
/
2
)
,
false
/* clipToViewPort */
)
}
Connections
{
...
...
@@ -76,8 +76,8 @@ QGCView {
var
yl
=
0
var
xr
=
_map
.
width
.
toFixed
(
0
)
-
1
// Must be within boundaries of visible map
var
yr
=
_map
.
height
.
toFixed
(
0
)
-
1
// Must be within boundaries of visible map
var
c0
=
_map
.
toCoordinate
(
Qt
.
point
(
xl
,
yl
))
var
c1
=
_map
.
toCoordinate
(
Qt
.
point
(
xr
,
yr
))
var
c0
=
_map
.
toCoordinate
(
Qt
.
point
(
xl
,
yl
)
,
false
/* clipToViewPort */
)
var
c1
=
_map
.
toCoordinate
(
Qt
.
point
(
xr
,
yr
)
,
false
/* clipToViewPort */
)
QGroundControl
.
mapEngineManager
.
updateForCurrentView
(
c0
.
longitude
,
c0
.
latitude
,
c1
.
longitude
,
c1
.
latitude
,
sliderMinZoom
.
value
,
sliderMaxZoom
.
value
,
mapType
)
}
}
...
...
@@ -142,7 +142,7 @@ QGCView {
function
enterInfoView
()
{
_map
.
visible
=
true
isMapInteractive
=
false
savedCenter
=
_map
.
toCoordinate
(
Qt
.
point
(
_map
.
width
/
2
,
_map
.
height
/
2
))
savedCenter
=
_map
.
toCoordinate
(
Qt
.
point
(
_map
.
width
/
2
,
_map
.
height
/
2
)
,
false
/* clipToViewPort */
)
savedZoom
=
_map
.
zoomLevel
savedMapType
=
mapType
if
(
!
offlineMapView
.
_currentSelection
.
defaultSet
)
{
...
...
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