00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _TDEBATTERYDEVICE_H
00021 #define _TDEBATTERYDEVICE_H
00022
00023 #include "tdegenericdevice.h"
00024
00025 namespace TDEBatteryStatus {
00026 enum TDEBatteryStatus {
00027 Charging,
00028 Discharging,
00029 Full,
00030 Unknown = 0x80000000
00031 };
00032 };
00033
00034 class TDECORE_EXPORT TDEBatteryDevice : public TDEGenericDevice
00035 {
00036 public:
00041 TDEBatteryDevice(TDEGenericDeviceType::TDEGenericDeviceType dt, TQString dn=TQString::null);
00042
00046 ~TDEBatteryDevice();
00047
00051 double voltage();
00052
00056 double minimumVoltage();
00057
00061 double maximumVoltage();
00062
00066 double maximumDesignVoltage();
00067
00071 double energy();
00072
00076 double alarmEnergy();
00077
00081 double maximumEnergy();
00082
00086 double maximumDesignEnergy();
00087
00091 double dischargeRate();
00092
00096 double timeRemaining();
00097
00101 TQString technology();
00102
00106 TDEBatteryStatus::TDEBatteryStatus status();
00107
00111 bool installed();
00112
00116 double chargePercent();
00117
00118 protected:
00123 void internalSetVoltage(double vt);
00124
00129 void internalSetMinimumVoltage(double vt);
00130
00135 void internalSetMaximumVoltage(double vt);
00136
00141 void internalSetMaximumDesignVoltage(double vt);
00142
00147 void internalSetEnergy(double vt);
00148
00153 void internalSetAlarmEnergy(double vt);
00154
00159 void internalSetMaximumEnergy(double vt);
00160
00165 void internalSetMaximumDesignEnergy(double vt);
00166
00171 void internalSetDischargeRate(double vt);
00172
00177 void internalSetTimeRemaining(double tr);
00178
00183 void internalSetTechnology(TQString tc);
00184
00189 void internalSetStatus(TQString tc);
00190
00195 void internalSetInstalled(bool tc);
00196
00197 private:
00198 double m_currentVoltage;
00199 double m_minimumVoltage;
00200 double m_maximumVoltage;
00201 double m_maximumDesignVoltage;
00202 double m_alarmEnergy;
00203 double m_currentEnergy;
00204 double m_maximumEnergy;
00205 double m_maximumDesignEnergy;
00206 double m_dischargeRate;
00207 double m_timeRemaining;
00208 TQString m_technology;
00209 TDEBatteryStatus::TDEBatteryStatus m_status;
00210 bool m_installed;
00211
00212 friend class TDEHardwareDevices;
00213 };
00214
00215 #endif // _TDEBATTERYDEVICE_H