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
ed9e7e27
Commit
ed9e7e27
authored
Jun 15, 2020
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
parent
7146e5fe
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
44 deletions
+46
-44
SurveyItemEditor.qml
src/PlanView/SurveyItemEditor.qml
+46
-44
No files found.
src/PlanView/SurveyItemEditor.qml
View file @
ed9e7e27
...
@@ -27,23 +27,24 @@ Rectangle {
...
@@ -27,23 +27,24 @@ Rectangle {
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
property
real
_margin
:
ScreenTools
.
defaultFontPixelWidth
/
2
property
real
_fieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
10.5
property
real
_fieldWidth
:
ScreenTools
.
defaultFontPixelWidth
*
10.5
property
var
_vehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
?
QGroundControl
.
multiVehicleManager
.
activeVehicle
:
QGroundControl
.
multiVehicleManager
.
offlineEditingVehicle
property
var
_vehicle
:
QGroundControl
.
multiVehicleManager
.
activeVehicle
?
QGroundControl
.
multiVehicleManager
.
activeVehicle
:
QGroundControl
.
multiVehicleManager
.
offlineEditingVehicle
property
real
_cameraMinTriggerInterval
:
missionItem
.
cameraCalc
.
minTriggerInterval
.
rawValue
property
real
_cameraMinTriggerInterval
:
_
missionItem
.
cameraCalc
.
minTriggerInterval
.
rawValue
property
bool
_polygonDone
:
false
property
bool
_polygonDone
:
false
property
string
_doneAdjusting
:
qsTr
(
"
Done
"
)
property
string
_doneAdjusting
:
qsTr
(
"
Done
"
)
property
bool
_presetsAvailable
:
missionItem
.
presetNames
.
length
!==
0
property
var
_missionItem
:
missionItem
property
bool
_presetsAvailable
:
_missionItem
.
presetNames
.
length
!==
0
function
polygonCaptureStarted
()
{
function
polygonCaptureStarted
()
{
missionItem
.
clearPolygon
()
_
missionItem
.
clearPolygon
()
}
}
function
polygonCaptureFinished
(
coordinates
)
{
function
polygonCaptureFinished
(
coordinates
)
{
for
(
var
i
=
0
;
i
<
coordinates
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
coordinates
.
length
;
i
++
)
{
missionItem
.
addPolygonCoordinate
(
coordinates
[
i
])
_
missionItem
.
addPolygonCoordinate
(
coordinates
[
i
])
}
}
}
}
function
polygonAdjustVertex
(
vertexIndex
,
vertexCoordinate
)
{
function
polygonAdjustVertex
(
vertexIndex
,
vertexCoordinate
)
{
missionItem
.
adjustPolygonCoordinate
(
vertexIndex
,
vertexCoordinate
)
_
missionItem
.
adjustPolygonCoordinate
(
vertexIndex
,
vertexCoordinate
)
}
}
function
polygonAdjustStarted
()
{
}
function
polygonAdjustStarted
()
{
}
...
@@ -63,7 +64,7 @@ Rectangle {
...
@@ -63,7 +64,7 @@ Rectangle {
anchors.left
:
parent
.
left
anchors.left
:
parent
.
left
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
spacing
:
_margin
spacing
:
_margin
visible
:
!
missionItem
.
surveyAreaPolygon
.
isValid
||
missionItem
.
wizardMode
visible
:
!
_missionItem
.
surveyAreaPolygon
.
isValid
||
_
missionItem
.
wizardMode
ColumnLayout
{
ColumnLayout
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
...
@@ -104,16 +105,16 @@ Rectangle {
...
@@ -104,16 +105,16 @@ Rectangle {
text
:
qsTr
(
"
WARNING: Photo interval is below minimum interval (%1 secs) supported by camera.
"
).
arg
(
_cameraMinTriggerInterval
.
toFixed
(
1
))
text
:
qsTr
(
"
WARNING: Photo interval is below minimum interval (%1 secs) supported by camera.
"
).
arg
(
_cameraMinTriggerInterval
.
toFixed
(
1
))
wrapMode
:
Text
.
WordWrap
wrapMode
:
Text
.
WordWrap
color
:
qgcPal
.
warningText
color
:
qgcPal
.
warningText
visible
:
missionItem
.
cameraShots
>
0
&&
_cameraMinTriggerInterval
!==
0
&&
_cameraMinTriggerInterval
>
missionItem
.
timeBetweenShots
visible
:
_missionItem
.
cameraShots
>
0
&&
_cameraMinTriggerInterval
!==
0
&&
_cameraMinTriggerInterval
>
_
missionItem
.
timeBetweenShots
}
}
CameraCalcGrid
{
CameraCalcGrid
{
cameraCalc
:
missionItem
.
cameraCalc
cameraCalc
:
_
missionItem
.
cameraCalc
vehicleFlightIsFrontal
:
true
vehicleFlightIsFrontal
:
true
distanceToSurfaceLabel
:
qsTr
(
"
Altitude
"
)
distanceToSurfaceLabel
:
qsTr
(
"
Altitude
"
)
distanceToSurfaceAltitudeMode
:
missionItem
.
followTerrain
?
distanceToSurfaceAltitudeMode
:
_
missionItem
.
followTerrain
?
QGroundControl
.
AltitudeModeAboveTerrain
:
QGroundControl
.
AltitudeModeAboveTerrain
:
(
missionItem
.
cameraCalc
.
distanceToSurfaceRelative
?
QGroundControl
.
AltitudeModeRelative
:
QGroundControl
.
AltitudeModeAbsolute
)
(
_
missionItem
.
cameraCalc
.
distanceToSurfaceRelative
?
QGroundControl
.
AltitudeModeRelative
:
QGroundControl
.
AltitudeModeAbsolute
)
frontalDistanceLabel
:
qsTr
(
"
Trigger Dist
"
)
frontalDistanceLabel
:
qsTr
(
"
Trigger Dist
"
)
sideDistanceLabel
:
qsTr
(
"
Spacing
"
)
sideDistanceLabel
:
qsTr
(
"
Spacing
"
)
}
}
...
@@ -135,9 +136,9 @@ Rectangle {
...
@@ -135,9 +136,9 @@ Rectangle {
QGCLabel
{
text
:
qsTr
(
"
Angle
"
)
}
QGCLabel
{
text
:
qsTr
(
"
Angle
"
)
}
FactTextField
{
FactTextField
{
fact
:
missionItem
.
gridAngle
fact
:
_
missionItem
.
gridAngle
Layout.fillWidth
:
true
Layout.fillWidth
:
true
onUpdated
:
angleSlider
.
value
=
missionItem
.
gridAngle
.
value
onUpdated
:
angleSlider
.
value
=
_
missionItem
.
gridAngle
.
value
}
}
QGCSlider
{
QGCSlider
{
...
@@ -149,8 +150,8 @@ Rectangle {
...
@@ -149,8 +150,8 @@ Rectangle {
Layout.fillWidth
:
true
Layout.fillWidth
:
true
Layout.columnSpan
:
2
Layout.columnSpan
:
2
Layout.preferredHeight
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
Layout.preferredHeight
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
onValueChanged
:
missionItem
.
gridAngle
.
value
=
value
onValueChanged
:
_
missionItem
.
gridAngle
.
value
=
value
Component.onCompleted
:
value
=
missionItem
.
gridAngle
.
value
Component.onCompleted
:
value
=
_
missionItem
.
gridAngle
.
value
updateValueWhileDragging
:
true
updateValueWhileDragging
:
true
}
}
...
@@ -158,14 +159,14 @@ Rectangle {
...
@@ -158,14 +159,14 @@ Rectangle {
text
:
qsTr
(
"
Turnaround dist
"
)
text
:
qsTr
(
"
Turnaround dist
"
)
}
}
FactTextField
{
FactTextField
{
fact
:
missionItem
.
turnAroundDistance
fact
:
_
missionItem
.
turnAroundDistance
Layout.fillWidth
:
true
Layout.fillWidth
:
true
}
}
}
}
QGCButton
{
QGCButton
{
text
:
qsTr
(
"
Rotate Entry Point
"
)
text
:
qsTr
(
"
Rotate Entry Point
"
)
onClicked
:
missionItem
.
rotateEntryPoint
();
onClicked
:
_
missionItem
.
rotateEntryPoint
();
}
}
ColumnLayout
{
ColumnLayout
{
...
@@ -180,40 +181,40 @@ Rectangle {
...
@@ -180,40 +181,40 @@ Rectangle {
model
:
[
model
:
[
{
{
text
:
qsTr
(
"
Hover and capture image
"
),
text
:
qsTr
(
"
Hover and capture image
"
),
fact
:
missionItem
.
hoverAndCapture
,
fact
:
_
missionItem
.
hoverAndCapture
,
enabled
:
!
missionItem
.
followTerrain
,
enabled
:
!
_
missionItem
.
followTerrain
,
visible
:
missionItem
.
hoverAndCaptureAllowed
visible
:
_
missionItem
.
hoverAndCaptureAllowed
},
},
{
{
text
:
qsTr
(
"
Refly at 90 deg offset
"
),
text
:
qsTr
(
"
Refly at 90 deg offset
"
),
fact
:
missionItem
.
refly90Degrees
,
fact
:
_
missionItem
.
refly90Degrees
,
enabled
:
!
missionItem
.
followTerrain
,
enabled
:
!
_
missionItem
.
followTerrain
,
visible
:
true
visible
:
true
},
},
{
{
text
:
qsTr
(
"
Images in turnarounds
"
),
text
:
qsTr
(
"
Images in turnarounds
"
),
fact
:
missionItem
.
cameraTriggerInTurnAround
,
fact
:
_
missionItem
.
cameraTriggerInTurnAround
,
enabled
:
missionItem
.
hoverAndCaptureAllowed
?
!
missionItem
.
hoverAndCapture
.
rawValue
:
true
,
enabled
:
_missionItem
.
hoverAndCaptureAllowed
?
!
_
missionItem
.
hoverAndCapture
.
rawValue
:
true
,
visible
:
true
visible
:
true
},
},
{
{
text
:
qsTr
(
"
Fly alternate transects
"
),
text
:
qsTr
(
"
Fly alternate transects
"
),
fact
:
missionItem
.
flyAlternateTransects
,
fact
:
_
missionItem
.
flyAlternateTransects
,
enabled
:
true
,
enabled
:
true
,
visible
:
_vehicle
?
(
_vehicle
.
fixedWing
||
_vehicle
.
vtol
)
:
false
visible
:
_vehicle
?
(
_vehicle
.
fixedWing
||
_vehicle
.
vtol
)
:
false
},
},
{
{
text
:
qsTr
(
"
Relative altitude
"
),
text
:
qsTr
(
"
Relative altitude
"
),
enabled
:
missionItem
.
cameraCalc
.
isManualCamera
&&
!
missionItem
.
followTerrain
,
enabled
:
_missionItem
.
cameraCalc
.
isManualCamera
&&
!
_
missionItem
.
followTerrain
,
visible
:
QGroundControl
.
corePlugin
.
options
.
showMissionAbsoluteAltitude
||
(
!
missionItem
.
cameraCalc
.
distanceToSurfaceRelative
&&
!
missionItem
.
followTerrain
),
visible
:
QGroundControl
.
corePlugin
.
options
.
showMissionAbsoluteAltitude
||
(
!
_missionItem
.
cameraCalc
.
distanceToSurfaceRelative
&&
!
_
missionItem
.
followTerrain
),
checked
:
missionItem
.
cameraCalc
.
distanceToSurfaceRelative
checked
:
_
missionItem
.
cameraCalc
.
distanceToSurfaceRelative
}
}
]
]
onItemClicked
:
{
onItemClicked
:
{
if
(
index
==
4
)
{
if
(
index
==
4
)
{
missionItem
.
cameraCalc
.
distanceToSurfaceRelative
=
!
missionItem
.
cameraCalc
.
distanceToSurfaceRelative
_missionItem
.
cameraCalc
.
distanceToSurfaceRelative
=
!
_
missionItem
.
cameraCalc
.
distanceToSurfaceRelative
console
.
log
(
missionItem
.
cameraCalc
.
distanceToSurfaceRelative
)
console
.
log
(
_
missionItem
.
cameraCalc
.
distanceToSurfaceRelative
)
}
}
}
}
}
}
...
@@ -241,7 +242,7 @@ Rectangle {
...
@@ -241,7 +242,7 @@ Rectangle {
visible
:
tabBar
.
currentIndex
===
1
visible
:
tabBar
.
currentIndex
===
1
CameraCalcCamera
{
CameraCalcCamera
{
cameraCalc
:
missionItem
.
cameraCalc
cameraCalc
:
_
missionItem
.
cameraCalc
}
}
}
// Camera Column
}
// Camera Column
...
@@ -251,6 +252,7 @@ Rectangle {
...
@@ -251,6 +252,7 @@ Rectangle {
anchors.right
:
parent
.
right
anchors.right
:
parent
.
right
spacing
:
_margin
spacing
:
_margin
visible
:
tabBar
.
currentIndex
===
2
visible
:
tabBar
.
currentIndex
===
2
missionItem
:
_missionItem
}
}
// Presets Tab
// Presets Tab
...
@@ -269,7 +271,7 @@ Rectangle {
...
@@ -269,7 +271,7 @@ Rectangle {
QGCComboBox
{
QGCComboBox
{
id
:
presetCombo
id
:
presetCombo
Layout.fillWidth
:
true
Layout.fillWidth
:
true
model
:
missionItem
.
presetNames
model
:
_
missionItem
.
presetNames
}
}
RowLayout
{
RowLayout
{
...
@@ -278,14 +280,14 @@ Rectangle {
...
@@ -278,14 +280,14 @@ Rectangle {
QGCButton
{
QGCButton
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
text
:
qsTr
(
"
Apply Preset
"
)
text
:
qsTr
(
"
Apply Preset
"
)
enabled
:
missionItem
.
presetNames
.
length
!=
0
enabled
:
_
missionItem
.
presetNames
.
length
!=
0
onClicked
:
missionItem
.
loadPreset
(
presetCombo
.
textAt
(
presetCombo
.
currentIndex
))
onClicked
:
_
missionItem
.
loadPreset
(
presetCombo
.
textAt
(
presetCombo
.
currentIndex
))
}
}
QGCButton
{
QGCButton
{
Layout.fillWidth
:
true
Layout.fillWidth
:
true
text
:
qsTr
(
"
Delete Preset
"
)
text
:
qsTr
(
"
Delete Preset
"
)
enabled
:
missionItem
.
presetNames
.
length
!=
0
enabled
:
_
missionItem
.
presetNames
.
length
!=
0
onClicked
:
mainWindow
.
showComponentDialog
(
deletePresetMessage
,
qsTr
(
"
Delete Preset
"
),
mainWindow
.
showDialogDefaultWidth
,
StandardButton
.
Yes
|
StandardButton
.
No
)
onClicked
:
mainWindow
.
showComponentDialog
(
deletePresetMessage
,
qsTr
(
"
Delete Preset
"
),
mainWindow
.
showDialogDefaultWidth
,
StandardButton
.
Yes
|
StandardButton
.
No
)
Component
{
Component
{
...
@@ -294,7 +296,7 @@ Rectangle {
...
@@ -294,7 +296,7 @@ Rectangle {
message
:
qsTr
(
"
Are you sure you want to delete '%1' preset?
"
).
arg
(
presetName
)
message
:
qsTr
(
"
Are you sure you want to delete '%1' preset?
"
).
arg
(
presetName
)
property
string
presetName
:
presetCombo
.
textAt
(
presetCombo
.
currentIndex
)
property
string
presetName
:
presetCombo
.
textAt
(
presetCombo
.
currentIndex
)
function
accept
()
{
function
accept
()
{
missionItem
.
deletePreset
(
presetName
)
_
missionItem
.
deletePreset
(
presetName
)
hideDialog
()
hideDialog
()
}
}
}
}
...
@@ -326,9 +328,9 @@ Rectangle {
...
@@ -326,9 +328,9 @@ Rectangle {
QGCLabel
{
text
:
qsTr
(
"
Angle
"
)
}
QGCLabel
{
text
:
qsTr
(
"
Angle
"
)
}
FactTextField
{
FactTextField
{
fact
:
missionItem
.
gridAngle
fact
:
_
missionItem
.
gridAngle
Layout.fillWidth
:
true
Layout.fillWidth
:
true
onUpdated
:
presetsAngleSlider
.
value
=
missionItem
.
gridAngle
.
value
onUpdated
:
presetsAngleSlider
.
value
=
_
missionItem
.
gridAngle
.
value
}
}
QGCSlider
{
QGCSlider
{
...
@@ -340,8 +342,8 @@ Rectangle {
...
@@ -340,8 +342,8 @@ Rectangle {
Layout.fillWidth
:
true
Layout.fillWidth
:
true
Layout.columnSpan
:
2
Layout.columnSpan
:
2
Layout.preferredHeight
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
Layout.preferredHeight
:
ScreenTools
.
defaultFontPixelHeight
*
1.5
onValueChanged
:
missionItem
.
gridAngle
.
value
=
value
onValueChanged
:
_
missionItem
.
gridAngle
.
value
=
value
Component.onCompleted
:
value
=
missionItem
.
gridAngle
.
value
Component.onCompleted
:
value
=
_
missionItem
.
gridAngle
.
value
updateValueWhileDragging
:
true
updateValueWhileDragging
:
true
}
}
...
@@ -349,7 +351,7 @@ Rectangle {
...
@@ -349,7 +351,7 @@ Rectangle {
Layout.columnSpan
:
2
Layout.columnSpan
:
2
Layout.fillWidth
:
true
Layout.fillWidth
:
true
text
:
qsTr
(
"
Rotate Entry Point
"
)
text
:
qsTr
(
"
Rotate Entry Point
"
)
onClicked
:
missionItem
.
rotateEntryPoint
();
onClicked
:
_
missionItem
.
rotateEntryPoint
();
}
}
}
}
...
@@ -372,7 +374,7 @@ Rectangle {
...
@@ -372,7 +374,7 @@ Rectangle {
QGCViewDialog
{
QGCViewDialog
{
function
accept
()
{
function
accept
()
{
if
(
presetNameField
.
text
!=
""
)
{
if
(
presetNameField
.
text
!=
""
)
{
missionItem
.
savePreset
(
presetNameField
.
text
)
_
missionItem
.
savePreset
(
presetNameField
.
text
)
hideDialog
()
hideDialog
()
}
}
}
}
...
@@ -407,9 +409,9 @@ Rectangle {
...
@@ -407,9 +409,9 @@ Rectangle {
selectExisting
:
true
selectExisting
:
true
onAcceptedForLoad
:
{
onAcceptedForLoad
:
{
missionItem
.
surveyAreaPolygon
.
loadKMLOrSHPFile
(
file
)
_
missionItem
.
surveyAreaPolygon
.
loadKMLOrSHPFile
(
file
)
missionItem
.
resetState
=
false
_
missionItem
.
resetState
=
false
//editorMap.mapFitFunctions.fitMapViewportTo
M
issionItems()
//editorMap.mapFitFunctions.fitMapViewportTo
_m
issionItems()
close
()
close
()
}
}
}
}
...
...
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