7import QGroundControl.Controls
8import QGroundControl.FactControls
9import QGroundControl.FlightMap
11// Editor for Survery mission items
14 height: visible ? (editorColumn.height + (_margin * 2)) : 0
16 color: qgcPal.windowShadeDark
19 required property var missionItem
20 required property real availableWidth
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
27 function polygonCaptureStarted() {
28 missionItem.clearPolygon()
31 function polygonCaptureFinished(coordinates) {
32 for (var i=0; i<coordinates.length; i++) {
33 missionItem.addPolygonCoordinate(coordinates[i])
37 function polygonAdjustVertex(vertexIndex, vertexCoordinate) {
38 missionItem.adjustPolygonCoordinate(vertexIndex, vertexCoordinate)
41 function polygonAdjustStarted() { }
42 function polygonAdjustFinished() { }
44 function _topLayerAltText() {
45 return QGroundControl.unitsConversion.metersToAppSettingsVerticalDistanceUnitsString(missionItem.topFlightAlt)
48 function _bottomLayerAltText() {
49 return QGroundControl.unitsConversion.metersToAppSettingsVerticalDistanceUnitsString(missionItem.bottomFlightAlt)
52 QGCPalette { id: qgcPal; colorGroupEnabled: true }
56 anchors.margins: _margin
57 anchors.top: parent.top
58 anchors.left: parent.left
59 anchors.right: parent.right
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
71 Layout.fillWidth: true
73 visible: !wizardLabel.visible
77 Layout.fillWidth: true
79 Component.onCompleted: currentIndex = 0
81 QGCTabButton { text: qsTr("Grid") }
82 QGCTabButton { text: qsTr("Camera") }
86 Layout.fillWidth: true
88 visible: tabBar.currentIndex == 0
91 Layout.fillWidth: true
92 text: qsTr("Note: Polygon respresents structure surface not vehicle flight path.")
93 wrapMode: Text.WordWrap
94 font.pointSize: ScreenTools.smallFontPointSize
98 Layout.fillWidth: true
99 text: qsTr("WARNING: Photo interval is below minimum interval (%1 secs) supported by camera.").arg(_cameraMinTriggerInterval.toFixed(1))
100 wrapMode: Text.WordWrap
101 color: qgcPal.warningText
102 visible: missionItem.cameraShots > 0 && _cameraMinTriggerInterval !== 0 && _cameraMinTriggerInterval > missionItem.timeBetweenShots
106 Layout.fillWidth: true
107 cameraCalc: missionItem.cameraCalc
108 vehicleFlightIsFrontal: false
109 distanceToSurfaceLabel: qsTr("Scan Distance")
110 frontalDistanceLabel: qsTr("Layer Height")
111 sideDistanceLabel: qsTr("Trigger Distance")
116 Layout.fillWidth: true
121 Layout.fillWidth: true
123 visible: scanHeader.checked
126 Layout.fillWidth: true
127 columnSpacing: _margin
132 fact: missionItem.startFromTop
134 model: [ qsTr("Start Scan From Bottom"), qsTr("Start Scan From Top") ]
136 Layout.fillWidth: true
140 text: qsTr("Structure Height")
143 fact: missionItem.structureHeight
144 Layout.fillWidth: true
147 QGCLabel { text: qsTr("Scan Bottom Alt") }
148 AltitudeFactTextField {
149 fact: missionItem.scanBottomAlt
150 altitudeFrame: QGroundControl.AltitudeFrameRelative
151 Layout.fillWidth: true
154 QGCLabel { text: qsTr("Entrance/Exit Alt") }
155 AltitudeFactTextField {
156 fact: missionItem.entranceAlt
157 altitudeFrame: QGroundControl.AltitudeFrameRelative
158 Layout.fillWidth: true
162 text: qsTr("Gimbal Pitch")
163 visible: missionItem.cameraCalc.isManualCamera
166 fact: missionItem.gimbalPitch
167 Layout.fillWidth: true
168 visible: missionItem.cameraCalc.isManualCamera
173 height: ScreenTools.defaultFontPixelHeight / 2
178 text: qsTr("Rotate entry point")
179 onClicked: missionItem.rotateEntryPoint()
185 Layout.fillWidth: true
186 text: qsTr("Statistics")
191 columnSpacing: ScreenTools.defaultFontPixelWidth
192 visible: statsHeader.checked
194 QGCLabel { text: qsTr("Layers") }
195 QGCLabel { text: missionItem.layers.valueString }
197 QGCLabel { text: qsTr("Layer Height") }
198 QGCLabel { text: missionItem.cameraCalc.adjustedFootprintFrontal.valueString + " " + QGroundControl.unitsConversion.appSettingsHorizontalDistanceUnitsString }
200 QGCLabel { text: qsTr("Top Layer Alt") }
201 QGCLabel { id: topLayerAltLabel; text: _topLayerAltText() }
203 QGCLabel { text: qsTr("Bottom Layer Alt") }
204 QGCLabel { id: bottomLayerAltLabel; text: _bottomLayerAltText() }
206 QGCLabel { text: qsTr("Photo Count") }
207 QGCLabel { text: missionItem.cameraShots }
209 QGCLabel { text: qsTr("Photo Interval") }
210 QGCLabel { text: missionItem.timeBetweenShots.toFixed(1) + " " + qsTr("secs") }
212 QGCLabel { text: qsTr("Trigger Distance") }
213 QGCLabel { text: missionItem.cameraCalc.adjustedFootprintSide.valueString + " " + QGroundControl.unitsConversion.appSettingsHorizontalDistanceUnitsString }
218 Layout.fillWidth: true
220 visible: tabBar.currentIndex == 1
223 Layout.fillWidth: true
224 cameraCalc: missionItem.cameraCalc
231 target: QGroundControl.unitsConversion
233 function onUnitsChanged() {
234 topLayerAltLabel.text = Qt.binding(_topLayerAltText)
235 bottomLayerAltLabel.text = Qt.binding(_bottomLayerAltText)