QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
StructureScanEditor.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
11// Editor for Survery mission items
12Rectangle {
13 id: _root
14 height: visible ? (editorColumn.height + (_margin * 2)) : 0
15 width: availableWidth
16 color: qgcPal.windowShadeDark
17 radius: _radius
18
19 // The following properties must be available up the hierarchy chain
20 //property real availableWidth ///< Width for control
21 //property var missionItem ///< Mission Item for editor
22
23 property real _margin: ScreenTools.defaultFontPixelWidth / 2
24 property real _fieldWidth: ScreenTools.defaultFontPixelWidth * 10.5
25 property var _vehicle: QGroundControl.multiVehicleManager.activeVehicle ? QGroundControl.multiVehicleManager.activeVehicle : QGroundControl.multiVehicleManager.offlineEditingVehicle
26 property real _cameraMinTriggerInterval: missionItem.cameraCalc.minTriggerInterval.rawValue
27
28 function polygonCaptureStarted() {
29 missionItem.clearPolygon()
30 }
31
32 function polygonCaptureFinished(coordinates) {
33 for (var i=0; i<coordinates.length; i++) {
34 missionItem.addPolygonCoordinate(coordinates[i])
35 }
36 }
37
38 function polygonAdjustVertex(vertexIndex, vertexCoordinate) {
39 missionItem.adjustPolygonCoordinate(vertexIndex, vertexCoordinate)
40 }
41
42 function polygonAdjustStarted() { }
43 function polygonAdjustFinished() { }
44
45 QGCPalette { id: qgcPal; colorGroupEnabled: true }
46
47 ColumnLayout {
48 id: editorColumn
49 anchors.margins: _margin
50 anchors.top: parent.top
51 anchors.left: parent.left
52 anchors.right: parent.right
53
54 QGCLabel {
55 id: wizardLabel
56 Layout.fillWidth: true
57 wrapMode: Text.WordWrap
58 horizontalAlignment: Text.AlignHCenter
59 text: qsTr("Use the Polygon Tools to create the polygon which outlines the structure.")
60 visible: !missionItem.structurePolygon.isValid || missionItem.wizardMode
61 }
62
63 ColumnLayout {
64 Layout.fillWidth: true
65 spacing: _margin
66 visible: !wizardLabel.visible
67
68 QGCTabBar {
69 id: tabBar
70 Layout.fillWidth: true
71
72 Component.onCompleted: currentIndex = 0
73
74 QGCTabButton { text: qsTr("Grid") }
75 QGCTabButton { text: qsTr("Camera") }
76 }
77
78 ColumnLayout {
79 Layout.fillWidth: true
80 spacing: _margin
81 visible: tabBar.currentIndex == 0
82
83 QGCLabel {
84 Layout.fillWidth: true
85 text: qsTr("Note: Polygon respresents structure surface not vehicle flight path.")
86 wrapMode: Text.WordWrap
87 font.pointSize: ScreenTools.smallFontPointSize
88 }
89
90 QGCLabel {
91 Layout.fillWidth: true
92 text: qsTr("WARNING: Photo interval is below minimum interval (%1 secs) supported by camera.").arg(_cameraMinTriggerInterval.toFixed(1))
93 wrapMode: Text.WordWrap
94 color: qgcPal.warningText
95 visible: missionItem.cameraShots > 0 && _cameraMinTriggerInterval !== 0 && _cameraMinTriggerInterval > missionItem.timeBetweenShots
96 }
97
98 CameraCalcGrid {
99 Layout.fillWidth: true
100 cameraCalc: missionItem.cameraCalc
101 vehicleFlightIsFrontal: false
102 distanceToSurfaceLabel: qsTr("Scan Distance")
103 frontalDistanceLabel: qsTr("Layer Height")
104 sideDistanceLabel: qsTr("Trigger Distance")
105 }
106
107 SectionHeader {
108 id: scanHeader
109 Layout.fillWidth: true
110 text: qsTr("Scan")
111 }
112
113 ColumnLayout {
114 Layout.fillWidth: true
115 spacing: _margin
116 visible: scanHeader.checked
117
118 GridLayout {
119 Layout.fillWidth: true
120 columnSpacing: _margin
121 rowSpacing: _margin
122 columns: 2
123
124 FactComboBox {
125 fact: missionItem.startFromTop
126 indexModel: true
127 model: [ qsTr("Start Scan From Bottom"), qsTr("Start Scan From Top") ]
128 Layout.columnSpan: 2
129 Layout.fillWidth: true
130 }
131
132 QGCLabel {
133 text: qsTr("Structure Height")
134 }
135 FactTextField {
136 fact: missionItem.structureHeight
137 Layout.fillWidth: true
138 }
139
140 QGCLabel { text: qsTr("Scan Bottom Alt") }
141 AltitudeFactTextField {
142 fact: missionItem.scanBottomAlt
143 altitudeMode: QGroundControl.AltitudeModeRelative
144 Layout.fillWidth: true
145 }
146
147 QGCLabel { text: qsTr("Entrance/Exit Alt") }
148 AltitudeFactTextField {
149 fact: missionItem.entranceAlt
150 altitudeMode: QGroundControl.AltitudeModeRelative
151 Layout.fillWidth: true
152 }
153
154 QGCLabel {
155 text: qsTr("Gimbal Pitch")
156 visible: missionItem.cameraCalc.isManualCamera
157 }
158 FactTextField {
159 fact: missionItem.gimbalPitch
160 Layout.fillWidth: true
161 visible: missionItem.cameraCalc.isManualCamera
162 }
163 }
164
165 Item {
166 height: ScreenTools.defaultFontPixelHeight / 2
167 width: 1
168 }
169
170 QGCButton {
171 text: qsTr("Rotate entry point")
172 onClicked: missionItem.rotateEntryPoint()
173 }
174 } // Column - Scan
175
176 SectionHeader {
177 id: statsHeader
178 Layout.fillWidth: true
179 text: qsTr("Statistics")
180 }
181
182 Grid {
183 columns: 2
184 columnSpacing: ScreenTools.defaultFontPixelWidth
185 visible: statsHeader.checked
186
187 QGCLabel { text: qsTr("Layers") }
188 QGCLabel { text: missionItem.layers.valueString }
189
190 QGCLabel { text: qsTr("Layer Height") }
191 QGCLabel { text: missionItem.cameraCalc.adjustedFootprintFrontal.valueString + " " + QGroundControl.unitsConversion.appSettingsHorizontalDistanceUnitsString }
192
193 QGCLabel { text: qsTr("Top Layer Alt") }
194 QGCLabel { text: QGroundControl.unitsConversion.metersToAppSettingsVerticalDistanceUnits(missionItem.topFlightAlt).toFixed(1) + " " + QGroundControl.unitsConversion.appSettingsHorizontalDistanceUnitsString }
195
196 QGCLabel { text: qsTr("Bottom Layer Alt") }
197 QGCLabel { text: QGroundControl.unitsConversion.metersToAppSettingsVerticalDistanceUnits(missionItem.bottomFlightAlt).toFixed(1) + " " + QGroundControl.unitsConversion.appSettingsHorizontalDistanceUnitsString }
198
199 QGCLabel { text: qsTr("Photo Count") }
200 QGCLabel { text: missionItem.cameraShots }
201
202 QGCLabel { text: qsTr("Photo Interval") }
203 QGCLabel { text: missionItem.timeBetweenShots.toFixed(1) + " " + qsTr("secs") }
204
205 QGCLabel { text: qsTr("Trigger Distance") }
206 QGCLabel { text: missionItem.cameraCalc.adjustedFootprintSide.valueString + " " + QGroundControl.unitsConversion.appSettingsHorizontalDistanceUnitsString }
207 }
208 } // Grid Column
209
210 ColumnLayout {
211 Layout.fillWidth: true
212 spacing: _margin
213 visible: tabBar.currentIndex == 1
214
215 CameraCalcCamera {
216 Layout.fillWidth: true
217 cameraCalc: missionItem.cameraCalc
218 }
219 }
220 }
221 }
222}