|
|
@ -214,7 +214,7 @@ SetupPage { |
|
|
|
id: batterySetupComponent |
|
|
|
id: batterySetupComponent |
|
|
|
|
|
|
|
|
|
|
|
QGCGroupBox { |
|
|
|
QGCGroupBox { |
|
|
|
id: batteryGroup |
|
|
|
Layout.fillWidth: true |
|
|
|
title: qsTr("Battery ") + (showBatteryIndex ? batteryIndex : "") |
|
|
|
title: qsTr("Battery ") + (showBatteryIndex ? batteryIndex : "") |
|
|
|
|
|
|
|
|
|
|
|
property var _controller: controller |
|
|
|
property var _controller: controller |
|
|
@ -229,6 +229,7 @@ SetupPage { |
|
|
|
property bool battVoltageDividerAvailable: batParams.battVoltageDividerAvailable |
|
|
|
property bool battVoltageDividerAvailable: batParams.battVoltageDividerAvailable |
|
|
|
property bool battAmpsPerVoltAvailable: batParams.battAmpsPerVoltAvailable |
|
|
|
property bool battAmpsPerVoltAvailable: batParams.battAmpsPerVoltAvailable |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
property Fact battSource: batParams.battSource |
|
|
|
property Fact battNumCells: batParams.battNumCells |
|
|
|
property Fact battNumCells: batParams.battNumCells |
|
|
|
property Fact battHighVolt: batParams.battHighVolt |
|
|
|
property Fact battHighVolt: batParams.battHighVolt |
|
|
|
property Fact battLowVolt: batParams.battLowVolt |
|
|
|
property Fact battLowVolt: batParams.battLowVolt |
|
|
@ -248,23 +249,37 @@ SetupPage { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ColumnLayout { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
RowLayout { |
|
|
|
|
|
|
|
spacing: ScreenTools.defaultFontPixelWidth |
|
|
|
|
|
|
|
visible: battSource.rawValue == -1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { text: qsTr("Source") } |
|
|
|
|
|
|
|
FactComboBox { |
|
|
|
|
|
|
|
width: _textEditWidth |
|
|
|
|
|
|
|
fact: battSource |
|
|
|
|
|
|
|
indexModel: false |
|
|
|
|
|
|
|
sizeToContents: true |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
GridLayout { |
|
|
|
GridLayout { |
|
|
|
id: batteryGrid |
|
|
|
id: batteryGrid |
|
|
|
columns: 5 |
|
|
|
columns: 5 |
|
|
|
columnSpacing: ScreenTools.defaultFontPixelWidth |
|
|
|
columnSpacing: ScreenTools.defaultFontPixelWidth |
|
|
|
|
|
|
|
visible: battSource.rawValue != -1 |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { text: qsTr("Source") } |
|
|
|
text: qsTr("Number of Cells (in Series)") |
|
|
|
FactComboBox { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FactTextField { |
|
|
|
|
|
|
|
width: _textEditWidth |
|
|
|
width: _textEditWidth |
|
|
|
fact: battNumCells |
|
|
|
fact: battSource |
|
|
|
showUnits: true |
|
|
|
indexModel: false |
|
|
|
|
|
|
|
sizeToContents: true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QGCColoredImage { |
|
|
|
QGCColoredImage { |
|
|
|
Layout.rowSpan: 3 |
|
|
|
Layout.rowSpan: 4 |
|
|
|
width: height * 0.75 |
|
|
|
width: height * 0.75 |
|
|
|
height: 100 |
|
|
|
height: 100 |
|
|
|
sourceSize.height: height |
|
|
|
sourceSize.height: height |
|
|
@ -277,58 +292,46 @@ SetupPage { |
|
|
|
|
|
|
|
|
|
|
|
Item { width: 1; height: 1; Layout.columnSpan: 2 } |
|
|
|
Item { width: 1; height: 1; Layout.columnSpan: 2 } |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { text: qsTr("Number of Cells (in Series)") } |
|
|
|
text: qsTr("Full Voltage (per cell)") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FactTextField { |
|
|
|
FactTextField { |
|
|
|
width: _textEditWidth |
|
|
|
width: _textEditWidth |
|
|
|
fact: battHighVolt |
|
|
|
fact: battNumCells |
|
|
|
showUnits: true |
|
|
|
showUnits: true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
QGCLabel { text: qsTr("Battery Max:") } |
|
|
|
|
|
|
|
QGCLabel { text: (battNumCells.value * battHighVolt.value).toFixed(1) + ' V' } |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { text: qsTr("Empty Voltage (per cell)") } |
|
|
|
text: qsTr("Battery Max:") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
|
|
|
|
text: (battNumCells.value * battHighVolt.value).toFixed(1) + ' V' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
|
|
|
|
text: qsTr("Empty Voltage (per cell)") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
FactTextField { |
|
|
|
FactTextField { |
|
|
|
width: _textEditWidth |
|
|
|
width: _textEditWidth |
|
|
|
fact: battLowVolt |
|
|
|
fact: battLowVolt |
|
|
|
showUnits: true |
|
|
|
showUnits: true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
QGCLabel { text: qsTr("Battery Min:") } |
|
|
|
|
|
|
|
QGCLabel { text: (battNumCells.value * battLowVolt.value).toFixed(1) + ' V' } |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
|
|
|
|
text: qsTr("Battery Min:") |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { text: qsTr("Full Voltage (per cell)") } |
|
|
|
text: (battNumCells.value * battLowVolt.value).toFixed(1) + ' V' |
|
|
|
FactTextField { |
|
|
|
|
|
|
|
width: _textEditWidth |
|
|
|
|
|
|
|
fact: battHighVolt |
|
|
|
|
|
|
|
showUnits: true |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
Item { width: 1; height: 1; Layout.columnSpan: 2 } |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
|
text: qsTr("Voltage divider") |
|
|
|
text: qsTr("Voltage divider") |
|
|
|
visible: battVoltageDividerAvailable |
|
|
|
visible: battVoltageDividerAvailable |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
FactTextField { |
|
|
|
FactTextField { |
|
|
|
fact: battVoltageDivider |
|
|
|
fact: battVoltageDivider |
|
|
|
visible: battVoltageDividerAvailable |
|
|
|
visible: battVoltageDividerAvailable |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QGCButton { |
|
|
|
QGCButton { |
|
|
|
text: qsTr("Calculate") |
|
|
|
text: qsTr("Calculate") |
|
|
|
visible: battVoltageDividerAvailable |
|
|
|
visible: battVoltageDividerAvailable |
|
|
|
onClicked: mainWindow.showPopupDialogFromComponent(calcVoltageDividerDlgComponent, { batteryIndex: _batteryIndex }) |
|
|
|
onClicked: mainWindow.showPopupDialogFromComponent(calcVoltageDividerDlgComponent, { batteryIndex: _batteryIndex }) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Item { width: 1; height: 1; Layout.columnSpan: 2; visible: battVoltageDividerAvailable } |
|
|
|
Item { width: 1; height: 1; Layout.columnSpan: 2; visible: battVoltageDividerAvailable } |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
@ -340,23 +343,19 @@ SetupPage { |
|
|
|
qsTr("Click the Calculate button for help with calculating a new value.") |
|
|
|
qsTr("Click the Calculate button for help with calculating a new value.") |
|
|
|
visible: battVoltageDividerAvailable |
|
|
|
visible: battVoltageDividerAvailable |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
|
text: qsTr("Amps per volt") |
|
|
|
text: qsTr("Amps per volt") |
|
|
|
visible: battAmpsPerVoltAvailable |
|
|
|
visible: battAmpsPerVoltAvailable |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
FactTextField { |
|
|
|
FactTextField { |
|
|
|
fact: battAmpsPerVolt |
|
|
|
fact: battAmpsPerVolt |
|
|
|
visible: battAmpsPerVoltAvailable |
|
|
|
visible: battAmpsPerVoltAvailable |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QGCButton { |
|
|
|
QGCButton { |
|
|
|
text: qsTr("Calculate") |
|
|
|
text: qsTr("Calculate") |
|
|
|
visible: battAmpsPerVoltAvailable |
|
|
|
visible: battAmpsPerVoltAvailable |
|
|
|
onClicked: mainWindow.showPopupDialogFromComponent(calcAmpsPerVoltDlgComponent, { batteryIndex: _batteryIndex }) |
|
|
|
onClicked: mainWindow.showPopupDialogFromComponent(calcAmpsPerVoltDlgComponent, { batteryIndex: _batteryIndex }) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Item { width: 1; height: 1; Layout.columnSpan: 2; visible: battAmpsPerVoltAvailable } |
|
|
|
Item { width: 1; height: 1; Layout.columnSpan: 2; visible: battAmpsPerVoltAvailable } |
|
|
|
|
|
|
|
|
|
|
|
QGCLabel { |
|
|
|
QGCLabel { |
|
|
@ -408,6 +407,7 @@ SetupPage { |
|
|
|
} |
|
|
|
} |
|
|
|
Item { width: 1; height: 1; Layout.columnSpan: 3; visible: showAdvanced.checked } |
|
|
|
Item { width: 1; height: 1; Layout.columnSpan: 3; visible: showAdvanced.checked } |
|
|
|
} // Grid |
|
|
|
} // Grid |
|
|
|
|
|
|
|
} |
|
|
|
} // QGCGroupBox - Battery settings |
|
|
|
} // QGCGroupBox - Battery settings |
|
|
|
} // Component - batterySetupComponent |
|
|
|
} // Component - batterySetupComponent |
|
|
|
|
|
|
|
|
|
|
|