QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
SurveyItemEditor.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Dialogs
4import QtQuick.Layouts
5
6import QGroundControl
7import QGroundControl.Controls
8import QGroundControl.FactControls
9import QGroundControl.FlightMap
10
11TransectStyleComplexItemEditor {
12 transectAreaDefinitionComplete: missionItem.surveyAreaPolygon.isValid
13 transectAreaDefinitionHelp: qsTr("Use the Polygon Tools to create the polygon which outlines your survey area.")
14 transectValuesHeaderName: qsTr("Transects")
15 transectValuesComponent: _transectValuesComponent
16 presetsTransectValuesComponent: _transectValuesComponent
17
18 property real _margin: ScreenTools.defaultFontPixelWidth / 2
19 property var _missionItem: missionItem
20
21 Component {
22 id: _transectValuesComponent
23
24 GridLayout {
25 Layout.fillWidth: true
26 columnSpacing: _margin
27 rowSpacing: _margin
28 columns: 2
29
30 QGCLabel { text: qsTr("Angle") }
31 FactTextField {
32 fact: missionItem.gridAngle
33 Layout.fillWidth: true
34 onUpdated: angleSlider.value = missionItem.gridAngle.value
35 }
36
37 QGCSlider {
38 id: angleSlider
39 from: 0
40 to: 359
41 stepSize: 1
42 Layout.fillWidth: true
43 Layout.columnSpan: 2
44 Layout.preferredHeight: ScreenTools.defaultFontPixelHeight * 1.5
45 onValueChanged: missionItem.gridAngle.value = value
46 Component.onCompleted: value = missionItem.gridAngle.value
47 live: true
48 }
49
50 QGCLabel {
51 text: qsTr("Turnaround dist")
52 visible: !forPresets
53 }
54 FactTextField {
55 Layout.fillWidth: true
56 fact: missionItem.turnAroundDistance
57 visible: !forPresets
58 }
59
60 QGCOptionsComboBox {
61 Layout.columnSpan: 2
62 Layout.fillWidth: true
63 visible: !forPresets
64
65 model: [
66 {
67 text: qsTr("Hover and capture image"),
68 fact: missionItem.hoverAndCapture,
69 enabled: missionItem.cameraCalc.distanceMode === QGroundControl.AltitudeFrameRelative || missionItem.cameraCalc.distanceMode === QGroundControl.AltitudeFrameAbsolute,
70 visible: missionItem.hoverAndCaptureAllowed
71 },
72 {
73 text: qsTr("Refly at 90 deg offset"),
74 fact: missionItem.refly90Degrees,
75 enabled: missionItem.cameraCalc.distanceMode !== QGroundControl.AltitudeFrameCalcAboveTerrain,
76 visible: true
77 },
78 {
79 text: qsTr("Images in turnarounds"),
80 fact: missionItem.cameraTriggerInTurnAround,
81 enabled: missionItem.hoverAndCaptureAllowed ? !missionItem.hoverAndCapture.rawValue : true,
82 visible: true
83 },
84 {
85 text: qsTr("Fly alternate transects"),
86 fact: missionItem.flyAlternateTransects,
87 enabled: true,
88 visible: _vehicle ? (_vehicle.fixedWing || _vehicle.vtol) : false
89 },
90 {
91 text: qsTr("Split concave polygons"),
92 fact: missionItem.splitConcavePolygons,
93 enabled: true,
94 visible: true
95 }
96 ]
97 }
98
99 QGCLabel {
100 Layout.columnSpan: 2
101 Layout.fillWidth: true
102 wrapMode: Text.WordWrap
103 font.pointSize: ScreenTools.smallFontPointSize
104 text: qsTr("Images are also taken across concave gaps when images in turnarounds is enabled.")
105 visible: !forPresets && missionItem.splitConcavePolygons.rawValue && missionItem.cameraTriggerInTurnAround.rawValue
106 }
107 }
108 }
109
110 KMLOrSHPFileDialog {
111 id: kmlOrSHPLoadDialog
112 title: qsTr("Select Polygon File")
113
114 onAcceptedForLoad: (file) => {
115 missionItem.surveyAreaPolygon.loadKMLOrSHPFile(file)
116 missionItem.resetState = false
117 //editorMap.mapFitFunctions.fitMapViewportTomissionItems()
118 close()
119 }
120 }
121}