6import QGroundControl.Controls
7import QGroundControl.FactControls
10 Layout.fillWidth: true
11 heading: qsTr("Return to Launch")
12 visible: activeVehicle.multiRotor
14 property var activeVehicle: QGroundControl.multiVehicleManager.activeVehicle
15 property Fact rtlAltFact: controller.getParameterFact(-1, "RTL_ALT_M")
16 // RTL_ALT_M (4.7+) is in meters, RTL_ALT (pre-4.7) is in centimeters
17 property bool _rtlAltIsMeters: controller.parameterExists(-1, "noremap.RTL_ALT_M")
19 FactPanelController { id: controller }
22 Layout.fillWidth: true
23 spacing: ScreenTools.defaultFontPixelWidth * 2
27 Layout.fillWidth: true
28 text: qsTr("Return At")
34 model: [ qsTr("Current altitude"), qsTr("Specified altitude") ]
36 function setCurrentIndex() {
37 if (rtlAltFact.value === 0) {
38 returnAtCombo.currentIndex = 0
40 returnAtCombo.currentIndex = 1
44 Component.onCompleted: setCurrentIndex()
46 onActivated: (index) => {
48 rtlAltFact.rawValue = 0
50 // RTL_ALT_M (4.7+) is in meters, RTL_ALT (pre-4.7) is in centimeters
51 rtlAltFact.rawValue = _rtlAltIsMeters ? 15 : 1500
57 onRawValueChanged: returnAtCombo.setCurrentIndex()
63 enabled: rtlAltFact.rawValue !== 0