From 34da19cfc82fb3a75b973cb67bc51afb9682abba Mon Sep 17 00:00:00 2001 From: Lorenz Meier Date: Tue, 23 Jul 2013 17:24:01 +0200 Subject: [PATCH] Made lipoFull and lipoEmpty potentially configurable --- src/uas/UAS.cc | 10 ++++------ src/uas/UAS.h | 4 ++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/uas/UAS.cc b/src/uas/UAS.cc index 65b8d9a57..0759a23cb 100644 --- a/src/uas/UAS.cc +++ b/src/uas/UAS.cc @@ -39,11 +39,9 @@ * 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(), + lipoFull(4.2f), + lipoEmpty(3.5f), uasId(id), links(new QList()), unknownPackets(), @@ -3462,8 +3460,8 @@ void UAS::setBattery(BatteryType type, int cells) case LIION: break; case LIPOLY: - fullVoltage = this->cells * UAS::lipoFull; - emptyVoltage = this->cells * UAS::lipoEmpty; + fullVoltage = this->cells * lipoFull; + emptyVoltage = this->cells * lipoEmpty; break; case LIFE: break; diff --git a/src/uas/UAS.h b/src/uas/UAS.h index 0da722b68..b1c027bd1 100644 --- a/src/uas/UAS.h +++ b/src/uas/UAS.h @@ -56,8 +56,8 @@ public: UAS(MAVLinkProtocol* protocol, int id = 0); ~UAS(); - static const float lipoFull; ///< 100% charged voltage - static const float lipoEmpty; ///< Discharged voltage + float lipoFull; ///< 100% charged voltage + float lipoEmpty; ///< Discharged voltage /* MANAGEMENT */ -- 2.22.0