7import QGroundControl.Controls
8import QGroundControl.FactControls
10// Editor for Fixed Wing Landing Pattern complex mission item
13 height: visible ? ((editorColumn.visible ? editorColumn.height : editorColumnNeedLandingPoint.height) + (_margin * 2)) : 0
15 color: qgcPal.windowShadeDark
18 // The following properties must be available up the hierarchy chain
19 //property real availableWidth ///< Width for control
20 //property var missionItem ///< Mission Item for editor
22 property var _masterControler: masterController
23 property var _missionController: _masterControler.missionController
24 property var _missionVehicle: _masterControler.controllerVehicle
25 property real _margin: ScreenTools.defaultFontPixelWidth / 2
26 property real _spacer: ScreenTools.defaultFontPixelWidth / 2
27 property string _setToVehicleHeadingStr: qsTr("Set to vehicle heading")
28 property string _setToVehicleLocationStr: qsTr("Set to vehicle location")
29 property int _altitudeMode: missionItem.altitudesAreRelative ? QGroundControl.AltitudeModeRelative : QGroundControl.AltitudeModeAbsolute
34 anchors.margins: _margin
35 anchors.left: parent.left
36 anchors.right: parent.right
38 visible: !editorColumnNeedLandingPoint.visible
41 id: finalApproachSection
42 anchors.left: parent.left
43 anchors.right: parent.right
44 text: qsTr("Final approach")
48 anchors.left: parent.left
49 anchors.right: parent.right
51 visible: finalApproachSection.checked
53 Item { width: 1; height: _spacer }
56 text: qsTr("Use loiter to altitude")
57 fact: missionItem.useLoiterToAlt
61 anchors.left: parent.left
62 anchors.right: parent.right
65 QGCLabel { text: qsTr("Altitude") }
67 AltitudeFactTextField {
68 Layout.fillWidth: true
69 fact: missionItem.finalApproachAltitude
70 altitudeMode: _altitudeMode
74 id: flightSpeedCheckbox
75 text: qsTr("Flight Speed")
76 fact: missionItem.useDoChangeSpeed
80 Layout.fillWidth: true
81 fact: missionItem.finalApproachSpeed
82 enabled: flightSpeedCheckbox.checked
87 visible: missionItem.useLoiterToAlt.rawValue
91 Layout.fillWidth: true
92 fact: missionItem.loiterRadius
93 visible: missionItem.useLoiterToAlt.rawValue
97 Item { width: 1; height: _spacer }
100 text: qsTr("Loiter clockwise")
101 fact: missionItem.loiterClockwise
102 visible: missionItem.useLoiterToAlt.rawValue
106 text: _setToVehicleHeadingStr
107 visible: globals.activeVehicle
108 onClicked: missionItem.landingHeading.rawValue = globals.activeVehicle.heading.rawValue
113 id: landingPointSection
114 anchors.left: parent.left
115 anchors.right: parent.right
116 text: qsTr("Landing point")
120 anchors.left: parent.left
121 anchors.right: parent.right
123 visible: landingPointSection.checked
125 Item { width: 1; height: _spacer }
128 anchors.left: parent.left
129 anchors.right: parent.right
132 QGCLabel { text: qsTr("Heading") }
135 Layout.fillWidth: true
136 fact: missionItem.landingHeading
139 QGCLabel { text: qsTr("Altitude") }
141 AltitudeFactTextField {
142 Layout.fillWidth: true
143 fact: missionItem.landingAltitude
144 altitudeMode: _altitudeMode
148 id: specifyLandingDistance
149 text: qsTr("Distance")
150 checked: missionItem.valueSetIsDistance.rawValue
151 onClicked: missionItem.valueSetIsDistance.rawValue = checked
152 Layout.fillWidth: true
156 fact: missionItem.landingDistance
157 enabled: specifyLandingDistance.checked
158 Layout.fillWidth: true
162 id: specifyGlideSlope
163 text: qsTr("Glide Slope")
164 checked: !missionItem.valueSetIsDistance.rawValue
165 onClicked: missionItem.valueSetIsDistance.rawValue = !checked
166 Layout.fillWidth: true
170 fact: missionItem.glideSlope
171 enabled: specifyGlideSlope.checked
172 Layout.fillWidth: true
176 text: _setToVehicleLocationStr
177 visible: globals.activeVehicle
179 onClicked: missionItem.landingCoordinate = globals.activeVehicle.coordinate
184 Item { width: 1; height: _spacer }
187 anchors.right: parent.right
188 text: qsTr("Altitudes relative to launch")
189 checked: missionItem.altitudesAreRelative
190 visible: QGroundControl.corePlugin.options.showMissionAbsoluteAltitude || !missionItem.altitudesAreRelative
191 onClicked: missionItem.altitudesAreRelative = checked
196 anchors.left: parent.left
197 anchors.right: parent.right
202 anchors.left: parent.left
203 anchors.right: parent.right
205 visible: cameraSection.checked
207 Item { width: 1; height: _spacer }
210 text: _stopTakingPhotos.shortDescription
211 fact: _stopTakingPhotos
213 property Fact _stopTakingPhotos: missionItem.stopTakingPhotos
217 text: _stopTakingVideo.shortDescription
218 fact: _stopTakingVideo
220 property Fact _stopTakingVideo: missionItem.stopTakingVideo
225 anchors.left: parent.left
226 anchors.right: parent.right
230 anchors.left: parent.left
231 anchors.right: parent.right
232 wrapMode: Text.WordWrap
233 color: qgcPal.warningText
234 font.pointSize: ScreenTools.smallFontPointSize
235 text: qsTr("* Approximate glide slope altitudes.")
239 anchors.left: parent.left
240 anchors.right: parent.right
241 wrapMode: Text.WordWrap
242 color: qgcPal.warningText
243 font.pointSize: ScreenTools.smallFontPointSize
244 text: qsTr("* Actual flight path will vary.")
248 anchors.left: parent.left
249 anchors.right: parent.right
250 wrapMode: Text.WordWrap
251 color: qgcPal.warningText
252 font.pointSize: ScreenTools.smallFontPointSize
253 text: qsTr("* Avoid tailwind on landing.")
259 id: editorColumnNeedLandingPoint
260 anchors.margins: _margin
261 anchors.top: parent.top
262 anchors.left: parent.left
263 anchors.right: parent.right
264 visible: !missionItem.landingCoordSet || missionItem.wizardMode
265 spacing: ScreenTools.defaultFontPixelHeight
268 id: landingCoordColumn
269 anchors.left: parent.left
270 anchors.right: parent.right
271 spacing: ScreenTools.defaultFontPixelHeight
272 visible: !missionItem.landingCoordSet
275 anchors.left: parent.left
276 anchors.right: parent.right
277 wrapMode: Text.WordWrap
278 horizontalAlignment: Text.AlignHCenter
279 text: qsTr("Click in map to set landing point.")
283 anchors.left: parent.left
284 anchors.right: parent.right
285 horizontalAlignment: Text.AlignHCenter
287 visible: globals.activeVehicle
291 anchors.horizontalCenter: parent.horizontalCenter
292 text: _setToVehicleLocationStr
293 visible: globals.activeVehicle
296 missionItem.landingCoordinate = globals.activeVehicle.coordinate
297 missionItem.landingHeading.rawValue = globals.activeVehicle.heading.rawValue
298 missionItem.setLandingHeadingToTakeoffHeading()
304 anchors.left: parent.left
305 anchors.right: parent.right
306 spacing: ScreenTools.defaultFontPixelHeight / 2
307 visible: !landingCoordColumn.visible
311 console.log(missionItem.landingDistance.rawValue)
316 Layout.fillWidth: true
317 wrapMode: Text.WordWrap
318 text: qsTr("Drag the loiter point to adjust landing direction for wind and obstacles.")
322 text: qsTr("Loiter clockwise")
323 fact: missionItem.loiterClockwise
324 visible: missionItem.useLoiterToAlt.rawValue
329 Layout.fillWidth: true
331 missionItem.wizardMode = false
332 missionItem.landingDragAngleOnly = false