PowerComponentSummary.qml 1.7 KB
Newer Older
1 2 3 4 5 6 7 8
/****************************************************************************
 *
 *   (c) 2009-2016 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>
 *
 * 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 13 14


/// @file
///     @brief Battery, propeller and magnetometer summary
///     @author Gus Grubba <mavlink@grubba.com>

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
FactPanel {
24 25 26
    id:             panel
    anchors.fill:   parent
    color:          qgcPal.windowShadeDark
dogmaphobic's avatar
dogmaphobic committed
27

Don Gagne's avatar
Don Gagne committed
28 29 30 31 32 33
    QGCPalette { id: qgcPal; colorGroupEnabled: enabled }
    FactPanelController { id: controller; factPanel: panel }

    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
34

35 36
    Column {
        anchors.fill:       parent
dogmaphobic's avatar
dogmaphobic committed
37

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

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

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