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