summaryrefslogblamecommitdiffstats
path: root/src/graphwidget.h
blob: f43e0db0a9f5ca15ca2493578af8f963ebd564ff (plain) (tree)
































                                                              
#ifndef GRAPHWIDGET_H_
#define GRAPHWIDGET_H_

#include <QWidget>

class IDataSource;

class GraphWidget : public QWidget
{
	Q_OBJECT
public:
	GraphWidget(QWidget* parent = NULL);
	virtual ~GraphWidget();

	void setDataSource(IDataSource* source);
	void readNextValue();

protected:
	virtual void resizeEvent(QResizeEvent * event);
	virtual void paintEvent(QPaintEvent * event);

private:
	static const int HISTSIZE = 2000;
	static const QColor LINE_COLOR, BACK_COLOR, BAR_COLOR;
	IDataSource* _source;
	qint64 _history[HISTSIZE];
	int _histPos;
	float _vScale;
	bool _doubleSpace;
	QRect _updateRectSmall;
};

#endif /* GRAPHWIDGET_H_ */