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 // The following properties must be available up the hierarchy chain
19 // property real availableWidth ///< Width for control
20 // property var missionItem ///< Mission Item for editor
21
22 property real _margin: ScreenTools.defaultFontPixelWidth / 2
23 property var _missionItem: missionItem
24
25 Component {
26 id: _transectValuesComponent
27
28 GridLayout {
29 Layout.fillWidth: true
30 columnSpacing: _margin
31 rowSpacing: _margin
32 columns: 2
33
34 QGCLabel { text: qsTr("Angle") }
35 FactTextField {
36 fact: missionItem.gridAngle
37 Layout.fillWidth: true
38 onUpdated: angleSlider.value = missionItem.gridAngle.value
39 }
40
41 QGCSlider {
42 id: angleSlider
43 from: 0
44 to: 359
45 stepSize: 1
46 Layout.fillWidth: true
47 Layout.columnSpan: 2
48 Layout.preferredHeight: ScreenTools.defaultFontPixelHeight * 1.5
49 onValueChanged: missionItem.gridAngle.value = value
50 Component.onCompleted: value = missionItem.gridAngle.value
51 live: true
52 }
53
54 QGCLabel {
55 text: qsTr("Turnaround dist")
56 visible: !forPresets
57 }
58 FactTextField {
59 Layout.fillWidth: true
60 fact: missionItem.turnAroundDistance
61 visible: !forPresets
62 }
63
64 QGCOptionsComboBox {
65 Layout.columnSpan: 2
66 Layout.fillWidth: true
67 visible: !forPresets
68
69 model: [
70 {
71 text: qsTr("Hover and capture image"),
72 fact: missionItem.hoverAndCapture,
73 enabled: missionItem.cameraCalc.distanceMode === QGroundControl.AltitudeModeRelative || missionItem.cameraCalc.distanceMode === QGroundControl.AltitudeModeAbsolute,
74 visible: missionItem.hoverAndCaptureAllowed
75 },
76 {
77 text: qsTr("Refly at 90 deg offset"),
78 fact: missionItem.refly90Degrees,
79 enabled: missionItem.cameraCalc.distanceMode !== QGroundControl.AltitudeModeCalcAboveTerrain,
80 visible: true
81 },
82 {
83 text: qsTr("Images in turnarounds"),
84 fact: missionItem.cameraTriggerInTurnAround,
85 enabled: missionItem.hoverAndCaptureAllowed ? !missionItem.hoverAndCapture.rawValue : true,
86 visible: true
87 },
88 {
89 text: qsTr("Fly alternate transects"),
90 fact: missionItem.flyAlternateTransects,
91 enabled: true,
92 visible: _vehicle ? (_vehicle.fixedWing || _vehicle.vtol) : false
93 }
94 ]
95 }
96 }
97 }
98
99 KMLOrSHPFileDialog {
100 id: kmlOrSHPLoadDialog
101 title: qsTr("Select Polygon File")
102
103 onAcceptedForLoad: (file) => {
104 missionItem.surveyAreaPolygon.loadKMLOrSHPFile(file)
105 missionItem.resetState = false
106 //editorMap.mapFitFunctions.fitMapViewportTomissionItems()
107 close()
108 }
109 }
110}