Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

cpusensor.h

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (C) 2003 by Hans Karlsson                                   *
00003  *   karlsson.h@home.se                                                      *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU General Public License as published by  *
00007  *   the Free Software Foundation; either version 2 of the License, or     *
00008  *   (at your option) any later version.                                   *
00009  ***************************************************************************/
00010 #ifndef CPUSENSOR_H
00011 #define CPUSENSOR_H
00012 #include "sensor.h"
00013 
00014 #include <qfile.h>
00015 #include <qregexp.h>
00016 
00017 class CPUSensor :  public Sensor
00018 {
00019     Q_OBJECT
00020 public:
00021     CPUSensor( QString cpuNbr, int interval );
00022     ~CPUSensor();
00023     void update();
00024     void setMaxValue( SensorParams *sp );
00025 
00026     int getCPULoad();
00027 
00028 private:
00029     long userTicks;
00030     long sysTicks;
00031     long niceTicks;
00032     long idleTicks;
00033 
00034     int user;
00035     int system;
00036     int nice;
00037     int idle;
00038 
00039     void getTicks (long &u,long &s,long &n,long &i);
00040     QString cpuNbr;
00041 
00042 };
00043 
00044 #endif // CPUSENSOR_H

Generated on Mon May 16 13:59:20 2005 for karamba by  doxygen 1.3.9.1