QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
APMPowerComponentSummary.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 property Fact _batt1Monitor: controller.getParameterFact(-1, "BATT_MONITOR")
14 property Fact _batt2Monitor: controller.getParameterFact(-1, "BATT2_MONITOR", false /* reportMissing */)
15 property bool _batt2MonitorAvailable: controller.parameterExists(-1, "BATT2_MONITOR")
16 property bool _batt1MonitorEnabled: _batt1Monitor.rawValue !== 0
17 property bool _batt2MonitorEnabled: _batt2MonitorAvailable && _batt2Monitor.rawValue !== 0
18 property Fact _battCapacity: controller.getParameterFact(-1, "BATT_CAPACITY", false /* reportMissing */)
19 property Fact _batt2Capacity: controller.getParameterFact(-1, "BATT2_CAPACITY", false /* reportMissing */)
20 property bool _battCapacityAvailable: controller.parameterExists(-1, "BATT_CAPACITY")
21
22 Column {
23 anchors.fill: parent
24
25 VehicleSummaryRow {
26 labelText: qsTr("Batt1 monitor")
27 valueText: _batt1Monitor.enumStringValue
28 }
29
30 VehicleSummaryRow {
31 labelText: qsTr("Batt1 capacity")
32 valueText: _batt1MonitorEnabled ? _battCapacity.valueString + " " + _battCapacity.units : ""
33 visible: _batt1MonitorEnabled
34 }
35
36 VehicleSummaryRow {
37 labelText: qsTr("Batt2 monitor")
38 valueText: _batt2MonitorAvailable ? _batt2Monitor.enumStringValue : ""
39 visible: _batt2MonitorAvailable
40 }
41
42 VehicleSummaryRow {
43 labelText: qsTr("Batt2 capacity")
44 valueText: _batt2MonitorEnabled ? _batt2Capacity.valueString + " " + _batt2Capacity.units : ""
45 visible: _batt2MonitorEnabled
46 }
47 }
48}