PowerComponent.qml 3.79 KB
Newer Older
dogmaphobic's avatar
dogmaphobic committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
/*=====================================================================

 QGroundControl Open Source Ground Control Station

 (c) 2009 - 2015 QGROUNDCONTROL PROJECT <http://www.qgroundcontrol.org>

 This file is part of the QGROUNDCONTROL project

 QGROUNDCONTROL is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
 the Free Software Foundation, either version 3 of the License, or
 (at your option) any later version.

 QGROUNDCONTROL is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 GNU General Public License for more details.

 You should have received a copy of the GNU General Public License
 along with QGROUNDCONTROL. If not, see <http://www.gnu.org/licenses/>.

 ======================================================================*/

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

import QtQuick 2.2
import QtQuick.Controls 1.2
import QtQuick.Controls.Styles 1.2

import QGroundControl.FactSystem 1.0
import QGroundControl.FactControls 1.0
import QGroundControl.Palette 1.0
import QGroundControl.Controls 1.0
36
import QGroundControl.ScreenTools 1.0
dogmaphobic's avatar
dogmaphobic committed
37 38 39 40 41 42 43 44 45

Rectangle {
    QGCPalette { id: palette; colorGroupEnabled: true }

    width:  600
    height: 600
    color:  palette.window

    property int firstColumnWidth: 220
46
    property ScreenTools __screenTools: ScreenTools { }
dogmaphobic's avatar
dogmaphobic committed
47 48 49 50 51 52 53

    Column {
        anchors.fill: parent
        spacing: 10

        QGCLabel {
            text: "POWER CONFIG"
54
            font.pointSize: 20 * __screenTools.dpiFactor;
dogmaphobic's avatar
dogmaphobic committed
55 56 57 58 59 60 61
        }

        Item { height: 1; width: 10 }

        QGCLabel {
            text: "Battery"
            color: palette.text
62
            font.pointSize: 20 * __screenTools.dpiFactor;
dogmaphobic's avatar
dogmaphobic committed
63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118
        }

        Rectangle {
            width: parent.width
            height: 160
            color: palette.windowShade

            Column {
                id: batteryColumn
                spacing: 10
                anchors.verticalCenter: parent.verticalCenter
                x: (parent.x + 20)

                Row {
                    spacing: 10
                    QGCLabel { text: "Number of Cells"; width: firstColumnWidth; anchors.baseline: cellsField.baseline}
                    FactTextField {
                        id: cellsField
                        fact: Fact { name: "BAT_N_CELLS" }
                        showUnits: true
                    }
                }

                Row {
                    spacing: 10
                    QGCLabel { text: "Full Voltage (per cell)"; width: firstColumnWidth; anchors.baseline: battHighField.baseline}
                    FactTextField {
                        id: battHighField
                        fact: Fact { name: "BAT_V_CHARGED" }
                        showUnits: true
                    }
                }

                Row {
                    spacing: 10
                    QGCLabel { text: "Empty Voltage (per cell)"; width: firstColumnWidth; anchors.baseline: battLowField.baseline}
                    FactTextField {
                        id: battLowField
                        fact: Fact { name: "BAT_V_EMPTY" }
                        showUnits: true
                    }
                }

                Row {
                    spacing: 10
                    QGCLabel { text: "Voltage Drop on Full Load (per cell)"; width: firstColumnWidth; anchors.baseline: battDropField.baseline}
                    FactTextField {
                        id: battDropField
                        fact: Fact { name: "BAT_V_LOAD_DROP" }
                        showUnits: true
                    }
                }
            }
        }
    }
}