superkaramba
cpusensor.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef CPUSENSOR_H
00011 #define CPUSENSOR_H
00012 #include "sensor.h"
00013
00014 #include <tqfile.h>
00015 #include <tqregexp.h>
00016
00017 class CPUSensor : public Sensor
00018 {
00019 Q_OBJECT
00020 TQ_OBJECT
00021 public:
00022 CPUSensor( TQString cpuNbr, int interval );
00023 ~CPUSensor();
00024 void update();
00025 void setMaxValue( SensorParams *sp );
00026
00027 int getCPULoad();
00028
00029 private:
00030 long userTicks;
00031 long sysTicks;
00032 long niceTicks;
00033 long idleTicks;
00034
00035 int user;
00036 int system;
00037 int nice;
00038 int idle;
00039
00040 void getTicks (long &u,long &s,long &n,long &i);
00041 TQString cpuNbr;
00042
00043 };
00044
00045 #endif // CPUSENSOR_H