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 }
92 }
93 }
94
95 KMLOrSHPFileDialog {
96 id: kmlOrSHPLoadDialog
97 title: qsTr("Select Polygon File")
98
99 onAcceptedForLoad: (file) => {
100 missionItem.surveyAreaPolygon.loadKMLOrSHPFile(file)
101 missionItem.resetState = false
102 //editorMap.mapFitFunctions.fitMapViewportTomissionItems()
103 close()
104 }
105 }
106}