QGroundControl
Ground Control Station for MAVLink Drones
Loading...
Searching...
No Matches
BatteryParams.qml
Go to the documentation of this file.
1import QtQuick
2import QtQuick.Controls
3import QtQuick.Dialogs
4import QtQuick.Layouts
5
6import QGroundControl
7import QGroundControl.FactControls
8import QGroundControl.Controls
9
10// Exposes the set of battery parameters taking into account the availability of the parameters.
11// Only the _SOURCE parameter can be assumed to be always available. The remainder of the parameters
12// may or may not be available depending on the _SOURCE setting.
13QtObject {
14 property var controller ///< FactPanelController
15 property int batteryIndex ///< 1-based battery index
16
17 property Fact battSource: controller.getParameterFact(-1, "BAT#_SOURCE".replace ("#", batteryIndex))
18 property Fact battNumCells: controller.getParameterFact(-1, "BAT#_N_CELLS".replace ("#", batteryIndex), false)
19 property Fact battHighVolt: controller.getParameterFact(-1, "BAT#_V_CHARGED".replace ("#", batteryIndex), false)
20 property Fact battLowVolt: controller.getParameterFact(-1, "BAT#_V_EMPTY".replace ("#", batteryIndex), false)
21 property Fact battVoltLoadDrop: controller.getParameterFact(-1, "BAT#_V_LOAD_DROP".replace ("#", batteryIndex), false)
22 property Fact battVoltageDivider: controller.getParameterFact(-1, "BAT#_V_DIV".replace ("#", batteryIndex), false)
23 property Fact battAmpsPerVolt: controller.getParameterFact(-1, "BAT#_A_PER_V".replace ("#", batteryIndex), false)
24
25 property bool battNumCellsAvailable: controller.parameterExists(-1, "BAT#_N_CELLS".replace ("#", batteryIndex))
26 property bool battHighVoltAvailable: controller.parameterExists(-1, "BAT#_V_CHARGED".replace ("#", batteryIndex))
27 property bool battLowVoltAvailable: controller.parameterExists(-1, "BAT#_V_EMPTY".replace ("#", batteryIndex))
28 property bool battVoltLoadDropAvailable: controller.parameterExists(-1, "BAT#_V_LOAD_DROP".replace ("#", batteryIndex))
29 property bool battVoltageDividerAvailable: controller.parameterExists(-1, "BAT#_V_DIV".replace ("#", batteryIndex))
30 property bool battAmpsPerVoltAvailable: controller.parameterExists(-1, "BAT#_A_PER_V".replace ("#", batteryIndex))
31}