Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Q
qgroundcontrol
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Platzgummer
qgroundcontrol
Commits
a3e6e48b
Unverified
Commit
a3e6e48b
authored
Nov 02, 2020
by
Don Gagne
Committed by
GitHub
Nov 02, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for BAT#_SOURCE (#9156)
parent
02216607
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
160 additions
and
158 deletions
+160
-158
BatteryParams.qml
src/AutoPilotPlugins/PX4/BatteryParams.qml
+11
-9
PowerComponent.qml
src/AutoPilotPlugins/PX4/PowerComponent.qml
+149
-149
No files found.
src/AutoPilotPlugins/PX4/BatteryParams.qml
View file @
a3e6e48b
...
...
@@ -26,15 +26,17 @@ QtObject {
property
var
controller
///< FactPanelController
property
int
batteryIndex
///< 1-based battery index
property
bool
battVoltageDividerAvailable
:
controller
.
parameterExists
(
-
1
,
"
BAT#_V_DIV
"
.
replace
(
"
#
"
,
_indexedBatteryParamsAvailable
?
batteryIndex
:
""
))
property
bool
battAmpsPerVoltAvailable
:
controller
.
parameterExists
(
-
1
,
"
BAT#_A_PER_V
"
.
replace
(
"
#
"
,
_indexedBatteryParamsAvailable
?
batteryIndex
:
""
))
property
Fact
battNumCells
:
controller
.
getParameterFact
(
-
1
,
"
BAT#_N_CELLS
"
.
replace
(
"
#
"
,
_indexedBatteryParamsAvailable
?
batteryIndex
:
""
))
property
Fact
battHighVolt
:
controller
.
getParameterFact
(
-
1
,
"
BAT#_V_CHARGED
"
.
replace
(
"
#
"
,
_indexedBatteryParamsAvailable
?
batteryIndex
:
""
))
property
Fact
battLowVolt
:
controller
.
getParameterFact
(
-
1
,
"
BAT#_V_EMPTY
"
.
replace
(
"
#
"
,
_indexedBatteryParamsAvailable
?
batteryIndex
:
""
))
property
Fact
battVoltLoadDrop
:
controller
.
getParameterFact
(
-
1
,
"
BAT#_V_LOAD_DROP
"
.
replace
(
"
#
"
,
_indexedBatteryParamsAvailable
?
batteryIndex
:
""
))
property
Fact
battVoltageDivider
:
controller
.
getParameterFact
(
-
1
,
"
BAT#_V_DIV
"
.
replace
(
"
#
"
,
_indexedBatteryParamsAvailable
?
batteryIndex
:
""
),
false
)
property
Fact
battAmpsPerVolt
:
controller
.
getParameterFact
(
-
1
,
"
BAT#_A_PER_V
"
.
replace
(
"
#
"
,
_indexedBatteryParamsAvailable
?
batteryIndex
:
""
),
false
)
property
Fact
battSource
:
controller
.
getParameterFact
(
-
1
,
"
BAT#_SOURCE
"
.
replace
(
"
#
"
,
_indexedBatteryParamsAvailable
?
batteryIndex
:
""
))
property
Fact
battNumCells
:
controller
.
getParameterFact
(
-
1
,
"
BAT#_N_CELLS
"
.
replace
(
"
#
"
,
_indexedBatteryParamsAvailable
?
batteryIndex
:
""
))
property
Fact
battHighVolt
:
controller
.
getParameterFact
(
-
1
,
"
BAT#_V_CHARGED
"
.
replace
(
"
#
"
,
_indexedBatteryParamsAvailable
?
batteryIndex
:
""
))
property
Fact
battLowVolt
:
controller
.
getParameterFact
(
-
1
,
"
BAT#_V_EMPTY
"
.
replace
(
"
#
"
,
_indexedBatteryParamsAvailable
?
batteryIndex
:
""
))
property
Fact
battVoltLoadDrop
:
controller
.
getParameterFact
(
-
1
,
"
BAT#_V_LOAD_DROP
"
.
replace
(
"
#
"
,
_indexedBatteryParamsAvailable
?
batteryIndex
:
""
))
property
Fact
battVoltageDivider
:
controller
.
getParameterFact
(
-
1
,
"
BAT#_V_DIV
"
.
replace
(
"
#
"
,
_indexedBatteryParamsAvailable
?
batteryIndex
:
""
),
false
)
property
Fact
battAmpsPerVolt
:
controller
.
getParameterFact
(
-
1
,
"
BAT#_A_PER_V
"
.
replace
(
"
#
"
,
_indexedBatteryParamsAvailable
?
batteryIndex
:
""
),
false
)
property
bool
battVoltageDividerAvailable
:
controller
.
parameterExists
(
-
1
,
"
BAT#_V_DIV
"
.
replace
(
"
#
"
,
_indexedBatteryParamsAvailable
?
batteryIndex
:
""
))
property
bool
battAmpsPerVoltAvailable
:
controller
.
parameterExists
(
-
1
,
"
BAT#_A_PER_V
"
.
replace
(
"
#
"
,
_indexedBatteryParamsAvailable
?
batteryIndex
:
""
))
property
string
_batNCellsIndexedParamName
:
"
BAT#_N_CELLS
"
property
bool
_indexedBatteryParamsAvailable
:
controller
.
parameterExists
(
-
1
,
_batNCellsIndexedParamName
.
replace
(
"
#
"
,
1
))
...
...
src/AutoPilotPlugins/PX4/PowerComponent.qml
View file @
a3e6e48b
...
...
@@ -214,7 +214,7 @@ SetupPage {
id
:
batterySetupComponent
QGCGroupBox
{
id
:
batteryGroup
Layout.fillWidth
:
true
title
:
qsTr
(
"
Battery
"
)
+
(
showBatteryIndex
?
batteryIndex
:
""
)
property
var
_controller
:
controller
...
...
@@ -229,6 +229,7 @@ SetupPage {
property
bool
battVoltageDividerAvailable
:
batParams
.
battVoltageDividerAvailable
property
bool
battAmpsPerVoltAvailable
:
batParams
.
battAmpsPerVoltAvailable
property
Fact
battSource
:
batParams
.
battSource
property
Fact
battNumCells
:
batParams
.
battNumCells
property
Fact
battHighVolt
:
batParams
.
battHighVolt
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
{
id
:
batteryGrid
columns
:
5
columnSpacing
:
ScreenTools
.
defaultFontPixelWidth
visible
:
battSource
.
rawValue
!=
-
1
QGCLabel
{
text
:
qsTr
(
"
Number of Cells (in Series)
"
)
}
FactTextField
{
QGCLabel
{
text
:
qsTr
(
"
Source
"
)
}
FactComboBox
{
width
:
_textEditWidth
fact
:
battNumCells
showUnits
:
true
fact
:
battSource
indexModel
:
false
sizeToContents
:
true
}
QGCColoredImage
{
Layout.rowSpan
:
3
Layout.rowSpan
:
4
width
:
height
*
0.75
height
:
100
sourceSize.height
:
height
...
...
@@ -277,58 +292,46 @@ SetupPage {
Item
{
width
:
1
;
height
:
1
;
Layout.columnSpan
:
2
}
QGCLabel
{
text
:
qsTr
(
"
Full Voltage (per cell)
"
)
}
QGCLabel
{
text
:
qsTr
(
"
Number of Cells (in Series)
"
)
}
FactTextField
{
width
:
_textEditWidth
fact
:
battHighVolt
fact
:
battNumCells
showUnits
:
true
}
QGCLabel
{
text
:
qsTr
(
"
Battery Max:
"
)
}
QGCLabel
{
text
:
(
battNumCells
.
value
*
battHighVolt
.
value
).
toFixed
(
1
)
+
'
V
'
}
QGCLabel
{
text
:
qsTr
(
"
Battery Max:
"
)
}
QGCLabel
{
text
:
(
battNumCells
.
value
*
battHighVolt
.
value
).
toFixed
(
1
)
+
'
V
'
}
QGCLabel
{
text
:
qsTr
(
"
Empty Voltage (per cell)
"
)
}
QGCLabel
{
text
:
qsTr
(
"
Empty Voltage (per cell)
"
)
}
FactTextField
{
width
:
_textEditWidth
fact
:
battLowVolt
showUnits
:
true
}
QGCLabel
{
text
:
qsTr
(
"
Battery Min:
"
)
}
QGCLabel
{
text
:
(
battNumCells
.
value
*
battLowVolt
.
value
).
toFixed
(
1
)
+
'
V
'
}
QGCLabel
{
text
:
qsTr
(
"
Battery Min:
"
)
}
QGCLabel
{
text
:
(
battNumCells
.
value
*
battLowVolt
.
value
).
toFixed
(
1
)
+
'
V
'
QGCLabel
{
text
:
qsTr
(
"
Full Voltage (per cell)
"
)
}
FactTextField
{
width
:
_textEditWidth
fact
:
battHighVolt
showUnits
:
true
}
Item
{
width
:
1
;
height
:
1
;
Layout.columnSpan
:
2
}
QGCLabel
{
text
:
qsTr
(
"
Voltage divider
"
)
visible
:
battVoltageDividerAvailable
}
FactTextField
{
fact
:
battVoltageDivider
visible
:
battVoltageDividerAvailable
}
QGCButton
{
text
:
qsTr
(
"
Calculate
"
)
visible
:
battVoltageDividerAvailable
onClicked
:
mainWindow
.
showPopupDialogFromComponent
(
calcVoltageDividerDlgComponent
,
{
batteryIndex
:
_batteryIndex
})
}
Item
{
width
:
1
;
height
:
1
;
Layout.columnSpan
:
2
;
visible
:
battVoltageDividerAvailable
}
QGCLabel
{
...
...
@@ -340,23 +343,19 @@ SetupPage {
qsTr
(
"
Click the Calculate button for help with calculating a new value.
"
)
visible
:
battVoltageDividerAvailable
}
QGCLabel
{
text
:
qsTr
(
"
Amps per volt
"
)
visible
:
battAmpsPerVoltAvailable
}
FactTextField
{
fact
:
battAmpsPerVolt
visible
:
battAmpsPerVoltAvailable
}
QGCButton
{
text
:
qsTr
(
"
Calculate
"
)
visible
:
battAmpsPerVoltAvailable
onClicked
:
mainWindow
.
showPopupDialogFromComponent
(
calcAmpsPerVoltDlgComponent
,
{
batteryIndex
:
_batteryIndex
})
}
Item
{
width
:
1
;
height
:
1
;
Layout.columnSpan
:
2
;
visible
:
battAmpsPerVoltAvailable
}
QGCLabel
{
...
...
@@ -408,6 +407,7 @@ SetupPage {
}
Item
{
width
:
1
;
height
:
1
;
Layout.columnSpan
:
3
;
visible
:
showAdvanced
.
checked
}
}
// Grid
}
}
// QGCGroupBox - Battery settings
}
// Component - batterySetupComponent
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment