From 7a52a4c33fb633a6bf227daf31e4ab65a444032e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 16 Feb 2020 14:34:08 +0100 Subject: Fix units of current consumption value. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previously it was not clear whether the units in tdehwlib are in Wh and W or Ah and A. Now the units are always Ah and A. Because power consumption is usually given in W, the value is converted from A to W. If it is less than 100 W, it is displayed as a decimal number. This is related to issue TDE/tdelibs#68. Signed-off-by: Slávek Banko (cherry picked from commit fa0e4e246ccb8f436598db4deee1777decfbc702) --- src/hardware_batteryCollection.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/hardware_batteryCollection.h') diff --git a/src/hardware_batteryCollection.h b/src/hardware_batteryCollection.h index c659c3a..c30717d 100644 --- a/src/hardware_batteryCollection.h +++ b/src/hardware_batteryCollection.h @@ -117,7 +117,7 @@ private: * This int tells the current rate of the batteries * \li a value >= 0 */ - int present_rate; + double present_rate; //! charge_level in percent that will put battery into warning state int warn_level; @@ -184,7 +184,7 @@ public: //! get the battery Type from enum \ref BAT_TYPE int getBatteryType() const; //! get the current battery rate - int getCurrentRate() const; + double getCurrentRate() const; //! reports the chargelevel in percent when battery goes to state warning int getWarnLevel() const; -- cgit v1.2.1