~ubuntu-branches/ubuntu/oneiric/qwt/oneiric-proposed

« back to all changes in this revision

Viewing changes to qwt-5.1.2/examples/cpuplot/cpuplot.h

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2009-07-01 16:08:21 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090701160821-gog44m4w7x2f4u6o
Tags: 5.2.0-1
* New upstream release.
* Add branch pull patch from svn r544.
* Bump Standards-Version to 3.8.2. No changes needed.
* Update installed manpages.
* Use qwt as base name for directory (drop version).
* Add missing warnings patch.
* Rewrite debian/rules: use dh.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#include <qwt_plot.h>
2
 
#include "cpustat.h"
3
 
 
4
 
#define HISTORY 60 // seconds
5
 
 
6
 
class QwtPlotCurve;
7
 
 
8
 
class CpuPlot : public QwtPlot 
9
 
{
10
 
    Q_OBJECT
11
 
public:
12
 
    enum CpuData
13
 
    {
14
 
        User,
15
 
        System,
16
 
        Total,
17
 
        Idle,
18
 
 
19
 
        NCpuData
20
 
    };
21
 
 
22
 
    CpuPlot(QWidget * = 0);
23
 
    const QwtPlotCurve *cpuCurve(int id) const
24
 
        { return data[id].curve; }
25
 
 
26
 
protected:
27
 
    void timerEvent(QTimerEvent *e);
28
 
 
29
 
private slots:
30
 
    void showCurve(QwtPlotItem *, bool on);
31
 
 
32
 
private:
33
 
    struct
34
 
    {
35
 
        QwtPlotCurve *curve;
36
 
        double data[HISTORY];
37
 
    } data[NCpuData];
38
 
    double timeData[HISTORY];
39
 
 
40
 
    int dataCount;
41
 
    CpuStat cpuStat;
42
 
};