From 5f946ff018aa65782a3fe78790651af729628353 Mon Sep 17 00:00:00 2001 From: dogmaphobic Date: Wed, 18 Mar 2015 15:17:23 -0400 Subject: [PATCH] Advanced Power Config --- src/AutoPilotPlugins/PX4/ParameterFactMetaData.xml | 1 + src/AutoPilotPlugins/PX4/PowerComponent.qml | 53 ++++++++++++++++------ 2 files changed, 41 insertions(+), 13 deletions(-) diff --git a/src/AutoPilotPlugins/PX4/ParameterFactMetaData.xml b/src/AutoPilotPlugins/PX4/ParameterFactMetaData.xml index 8b7ea4f..e8e2ce3 100644 --- a/src/AutoPilotPlugins/PX4/ParameterFactMetaData.xml +++ b/src/AutoPilotPlugins/PX4/ParameterFactMetaData.xml @@ -30,6 +30,7 @@ Battery capacity Defines the capacity of the attached battery. -1.0 + mA Scaling factor for battery voltage sensor on PX4IO diff --git a/src/AutoPilotPlugins/PX4/PowerComponent.qml b/src/AutoPilotPlugins/PX4/PowerComponent.qml index 69403e9..44c026c 100644 --- a/src/AutoPilotPlugins/PX4/PowerComponent.qml +++ b/src/AutoPilotPlugins/PX4/PowerComponent.qml @@ -44,7 +44,7 @@ Rectangle { color: palette.window property int firstColumnWidth: 220 - property int textEditWidth: 60 + property int textEditWidth: 80 property ScreenTools screenTools: ScreenTools { } property Fact battNumCells: Fact { name: "BAT_N_CELLS" } @@ -109,7 +109,7 @@ Rectangle { Rectangle { width: parent.width - height: 160 + height: 120 color: palette.windowShade Column { @@ -155,17 +155,6 @@ Rectangle { showUnits: true } } - Row { - spacing: 10 - visible: showAdvanced.checked - QGCLabel { text: "Voltage Drop on Full Load (per cell)"; width: firstColumnWidth; anchors.baseline: battDropField.baseline} - FactTextField { - id: battDropField - width: textEditWidth - fact: Fact { name: "BAT_V_LOAD_DROP" } - showUnits: true - } - } } Canvas { id: arrows @@ -276,5 +265,43 @@ Rectangle { id: showAdvanced text: "Show Advanced Settings" } + QGCLabel { + text: "Advanced Power Settings" + color: palette.text + font.pointSize: screenTools.dpiAdjustedPointSize(20); + visible: showAdvanced.checked + } + Rectangle { + width: parent.width + height: 80 + color: palette.windowShade + visible: showAdvanced.checked + Column { + id: advBatteryColumn + spacing: 10 + anchors.verticalCenter: parent.verticalCenter + x: (parent.x + 20) + Row { + spacing: 10 + QGCLabel { text: "Voltage Drop on Full Load (per cell)"; width: firstColumnWidth; anchors.baseline: battDropField.baseline} + FactTextField { + id: battDropField + width: textEditWidth + fact: Fact { name: "BAT_V_LOAD_DROP" } + showUnits: true + } + } + Row { + spacing: 10 + QGCLabel { text: "Battery Capacity"; width: firstColumnWidth; anchors.baseline: battCapacityField.baseline} + FactTextField { + id: battCapacityField + width: textEditWidth + fact: Fact { name: "BAT_CAPACITY" } + showUnits: true + } + } + } + } } }