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
956f4a86
Unverified
Commit
956f4a86
authored
Feb 08, 2020
by
Don Gagne
Committed by
GitHub
Feb 08, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8290 from DonLakeFlyer/BatteryStatus
Battery status fixes
parents
be64886c
cd3d35b3
Changes
3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
78 additions
and
100 deletions
+78
-100
BatteryFact.json
src/Vehicle/BatteryFact.json
+9
-14
Vehicle.cc
src/Vehicle/Vehicle.cc
+68
-74
Vehicle.h
src/Vehicle/Vehicle.h
+1
-12
No files found.
src/Vehicle/BatteryFact.json
View file @
956f4a86
...
...
@@ -9,21 +9,21 @@
{
"name"
:
"percentRemaining"
,
"shortDescription"
:
"Percent"
,
"type"
:
"
int32
"
,
"type"
:
"
double
"
,
"decimalPlaces"
:
0
,
"units"
:
"%"
},
{
"name"
:
"mahConsumed"
,
"shortDescription"
:
"Consumed"
,
"type"
:
"
int32
"
,
"decimalPlaces"
:
0
,
"units"
:
"mAh"
"type"
:
"
double
"
,
"decimalPlaces"
:
0
,
"units"
:
"mAh"
},
{
"name"
:
"current"
,
"shortDescription"
:
"Current"
,
"type"
:
"
float
"
,
"type"
:
"
double
"
,
"decimalPlaces"
:
2
,
"units"
:
"A"
},
...
...
@@ -34,30 +34,25 @@
"decimalPlaces"
:
0
,
"units"
:
"C"
},
{
"name"
:
"cellCount"
,
"shortDescription"
:
"Cell Count"
,
"type"
:
"int32"
,
"decimalPlaces"
:
0
},
{
"name"
:
"instantPower"
,
"shortDescription"
:
"Watts"
,
"type"
:
"
float
"
,
"type"
:
"
double
"
,
"decimalPlaces"
:
2
,
"units"
:
"W"
},
{
"name"
:
"timeRemaining"
,
"shortDescription"
:
"Time Remaining"
,
"type"
:
"int32"
,
"type"
:
"double"
,
"decimalPlaces"
:
0
,
"units"
:
"s"
},
{
"name"
:
"chargeState"
,
"shortDescription"
:
"Charge State"
,
"type"
:
"uint8"
,
"enumStrings"
:
"
Low Battery State Not Provided
,Normal Operation,Low Battery State,Critical Battery State,Emergency Battery State,Battery Failed,Battery Unhealthy"
,
"enumStrings"
:
"
n/a
,Normal Operation,Low Battery State,Critical Battery State,Emergency Battery State,Battery Failed,Battery Unhealthy"
,
"enumValues"
:
"0,1,2,3,4,5,6"
,
"decimalPlaces"
:
0
}
...
...
src/Vehicle/Vehicle.cc
View file @
956f4a86
This diff is collapsed.
Click to expand it.
src/Vehicle/Vehicle.h
View file @
956f4a86
...
...
@@ -256,7 +256,6 @@ public:
Q_PROPERTY
(
Fact
*
mahConsumed
READ
mahConsumed
CONSTANT
)
Q_PROPERTY
(
Fact
*
current
READ
current
CONSTANT
)
Q_PROPERTY
(
Fact
*
temperature
READ
temperature
CONSTANT
)
Q_PROPERTY
(
Fact
*
cellCount
READ
cellCount
CONSTANT
)
Q_PROPERTY
(
Fact
*
instantPower
READ
instantPower
CONSTANT
)
Q_PROPERTY
(
Fact
*
timeRemaining
READ
timeRemaining
CONSTANT
)
Q_PROPERTY
(
Fact
*
chargeState
READ
chargeState
CONSTANT
)
...
...
@@ -266,7 +265,6 @@ public:
Fact
*
mahConsumed
()
{
return
&
_mahConsumedFact
;
}
Fact
*
current
()
{
return
&
_currentFact
;
}
Fact
*
temperature
()
{
return
&
_temperatureFact
;
}
Fact
*
cellCount
()
{
return
&
_cellCountFact
;
}
Fact
*
instantPower
()
{
return
&
_instantPowerFact
;
}
Fact
*
timeRemaining
()
{
return
&
_timeRemainingFact
;
}
Fact
*
chargeState
()
{
return
&
_chargeStateFact
;
}
...
...
@@ -276,28 +274,18 @@ public:
static
const
char
*
_mahConsumedFactName
;
static
const
char
*
_currentFactName
;
static
const
char
*
_temperatureFactName
;
static
const
char
*
_cellCountFactName
;
static
const
char
*
_instantPowerFactName
;
static
const
char
*
_timeRemainingFactName
;
static
const
char
*
_chargeStateFactName
;
static
const
char
*
_settingsGroup
;
static
const
double
_voltageUnavailable
;
static
const
int
_percentRemainingUnavailable
;
static
const
int
_mahConsumedUnavailable
;
static
const
int
_currentUnavailable
;
static
const
double
_temperatureUnavailable
;
static
const
int
_cellCountUnavailable
;
static
const
double
_instantPowerUnavailable
;
private:
Fact
_voltageFact
;
Fact
_percentRemainingFact
;
Fact
_mahConsumedFact
;
Fact
_currentFact
;
Fact
_temperatureFact
;
Fact
_cellCountFact
;
Fact
_instantPowerFact
;
Fact
_timeRemainingFact
;
Fact
_chargeStateFact
;
...
...
@@ -1356,6 +1344,7 @@ private:
void
_writeCsvLine
();
void
_flightTimerStart
();
void
_flightTimerStop
();
void
_batteryStatusWorker
(
int
batteryId
,
double
voltage
,
double
current
,
double
batteryRemainingPct
);
int
_id
;
///< Mavlink system id
int
_defaultComponentId
;
...
...
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