QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
APMAirspeedComponentSummary.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 id: root
11
12 implicitWidth: mainLayout.implicitWidth
13 implicitHeight: mainLayout.implicitHeight
14 width: parent.width
15
16 readonly property bool _arspdTypeAvailable: controller.parameterExists(-1, "ARSPD_TYPE")
17 readonly property Fact _arspdType: _arspdTypeAvailable ? controller.getParameterFact(-1, "ARSPD_TYPE") : null
18 readonly property bool _sensorEnabled: _arspdTypeAvailable && _arspdType.rawValue !== 0
19 readonly property bool _arspdUseAvailable: controller.parameterExists(-1, "ARSPD_USE")
20 readonly property Fact _arspdUse: _arspdUseAvailable ? controller.getParameterFact(-1, "ARSPD_USE") : null
21 readonly property bool _arspd2TypeAvailable: controller.parameterExists(-1, "ARSPD2_TYPE")
22 readonly property Fact _arspd2Type: _arspd2TypeAvailable ? controller.getParameterFact(-1, "ARSPD2_TYPE") : null
23 readonly property bool _cruiseAvailable: controller.parameterExists(-1, "AIRSPEED_CRUISE")
24 readonly property Fact _cruise: _cruiseAvailable ? controller.getParameterFact(-1, "AIRSPEED_CRUISE") : null
25
26 FactPanelController { id: controller }
27
28 ColumnLayout {
29 id: mainLayout
30
31 spacing: 0
32
33 VehicleSummaryRow {
34 labelText: qsTr("Sensor type")
35 valueText: _arspdTypeAvailable ? _arspdType.enumStringValue : qsTr("N/A")
36 }
37
38 VehicleSummaryRow {
39 labelText: qsTr("Use airspeed")
40 valueText: _arspdUseAvailable ? _arspdUse.enumStringValue : qsTr("N/A")
41 visible: _sensorEnabled
42 }
43
44 VehicleSummaryRow {
45 labelText: qsTr("Sensor 2 type")
46 valueText: _arspd2TypeAvailable ? _arspd2Type.enumStringValue : qsTr("N/A")
47 visible: _arspd2TypeAvailable
48 }
49
50 VehicleSummaryRow {
51 labelText: qsTr("Cruise airspeed")
52 valueText: _cruiseAvailable ? _cruise.valueString + " " + _cruise.units : qsTr("N/A")
53 visible: _sensorEnabled && _cruiseAvailable
54 }
55 }
56}