QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
APMFollowComponentSummary.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Layouts
4
5import QGroundControl
6import QGroundControl.FactControls
7import QGroundControl.Controls
8
9Item {
10 implicitWidth: mainLayout.implicitWidth
11 implicitHeight: mainLayout.implicitHeight
12 width: parent.width // grows when Loader is wider than implicitWidth
13
14 FactPanelController { id: controller }
15
16 function getFact(name) {
17 return controller.getParameterFact(-1, name, false)
18 }
19
20 property bool followParamsAvailable: controller.parameterExists(-1, "FOLL_SYSID")
21
22 property var followItems: [
23 { label: qsTr("Follow Enabled"), fact: getFact("FOLL_ENABLE"), visible: true},
24 { label: qsTr("Follow System ID"), fact: getFact("FOLL_SYSID"), visible: followParamsAvailable },
25 { label: qsTr("Max Distance"), fact: getFact("FOLL_DIST_MAX"), visible: followParamsAvailable },
26 { label: qsTr("Offset X"), fact: getFact("FOLL_OFS_X"), visible: followParamsAvailable },
27 { label: qsTr("Offset Y"), fact: getFact("FOLL_OFS_Y"), visible: followParamsAvailable },
28 { label: qsTr("Offset Z"), fact: getFact("FOLL_OFS_Z"), visible: followParamsAvailable },
29 { label: qsTr("Offset Type"), fact: getFact("FOLL_OFS_TYPE"), visible: followParamsAvailable },
30 { label: qsTr("Altitude Type"), fact: getFact("FOLL_ALT_TYPE"), visible: followParamsAvailable },
31 { label: qsTr("Yaw Behavior"), fact: getFact("FOLL_YAW_BEHAVE"), visible: followParamsAvailable }
32 ]
33
34 ColumnLayout {
35 id: mainLayout
36 spacing: 0
37
38 Repeater {
39 model: followItems
40 delegate: VehicleSummaryRow {
41 labelText: modelData.label
42 valueText: formatFact(modelData.fact)
43 visible: modelData.visible
44
45 function formatFact(fact) {
46 return (fact && (fact.enumStringValue || (fact.valueString + " " + fact.units)))
47 }
48 }
49 }
50 }
51}