QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
PX4ReturnLandComponent.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Layouts
3
4import QGroundControl
5import QGroundControl.Controls
6import QGroundControl.FactControls
7
8import "PX4ConfigRows.js" as ConfigRows
9import "PX4ReturnLandRows.js" as ReturnLandRows
10
11SetupPage {
12 id: returnLandPage
13 pageComponent: pageComponent
14
15 // Parameter values when the page first showed them, so a reboot is only flagged after a change
16 property var _initialValues: Object.create(null)
17
18 readonly property var _vehicle: controller.vehicle
19 readonly property var _rows: ConfigRows.visibleRows(
20 ReturnLandRows.returnLandRows(),
21 {
22 "multiRotor": _vehicle ? _vehicle.multiRotor : false,
23 "fixedWing": _vehicle ? _vehicle.fixedWing : false,
24 "vtol": _vehicle ? _vehicle.vtol : false
25 },
26 function (name) { return controller.parameterExists(-1, name) })
27 readonly property var _groups: ConfigRows.groupRows(_rows)
28
29 function _fact(name) {
30 return controller.getParameterFact(-1, name, false)
31 }
32
33 function _rawValue(name) {
34 const fact = _fact(name)
35 return fact ? fact.rawValue : undefined
36 }
37
38 FactPanelController {
39 id: controller
40 // Reboot-required settings are marked on the page instead
41 suppressRebootMessage: true
42 }
43
44 Component {
45 id: pageComponent
46
47 ColumnLayout {
48 width: Math.max(availableWidth, implicitWidth)
49 spacing: _margins
50
51 ConfigRowsPanel {
52 ConfigRowGroups {
53 model: _groups
54 objectNamePrefix: "returnLand"
55
56 rowDelegate: ConfigRow {
57 id: rowLayout
58 objectName: "returnLand_row_" + row.id
59 title: row.title
60 params: row.params
61 active: true
62 showSeparator: index > 0
63
64 required property var modelData
65 required property int index
66
67 readonly property var row: modelData
68
69 ConfigNote {
70 text: rowLayout.row.description
71 }
72
73 cellsData: Repeater {
74 model: rowLayout.row.cells
75
76 ConfigParamCell {
77 cell: modelData
78 factFor: returnLandPage._fact
79 initialValues: returnLandPage._initialValues
80 objectNamePrefix: "returnLand"
81 enabled: !ReturnLandRows.cellOverridden(modelData, returnLandPage._rawValue)
82
83 required property var modelData
84 }
85 }
86 }
87 }
88 }
89 }
90 }
91}