Unverified Commit 956f4a86 authored by Don Gagne's avatar Don Gagne Committed by GitHub

Merge pull request #8290 from DonLakeFlyer/BatteryStatus

Battery status fixes
parents be64886c cd3d35b3
......@@ -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
}
......
This diff is collapsed.
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment