Browse Source

Made lipoFull and lipoEmpty potentially configurable

QGC4.4
Lorenz Meier 12 years ago
parent
commit
34da19cfc8
  1. 10
      src/uas/UAS.cc
  2. 4
      src/uas/UAS.h

10
src/uas/UAS.cc

@ -39,11 +39,9 @@
* creating the UAS. * creating the UAS.
*/ */
const float UAS::lipoFull = 4.2f; ///< 100% charged voltage
const float UAS::lipoEmpty = 3.5f; ///< Discharged voltage
UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(), UAS::UAS(MAVLinkProtocol* protocol, int id) : UASInterface(),
lipoFull(4.2f),
lipoEmpty(3.5f),
uasId(id), uasId(id),
links(new QList<LinkInterface*>()), links(new QList<LinkInterface*>()),
unknownPackets(), unknownPackets(),
@ -3462,8 +3460,8 @@ void UAS::setBattery(BatteryType type, int cells)
case LIION: case LIION:
break; break;
case LIPOLY: case LIPOLY:
fullVoltage = this->cells * UAS::lipoFull; fullVoltage = this->cells * lipoFull;
emptyVoltage = this->cells * UAS::lipoEmpty; emptyVoltage = this->cells * lipoEmpty;
break; break;
case LIFE: case LIFE:
break; break;

4
src/uas/UAS.h

@ -56,8 +56,8 @@ public:
UAS(MAVLinkProtocol* protocol, int id = 0); UAS(MAVLinkProtocol* protocol, int id = 0);
~UAS(); ~UAS();
static const float lipoFull; ///< 100% charged voltage float lipoFull; ///< 100% charged voltage
static const float lipoEmpty; ///< Discharged voltage float lipoEmpty; ///< Discharged voltage
/* MANAGEMENT */ /* MANAGEMENT */

Loading…
Cancel
Save