mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-14 16:39:57 +00:00
Upgrade to QWT 6.0.1, but still uses a locally patched copy since support for 8 axes has not been included, despite it being a relatively simple patch. Fixes #634. Fixes #567.
43 lines
661 B
C++
43 lines
661 B
C++
#include <qwt_plot.h>
|
|
#include "cpustat.h"
|
|
|
|
#define HISTORY 60 // seconds
|
|
|
|
class QwtPlotCurve;
|
|
|
|
class CpuPlot : public QwtPlot
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
enum CpuData
|
|
{
|
|
User,
|
|
System,
|
|
Total,
|
|
Idle,
|
|
|
|
NCpuData
|
|
};
|
|
|
|
CpuPlot(QWidget * = 0);
|
|
const QwtPlotCurve *cpuCurve(int id) const
|
|
{ return data[id].curve; }
|
|
|
|
protected:
|
|
void timerEvent(QTimerEvent *e);
|
|
|
|
private Q_SLOTS:
|
|
void showCurve(QwtPlotItem *, bool on);
|
|
|
|
private:
|
|
struct
|
|
{
|
|
QwtPlotCurve *curve;
|
|
double data[HISTORY];
|
|
} data[NCpuData];
|
|
double timeData[HISTORY];
|
|
|
|
int dataCount;
|
|
CpuStat cpuStat;
|
|
};
|