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
3
4import QGroundControl
5import QGroundControl.FactControls
6import QGroundControl.Controls
7
8Item {
9 anchors.fill: parent
10
11 FactPanelController { id: controller }
12
13 function getFact(name) {
14 return controller.getParameterFact(-1, name, false)
15 }
16
17 property bool followParamsAvailable: controller.parameterExists(-1, "FOLL_SYSID")
18
19 property var followItems: [
20 { label: qsTr("Follow Enabled"), fact: getFact("FOLL_ENABLE"), visible: true},
21 { label: qsTr("Follow System ID"), fact: getFact("FOLL_SYSID"), visible: followParamsAvailable },
22 { label: qsTr("Max Distance"), fact: getFact("FOLL_DIST_MAX"), visible: followParamsAvailable },
23 { label: qsTr("Offset X"), fact: getFact("FOLL_OFS_X"), visible: followParamsAvailable },
24 { label: qsTr("Offset Y"), fact: getFact("FOLL_OFS_Y"), visible: followParamsAvailable },
25 { label: qsTr("Offset Z"), fact: getFact("FOLL_OFS_Z"), visible: followParamsAvailable },
26 { label: qsTr("Offset Type"), fact: getFact("FOLL_OFS_TYPE"), visible: followParamsAvailable },
27 { label: qsTr("Altitude Type"), fact: getFact("FOLL_ALT_TYPE"), visible: followParamsAvailable },
28 { label: qsTr("Yaw Behavior"), fact: getFact("FOLL_YAW_BEHAVE"), visible: followParamsAvailable }
29 ]
30
31 Column {
32 anchors.fill: parent
33
34 Repeater {
35 model: followItems
36 delegate: VehicleSummaryRow {
37 labelText: modelData.label
38 valueText: formatFact(modelData.fact)
39 visible: modelData.visible
40
41 function formatFact(fact) {
42 return (fact && (fact.enumStringValue || (fact.valueString + " " + fact.units)))
43 }
44 }
45 }
46 }
47}