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
58b85d0b
Commit
58b85d0b
authored
Jun 26, 2018
by
DonLakeFlyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More work for new battery stuff
parent
348091b3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
134 additions
and
111 deletions
+134
-111
APMPowerComponent.qml
src/AutoPilotPlugins/APM/APMPowerComponent.qml
+16
-2
APMSafetyComponent.qml
src/AutoPilotPlugins/APM/APMSafetyComponent.qml
+118
-109
No files found.
src/AutoPilotPlugins/APM/APMPowerComponent.qml
View file @
58b85d0b
...
...
@@ -43,6 +43,8 @@ SetupPage {
property
bool
_batt2MonitorEnabled
:
_batt2MonitorAvailable
&&
_batt2Monitor
.
rawValue
!==
0
property
bool
_batt1ParamsAvailable
:
controller
.
parameterExists
(
-
1
,
"
BATT_CAPACITY
"
)
property
bool
_batt2ParamsAvailable
:
controller
.
parameterExists
(
-
1
,
"
BATT2_CAPACITY
"
)
property
bool
_showBatt1Reboot
:
_batt1MonitorEnabled
&&
!
_batt1ParamsAvailable
property
bool
_showBatt2Reboot
:
_batt2MonitorEnabled
&&
!
_batt2ParamsAvailable
property
string
_restartRequired
:
qsTr
(
"
Requires vehicle reboot
"
)
...
...
@@ -84,7 +86,13 @@ SetupPage {
QGCLabel
{
text
:
_restartRequired
visible
:
_batt1MonitorEnabled
&&
!
_batt1ParamsAvailable
visible
:
_showBatt1Reboot
}
QGCButton
{
text
:
qsTr
(
"
Reboot vehicle
"
)
visible
:
_showBatt1Reboot
onClicked
:
controller
.
vehicle
.
rebootVehicle
()
}
}
}
...
...
@@ -162,7 +170,13 @@ SetupPage {
QGCLabel
{
text
:
_restartRequired
visible
:
_batt2MonitorEnabled
&&
!
_batt2ParamsAvailable
visible
:
_showBatt2Reboot
}
QGCButton
{
text
:
qsTr
(
"
Reboot vehicle
"
)
visible
:
_showBatt2Reboot
onClicked
:
controller
.
vehicle
.
rebootVehicle
()
}
}
}
...
...
src/AutoPilotPlugins/APM/APMSafetyComponent.qml
View file @
58b85d0b
...
...
@@ -46,39 +46,30 @@ SetupPage {
property
Fact
_failsafeBatt2LowAct
:
controller
.
getParameterFact
(
-
1
,
"
BATT2_FS_LOW_ACT
"
,
false
/* reportMissing */
)
property
Fact
_failsafeBatt1CritAct
:
controller
.
getParameterFact
(
-
1
,
"
BATT_FS_CRT_ACT
"
,
false
/* reportMissing */
)
property
Fact
_failsafeBatt2CritAct
:
controller
.
getParameterFact
(
-
1
,
"
BATT2_FS_CRT_ACT
"
,
false
/* reportMissing */
)
property
Fact
_failsafeBatt1Mah
:
controller
.
getParameterFact
(
-
1
,
"
BATT_LOW_MAH
"
,
false
/* reportMissing */
)
property
Fact
_failsafeBatt2Mah
:
controller
.
getParameterFact
(
-
1
,
"
BATT2_LOW_MAH
"
,
false
/* reportMissing */
)
property
Fact
_failsafeBatt1Voltage
:
controller
.
getParameterFact
(
-
1
,
"
BATT_LOW_VOLT
"
,
false
/* reportMissing */
)
property
Fact
_failsafeBatt2Voltage
:
controller
.
getParameterFact
(
-
1
,
"
BATT2_LOW_VOLT
"
,
false
/* reportMissing */
)
property
Fact
_failsafeBatt1LowMah
:
controller
.
getParameterFact
(
-
1
,
"
BATT_LOW_MAH
"
,
false
/* reportMissing */
)
property
Fact
_failsafeBatt2LowMah
:
controller
.
getParameterFact
(
-
1
,
"
BATT2_LOW_MAH
"
,
false
/* reportMissing */
)
property
Fact
_failsafeBatt1CritMah
:
controller
.
getParameterFact
(
-
1
,
"
BATT_CRT_MAH
"
,
false
/* reportMissing */
)
property
Fact
_failsafeBatt2CritMah
:
controller
.
getParameterFact
(
-
1
,
"
BATT2_CRT_MAH
"
,
false
/* reportMissing */
)
property
Fact
_failsafeBatt1LowVoltage
:
controller
.
getParameterFact
(
-
1
,
"
BATT_LOW_VOLT
"
,
false
/* reportMissing */
)
property
Fact
_failsafeBatt2LowVoltage
:
controller
.
getParameterFact
(
-
1
,
"
BATT2_LOW_VOLT
"
,
false
/* reportMissing */
)
property
Fact
_failsafeBatt1CritVoltage
:
controller
.
getParameterFact
(
-
1
,
"
BATT_CRT_VOLT
"
,
false
/* reportMissing */
)
property
Fact
_failsafeBatt2CritVoltage
:
controller
.
getParameterFact
(
-
1
,
"
BATT2_CRT_VOLT
"
,
false
/* reportMissing */
)
property
Fact
_armingCheck
:
controller
.
getParameterFact
(
-
1
,
"
ARMING_CHECK
"
)
property
real
_margins
:
ScreenTools
.
defaultFontPixelHeight
property
bool
_showIcon
:
!
ScreenTools
.
isTinyScreen
property
string
_restartRequired
:
qsTr
(
"
Requires vehicle reboot
"
)
ExclusiveGroup
{
id
:
fenceActionRadioGroup
}
ExclusiveGroup
{
id
:
landLoiterRadioGroup
}
ExclusiveGroup
{
id
:
returnAltRadioGroup
}
Column
{
spacing
:
_margins
/
2
visible
:
_batt1MonitorEnabled
&&
_batt1ParamsAvailable
QGCLabel
{
text
:
qsTr
(
"
Battery1 Failsafe Triggers
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
}
Rectangle
{
width
:
batteryFailsafeColumn
.
x
+
batteryFailsafeColumn
.
width
+
_margins
height
:
batteryFailsafeColumn
.
y
+
batteryFailsafeColumn
.
height
+
_margins
color
:
ggcPal
.
windowShade
Component
{
id
:
batteryFailsafeComponent
Column
{
id
:
batteryFailsafeColumn
anchors.margins
:
_margins
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
spacing
:
_margins
GridLayout
{
...
...
@@ -86,117 +77,135 @@ SetupPage {
columnSpacing
:
_margins
rowSpacing
:
_margins
columns
:
2
QGCLabel
{
text
:
qsTr
(
"
Battery l
ow action:
"
)
}
QGCLabel
{
text
:
qsTr
(
"
L
ow action:
"
)
}
FactComboBox
{
fact
:
_failsafeBatt1
LowAct
fact
:
failsafeBatt
LowAct
indexModel
:
false
Layout.fillWidth
:
true
}
QGCLabel
{
text
:
qsTr
(
"
Battery critical action:
"
)
}
QGCLabel
{
text
:
qsTr
(
"
Critical action:
"
)
}
FactComboBox
{
fact
:
_failsafeBatt1
CritAct
fact
:
failsafeBatt
CritAct
indexModel
:
false
Layout.fillWidth
:
true
}
QGCCheckBox
{
text
:
qsTr
(
"
Voltage threshold:
"
)
checked
:
_failsafeBatt1Voltage
.
value
!=
0
onClicked
:
_failsafeBatt1Voltage
.
value
=
checked
?
10.5
:
0
QGCLabel
{
text
:
qsTr
(
"
Low voltage threshold:
"
)
}
FactTextField
{
fact
:
failsafeBattLowVoltage
showUnits
:
true
Layout.fillWidth
:
true
}
QGCLabel
{
text
:
qsTr
(
"
Critical voltage threshold:
"
)
}
FactTextField
{
fact
:
_failsafeBatt1
Voltage
fact
:
failsafeBattCrit
Voltage
showUnits
:
true
Layout.fillWidth
:
true
}
QGCCheckBox
{
text
:
qsTr
(
"
MAH threshold:
"
)
checked
:
_failsafeBatt1Mah
.
value
!=
0
onClicked
:
_failsafeBatt1Mah
.
value
=
checked
?
600
:
0
QGCLabel
{
text
:
qsTr
(
"
Low mAh threshold:
"
)
}
FactTextField
{
fact
:
failsafeBattLowMah
showUnits
:
true
Layout.fillWidth
:
true
}
QGCLabel
{
text
:
qsTr
(
"
Critical mAh threshold:
"
)
}
FactTextField
{
fact
:
_failsafeBatt1
Mah
fact
:
failsafeBattCrit
Mah
showUnits
:
true
Layout.fillWidth
:
true
}
}
// GridLayout
}
// Column
}
// Rectangle
}
// Column - Battery Failsafe Settings
}
Component
{
id
:
restartRequiredComponent
ColumnLayout
{
spacing
:
ScreenTools
.
defaultFontPixelWidth
QGCLabel
{
text
:
_restartRequired
}
QGCButton
{
text
:
qsTr
(
"
Reboot vehicle
"
)
onClicked
:
controller
.
vehicle
.
rebootVehicle
()
}
}
}
Column
{
spacing
:
_margins
/
2
visible
:
_batt2MonitorEnabled
&&
_batt2ParamsAvailable
visible
:
_batt1MonitorEnabled
QGCLabel
{
text
:
qsTr
(
"
Battery
2
Failsafe Triggers
"
)
text
:
qsTr
(
"
Battery
1
Failsafe Triggers
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
}
Rectangle
{
id
:
failsafeSettings
width
:
battery2FailsafeColumn
.
x
+
battery2FailsafeColumn
.
width
+
_margins
height
:
battery2FailsafeColumn
.
y
+
battery2FailsafeColumn
.
height
+
_margins
width
:
battery1FailsafeLoader
.
x
+
battery1FailsafeLoader
.
width
+
_margins
height
:
battery1FailsafeLoader
.
y
+
battery1FailsafeLoader
.
height
+
_margins
color
:
ggcPal
.
windowShade
Column
{
id
:
battery
2FailsafeColumn
Loader
{
id
:
battery
1FailsafeLoader
anchors.margins
:
_margins
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
s
pacing
:
_margins
s
ourceComponent
:
_batt1ParamsAvailable
?
batteryFailsafeComponent
:
restartRequiredComponent
GridLayout
{
columnSpacing
:
_margins
rowSpacing
:
_margins
columns
:
2
visible
:
_batt2MonitorEnabled
&&
_failsafeBatt2LowActAvailable
QGCLabel
{
text
:
qsTr
(
"
Battery low action:
"
)
}
FactComboBox
{
fact
:
_failsafeBatt2LowAct
indexModel
:
false
Layout.fillWidth
:
true
property
Fact
battMonitor
:
_batt1Monitor
property
bool
battParamsAvailable
:
_batt1ParamsAvailable
property
Fact
failsafeBattLowAct
:
_failsafeBatt1LowAct
property
Fact
failsafeBattCritAct
:
_failsafeBatt1CritAct
property
Fact
failsafeBattLowMah
:
_failsafeBatt1LowMah
property
Fact
failsafeBattCritMah
:
_failsafeBatt1CritMah
property
Fact
failsafeBattLowVoltage
:
_failsafeBatt1LowVoltage
property
Fact
failsafeBattCritVoltage
:
_failsafeBatt1CritVoltage
}
}
// Rectangle
}
// Column - Battery Failsafe Settings
Column
{
spacing
:
_margins
/
2
visible
:
_batt2MonitorEnabled
QGCLabel
{
text
:
qsTr
(
"
Battery critical action:
"
)
}
FactComboBox
{
fact
:
_failsafeBatt2CritAct
indexModel
:
false
Layout.fillWidth
:
true
text
:
qsTr
(
"
Battery2 Failsafe Triggers
"
)
font.family
:
ScreenTools
.
demiboldFontFamily
}
QGCCheckBox
{
text
:
qsTr
(
"
Voltage threshold:
"
)
checked
:
_failsafeBatt2Voltage
.
value
!=
0
onClicked
:
_failsafeBatt2Voltage
.
value
=
checked
?
10.5
:
0
}
FactTextField
{
fact
:
_failsafeBatt2Voltage
showUnits
:
true
Layout.fillWidth
:
true
}
Rectangle
{
width
:
battery2FailsafeLoader
.
x
+
battery2FailsafeLoader
.
width
+
_margins
height
:
battery2FailsafeLoader
.
y
+
battery2FailsafeLoader
.
height
+
_margins
color
:
ggcPal
.
windowShade
QGCCheckBox
{
text
:
qsTr
(
"
MAH threshold:
"
)
checked
:
_failsafeBatt2Mah
.
value
!=
0
onClicked
:
_failsafeBatt2Mah
.
value
=
checked
?
600
:
0
}
FactTextField
{
fact
:
_failsafeBatt2Mah
showUnits
:
true
Layout.fillWidth
:
true
Loader
{
id
:
battery2FailsafeLoader
anchors.margins
:
_margins
anchors.top
:
parent
.
top
anchors.left
:
parent
.
left
sourceComponent
:
_batt2ParamsAvailable
?
batteryFailsafeComponent
:
restartRequiredComponent
property
Fact
battMonitor
:
_batt2Monitor
property
bool
battParamsAvailable
:
_batt2ParamsAvailable
property
Fact
failsafeBattLowAct
:
_failsafeBatt2LowAct
property
Fact
failsafeBattCritAct
:
_failsafeBatt2CritAct
property
Fact
failsafeBattLowMah
:
_failsafeBatt2LowMah
property
Fact
failsafeBattCritMah
:
_failsafeBatt2CritMah
property
Fact
failsafeBattLowVoltage
:
_failsafeBatt2LowVoltage
property
Fact
failsafeBattCritVoltage
:
_failsafeBatt2CritVoltage
}
}
// GridLayout
}
// Column
}
// Rectangle
}
// Column - Battery
2
Failsafe Settings
}
// Column - Battery Failsafe Settings
Component
{
id
:
planeGeneralFS
...
...
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