PowerComponentSummary.qml 1.6 KB
Newer Older
1 2
/****************************************************************************
 *
3
 * (c) 2009-2020 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
4 5 6 7 8
 *
 * QGroundControl is licensed according to the terms in the file
 * COPYING.md in the root of the source code directory.
 *
 ****************************************************************************/
dogmaphobic's avatar
dogmaphobic committed
9 10 11 12


/// @file
///     @brief Battery, propeller and magnetometer summary
13
///     @author Gus Grubba <gus@auterion.com>
dogmaphobic's avatar
dogmaphobic committed
14

15 16
import QtQuick 2.3
import QtQuick.Controls 1.2
dogmaphobic's avatar
dogmaphobic committed
17

18 19 20 21
import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Controls 1.0
import QGroundControl.Palette 1.0
dogmaphobic's avatar
dogmaphobic committed
22

23
Item {
24
    anchors.fill:   parent
dogmaphobic's avatar
dogmaphobic committed
25

Don Gagne's avatar
Don Gagne committed
26
    QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
27
    FactPanelController { id: controller; }
Don Gagne's avatar
Don Gagne committed
28 29 30 31

    property Fact batVChargedFact:  controller.getParameterFact(-1, "BAT_V_CHARGED")
    property Fact batVEmptyFact:    controller.getParameterFact(-1, "BAT_V_EMPTY")
    property Fact batCellsFact:     controller.getParameterFact(-1, "BAT_N_CELLS")
dogmaphobic's avatar
dogmaphobic committed
32

33 34
    Column {
        anchors.fill:       parent
dogmaphobic's avatar
dogmaphobic committed
35

36
        VehicleSummaryRow {
37
            labelText: qsTr("Battery Full")
Don Gagne's avatar
Don Gagne committed
38
            valueText: batVChargedFact ? batVChargedFact.valueString + " " + batVChargedFact.units : ""
39
        }
40

41
        VehicleSummaryRow {
42
            labelText: qsTr("Battery Empty")
Don Gagne's avatar
Don Gagne committed
43
            valueText: batVEmptyFact ? batVEmptyFact.valueString + " " + batVEmptyFact.units : ""
44
        }
dogmaphobic's avatar
dogmaphobic committed
45

46
        VehicleSummaryRow {
47
            labelText: qsTr("Number of Cells")
dogmaphobic's avatar
dogmaphobic committed
48
            valueText: batCellsFact ? batCellsFact.valueString : ""
49
        }
dogmaphobic's avatar
dogmaphobic committed
50
    }
dogmaphobic's avatar
dogmaphobic committed
51
}