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 required property var missionItem
19 required property real availableWidth
21 property var _masterControler: missionItem.masterController
22 property var _missionController: _masterControler.missionController
23 property var _missionVehicle: _masterControler.controllerVehicle
24 property real _margin: ScreenTools.defaultFontPixelWidth / 2
25 property real _spacer: ScreenTools.defaultFontPixelWidth / 2
26 property string _setToVehicleHeadingStr: qsTr("Set to vehicle heading")
27 property string _setToVehicleLocationStr: qsTr("Set to vehicle location")
28 property int _altitudeFrame: missionItem.altitudesAreRelative ? QGroundControl.AltitudeFrameRelative : QGroundControl.AltitudeFrameAbsolute
33 anchors.margins: _margin
34 anchors.left: parent.left
35 anchors.right: parent.right
37 visible: !editorColumnNeedLandingPoint.visible
40 id: finalApproachSection
41 anchors.left: parent.left
42 anchors.right: parent.right
43 text: qsTr("Final approach")
47 anchors.left: parent.left
48 anchors.right: parent.right
50 visible: finalApproachSection.checked
52 Item { width: 1; height: _spacer }
55 text: qsTr("Use loiter to altitude")
56 fact: missionItem.useLoiterToAlt
60 anchors.left: parent.left
61 anchors.right: parent.right
64 QGCLabel { text: qsTr("Altitude") }
66 AltitudeFactTextField {
67 Layout.fillWidth: true
68 fact: missionItem.finalApproachAltitude
69 altitudeFrame: _altitudeFrame
73 id: flightSpeedCheckbox
74 text: qsTr("Flight Speed")
75 fact: missionItem.useDoChangeSpeed
79 Layout.fillWidth: true
80 fact: missionItem.finalApproachSpeed
81 enabled: flightSpeedCheckbox.checked
86 visible: missionItem.useLoiterToAlt.rawValue
90 Layout.fillWidth: true
91 fact: missionItem.loiterRadius
92 visible: missionItem.useLoiterToAlt.rawValue
96 Item { width: 1; height: _spacer }
99 text: qsTr("Loiter clockwise")
100 fact: missionItem.loiterClockwise
101 visible: missionItem.useLoiterToAlt.rawValue
105 text: _setToVehicleHeadingStr
106 visible: globals.activeVehicle
107 onClicked: missionItem.landingHeading.rawValue = globals.activeVehicle.heading.rawValue
112 id: landingPointSection
113 anchors.left: parent.left
114 anchors.right: parent.right
115 text: qsTr("Landing point")
119 anchors.left: parent.left
120 anchors.right: parent.right
122 visible: landingPointSection.checked
124 Item { width: 1; height: _spacer }
127 anchors.left: parent.left
128 anchors.right: parent.right
131 QGCLabel { text: qsTr("Heading") }
134 Layout.fillWidth: true
135 fact: missionItem.landingHeading
138 QGCLabel { text: qsTr("Altitude") }
140 AltitudeFactTextField {
141 Layout.fillWidth: true
142 fact: missionItem.landingAltitude
143 altitudeFrame: _altitudeFrame
147 id: specifyLandingDistance
148 text: qsTr("Distance")
149 checked: missionItem.valueSetIsDistance.rawValue
150 onClicked: missionItem.valueSetIsDistance.rawValue = checked
151 Layout.fillWidth: true
155 fact: missionItem.landingDistance
156 enabled: specifyLandingDistance.checked
157 Layout.fillWidth: true
161 id: specifyGlideSlope
162 text: qsTr("Glide Slope")
163 checked: !missionItem.valueSetIsDistance.rawValue
164 onClicked: missionItem.valueSetIsDistance.rawValue = !checked
165 Layout.fillWidth: true
169 fact: missionItem.glideSlope
170 enabled: specifyGlideSlope.checked
171 Layout.fillWidth: true
175 text: _setToVehicleLocationStr
176 visible: globals.activeVehicle
178 onClicked: missionItem.landingCoordinate = globals.activeVehicle.coordinate
183 Item { width: 1; height: _spacer }
186 anchors.right: parent.right
187 text: qsTr("Altitudes relative to launch")
188 checked: missionItem.altitudesAreRelative
189 visible: QGroundControl.corePlugin.options.showMissionAbsoluteAltitude || !missionItem.altitudesAreRelative
190 onClicked: missionItem.altitudesAreRelative = checked
195 anchors.left: parent.left
196 anchors.right: parent.right
201 anchors.left: parent.left
202 anchors.right: parent.right
204 visible: cameraSection.checked
206 Item { width: 1; height: _spacer }
209 text: _stopTakingPhotos.shortDescription
210 fact: _stopTakingPhotos
212 property Fact _stopTakingPhotos: missionItem.stopTakingPhotos
216 text: _stopTakingVideo.shortDescription
217 fact: _stopTakingVideo
219 property Fact _stopTakingVideo: missionItem.stopTakingVideo
224 anchors.left: parent.left
225 anchors.right: parent.right
229 anchors.left: parent.left
230 anchors.right: parent.right
231 wrapMode: Text.WordWrap
232 color: qgcPal.warningText
233 font.pointSize: ScreenTools.smallFontPointSize
234 text: qsTr("* Approximate glide slope altitudes.")
238 anchors.left: parent.left
239 anchors.right: parent.right
240 wrapMode: Text.WordWrap
241 color: qgcPal.warningText
242 font.pointSize: ScreenTools.smallFontPointSize
243 text: qsTr("* Actual flight path will vary.")
247 anchors.left: parent.left
248 anchors.right: parent.right
249 wrapMode: Text.WordWrap
250 color: qgcPal.warningText
251 font.pointSize: ScreenTools.smallFontPointSize
252 text: qsTr("* Avoid tailwind on landing.")
258 id: editorColumnNeedLandingPoint
259 anchors.margins: _margin
260 anchors.top: parent.top
261 anchors.left: parent.left
262 anchors.right: parent.right
263 visible: !missionItem.landingCoordSet || missionItem.wizardMode
264 spacing: ScreenTools.defaultFontPixelHeight
267 id: landingCoordColumn
268 anchors.left: parent.left
269 anchors.right: parent.right
270 spacing: ScreenTools.defaultFontPixelHeight
271 visible: !missionItem.landingCoordSet
274 anchors.left: parent.left
275 anchors.right: parent.right
276 wrapMode: Text.WordWrap
277 horizontalAlignment: Text.AlignHCenter
278 text: qsTr("Click in map to set landing point.")
282 anchors.left: parent.left
283 anchors.right: parent.right
284 horizontalAlignment: Text.AlignHCenter
286 visible: globals.activeVehicle
290 anchors.horizontalCenter: parent.horizontalCenter
291 text: _setToVehicleLocationStr
292 visible: globals.activeVehicle
295 missionItem.landingCoordinate = globals.activeVehicle.coordinate
296 missionItem.landingHeading.rawValue = globals.activeVehicle.heading.rawValue
297 missionItem.setLandingHeadingToTakeoffHeading()
303 anchors.left: parent.left
304 anchors.right: parent.right
305 spacing: ScreenTools.defaultFontPixelHeight / 2
306 visible: !landingCoordColumn.visible
310 console.log(missionItem.landingDistance.rawValue)
315 Layout.fillWidth: true
316 wrapMode: Text.WordWrap
317 text: qsTr("Drag the loiter point to adjust landing direction for wind and obstacles.")
321 text: qsTr("Loiter clockwise")
322 fact: missionItem.loiterClockwise
323 visible: missionItem.useLoiterToAlt.rawValue
328 Layout.fillWidth: true
330 missionItem.wizardMode = false
331 missionItem.landingDragAngleOnly = false