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