Browse Source

Change battery.current to float with 2 decimal places

QGC4.4
Don Gagne 8 years ago
parent
commit
43ad0f5634
  1. 4
      src/Vehicle/BatteryFact.json
  2. 2
      src/Vehicle/Vehicle.cc

4
src/Vehicle/BatteryFact.json

@ -23,8 +23,8 @@ @@ -23,8 +23,8 @@
{
"name": "current",
"shortDescription": "Current",
"type": "int32",
"decimalPlaces": 0,
"type": "float",
"decimalPlaces": 2,
"units": "A"
},
{

2
src/Vehicle/Vehicle.cc

@ -714,7 +714,7 @@ void Vehicle::_handleSysStatus(mavlink_message_t& message) @@ -714,7 +714,7 @@ void Vehicle::_handleSysStatus(mavlink_message_t& message)
_batteryFactGroup.current()->setRawValue(VehicleBatteryFactGroup::_currentUnavailable);
} else {
// Current is in Amps, current_battery is 10 * milliamperes (1 = 10 milliampere)
_batteryFactGroup.current()->setRawValue((int)(sysStatus.current_battery / 100));
_batteryFactGroup.current()->setRawValue((float)sysStatus.current_battery / 100.0f);
}
if (sysStatus.voltage_battery == UINT16_MAX) {
_batteryFactGroup.voltage()->setRawValue(VehicleBatteryFactGroup::_voltageUnavailable);

Loading…
Cancel
Save