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
75 visible: missionItem.useLoiterToAlt.rawValue
79 Layout.fillWidth: true
80 fact: missionItem.loiterRadius
81 visible: missionItem.useLoiterToAlt.rawValue
85 Item { width: 1; height: _spacer }
88 text: qsTr("Loiter clockwise")
89 fact: missionItem.loiterClockwise
90 visible: missionItem.useLoiterToAlt.rawValue
94 text: _setToVehicleHeadingStr
95 visible: globals.activeVehicle
96 onClicked: missionItem.landingHeading.rawValue = globals.activeVehicle.heading.rawValue
101 id: landingPointSection
102 anchors.left: parent.left
103 anchors.right: parent.right
104 text: qsTr("Landing point")
108 anchors.left: parent.left
109 anchors.right: parent.right
111 visible: landingPointSection.checked
113 Item { width: 1; height: _spacer }
116 anchors.left: parent.left
117 anchors.right: parent.right
120 QGCLabel { text: qsTr("Heading") }
123 Layout.fillWidth: true
124 fact: missionItem.landingHeading
127 QGCLabel { text: qsTr("Altitude") }
129 AltitudeFactTextField {
130 Layout.fillWidth: true
131 fact: missionItem.landingAltitude
132 altitudeMode: _altitudeMode
135 QGCLabel { text: qsTr("Landing Dist") }
138 fact: missionItem.landingDistance
139 Layout.fillWidth: true
143 text: _setToVehicleLocationStr
144 visible: globals.activeVehicle
146 onClicked: missionItem.landingCoordinate = globals.activeVehicle.coordinate
151 Item { width: 1; height: _spacer }
154 anchors.right: parent.right
155 text: qsTr("Altitudes relative to launch")
156 checked: missionItem.altitudesAreRelative
157 visible: QGroundControl.corePlugin.options.showMissionAbsoluteAltitude || !missionItem.altitudesAreRelative
158 onClicked: missionItem.altitudesAreRelative = checked
163 anchors.left: parent.left
164 anchors.right: parent.right
169 anchors.left: parent.left
170 anchors.right: parent.right
172 visible: cameraSection.checked
174 Item { width: 1; height: _spacer }
177 text: _stopTakingPhotos.shortDescription
178 fact: _stopTakingPhotos
180 property Fact _stopTakingPhotos: missionItem.stopTakingPhotos
184 text: _stopTakingVideo.shortDescription
185 fact: _stopTakingVideo
187 property Fact _stopTakingVideo: missionItem.stopTakingVideo
192 anchors.left: parent.left
193 anchors.right: parent.right
197 anchors.left: parent.left
198 anchors.right: parent.right
199 wrapMode: Text.WordWrap
200 color: qgcPal.warningText
201 font.pointSize: ScreenTools.smallFontPointSize
202 text: qsTr("* Actual flight path will vary.")
206 anchors.left: parent.left
207 anchors.right: parent.right
208 wrapMode: Text.WordWrap
209 color: qgcPal.warningText
210 font.pointSize: ScreenTools.smallFontPointSize
211 text: qsTr("* Avoid tailwind on approach to land.")
215 anchors.left: parent.left
216 anchors.right: parent.right
217 wrapMode: Text.WordWrap
218 color: qgcPal.warningText
219 font.pointSize: ScreenTools.smallFontPointSize
220 text: qsTr("* Ensure landing distance is enough to complete transition.")
226 id: editorColumnNeedLandingPoint
227 anchors.margins: _margin
228 anchors.top: parent.top
229 anchors.left: parent.left
230 anchors.right: parent.right
231 visible: !missionItem.landingCoordSet || missionItem.wizardMode
232 spacing: ScreenTools.defaultFontPixelHeight
235 id: landingCoordColumn
236 anchors.left: parent.left
237 anchors.right: parent.right
238 spacing: ScreenTools.defaultFontPixelHeight
239 visible: !missionItem.landingCoordSet
242 anchors.left: parent.left
243 anchors.right: parent.right
244 wrapMode: Text.WordWrap
245 horizontalAlignment: Text.AlignHCenter
246 text: qsTr("Click in map to set landing point.")
250 anchors.left: parent.left
251 anchors.right: parent.right
252 horizontalAlignment: Text.AlignHCenter
254 visible: globals.activeVehicle
258 anchors.horizontalCenter: parent.horizontalCenter
259 text: _setToVehicleLocationStr
260 visible: globals.activeVehicle
263 missionItem.landingCoordinate = globals.activeVehicle.coordinate
264 missionItem.landingHeading.rawValue = globals.activeVehicle.heading.rawValue
265 missionItem.setLandingHeadingToTakeoffHeading()
271 anchors.left: parent.left
272 anchors.right: parent.right
273 spacing: ScreenTools.defaultFontPixelHeight
274 visible: !landingCoordColumn.visible
278 console.log(missionItem.landingDistance.rawValue)
283 Layout.fillWidth: true
284 wrapMode: Text.WordWrap
285 text: qsTr("Drag the loiter point to adjust landing direction for wind and obstacles as well as distance to land point.")
290 Layout.fillWidth: true
292 missionItem.wizardMode = false
293 missionItem.landingDragAngleOnly = false