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
74 visible: missionItem.useLoiterToAlt.rawValue
78 Layout.fillWidth: true
79 fact: missionItem.loiterRadius
80 visible: missionItem.useLoiterToAlt.rawValue
84 Item { width: 1; height: _spacer }
87 text: qsTr("Loiter clockwise")
88 fact: missionItem.loiterClockwise
89 visible: missionItem.useLoiterToAlt.rawValue
93 text: _setToVehicleHeadingStr
94 visible: globals.activeVehicle
95 onClicked: missionItem.landingHeading.rawValue = globals.activeVehicle.heading.rawValue
100 id: landingPointSection
101 anchors.left: parent.left
102 anchors.right: parent.right
103 text: qsTr("Landing point")
107 anchors.left: parent.left
108 anchors.right: parent.right
110 visible: landingPointSection.checked
112 Item { width: 1; height: _spacer }
115 anchors.left: parent.left
116 anchors.right: parent.right
119 QGCLabel { text: qsTr("Heading") }
122 Layout.fillWidth: true
123 fact: missionItem.landingHeading
126 QGCLabel { text: qsTr("Altitude") }
128 AltitudeFactTextField {
129 Layout.fillWidth: true
130 fact: missionItem.landingAltitude
131 altitudeFrame: _altitudeFrame
134 QGCLabel { text: qsTr("Landing Dist") }
137 fact: missionItem.landingDistance
138 Layout.fillWidth: true
142 text: _setToVehicleLocationStr
143 visible: globals.activeVehicle
145 onClicked: missionItem.landingCoordinate = globals.activeVehicle.coordinate
150 Item { width: 1; height: _spacer }
153 anchors.right: parent.right
154 text: qsTr("Altitudes relative to launch")
155 checked: missionItem.altitudesAreRelative
156 visible: QGroundControl.corePlugin.options.showMissionAbsoluteAltitude || !missionItem.altitudesAreRelative
157 onClicked: missionItem.altitudesAreRelative = checked
162 anchors.left: parent.left
163 anchors.right: parent.right
168 anchors.left: parent.left
169 anchors.right: parent.right
171 visible: cameraSection.checked
173 Item { width: 1; height: _spacer }
176 text: _stopTakingPhotos.shortDescription
177 fact: _stopTakingPhotos
179 property Fact _stopTakingPhotos: missionItem.stopTakingPhotos
183 text: _stopTakingVideo.shortDescription
184 fact: _stopTakingVideo
186 property Fact _stopTakingVideo: missionItem.stopTakingVideo
191 anchors.left: parent.left
192 anchors.right: parent.right
196 anchors.left: parent.left
197 anchors.right: parent.right
198 wrapMode: Text.WordWrap
199 color: qgcPal.warningText
200 font.pointSize: ScreenTools.smallFontPointSize
201 text: qsTr("* Actual flight path will vary.")
205 anchors.left: parent.left
206 anchors.right: parent.right
207 wrapMode: Text.WordWrap
208 color: qgcPal.warningText
209 font.pointSize: ScreenTools.smallFontPointSize
210 text: qsTr("* Avoid tailwind on approach to land.")
214 anchors.left: parent.left
215 anchors.right: parent.right
216 wrapMode: Text.WordWrap
217 color: qgcPal.warningText
218 font.pointSize: ScreenTools.smallFontPointSize
219 text: qsTr("* Ensure landing distance is enough to complete transition.")
225 id: editorColumnNeedLandingPoint
226 anchors.margins: _margin
227 anchors.top: parent.top
228 anchors.left: parent.left
229 anchors.right: parent.right
230 visible: !missionItem.landingCoordSet || missionItem.wizardMode
231 spacing: ScreenTools.defaultFontPixelHeight
234 id: landingCoordColumn
235 anchors.left: parent.left
236 anchors.right: parent.right
237 spacing: ScreenTools.defaultFontPixelHeight
238 visible: !missionItem.landingCoordSet
241 anchors.left: parent.left
242 anchors.right: parent.right
243 wrapMode: Text.WordWrap
244 horizontalAlignment: Text.AlignHCenter
245 text: qsTr("Click in map to set landing point.")
249 anchors.left: parent.left
250 anchors.right: parent.right
251 horizontalAlignment: Text.AlignHCenter
253 visible: globals.activeVehicle
257 anchors.horizontalCenter: parent.horizontalCenter
258 text: _setToVehicleLocationStr
259 visible: globals.activeVehicle
262 missionItem.landingCoordinate = globals.activeVehicle.coordinate
263 missionItem.landingHeading.rawValue = globals.activeVehicle.heading.rawValue
264 missionItem.setLandingHeadingToTakeoffHeading()
270 anchors.left: parent.left
271 anchors.right: parent.right
272 spacing: ScreenTools.defaultFontPixelHeight
273 visible: !landingCoordColumn.visible
277 console.log(missionItem.landingDistance.rawValue)
282 Layout.fillWidth: true
283 wrapMode: Text.WordWrap
284 text: qsTr("Drag the loiter point to adjust landing direction for wind and obstacles as well as distance to land point.")
289 Layout.fillWidth: true
291 missionItem.wizardMode = false
292 missionItem.landingDragAngleOnly = false