2010-04-05 22:06:50 +03:00
|
|
|
#ifndef SIGNALDISPLAY_H
|
|
|
|
#define SIGNALDISPLAY_H
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <cmath>
|
|
|
|
#include <QtGui>
|
|
|
|
|
|
|
|
class SignalDisplay : public QWidget
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SignalDisplay(QWidget *&parent);
|
2010-04-09 18:39:15 +03:00
|
|
|
void addPoint1( int value);
|
|
|
|
void addPoint2( int value);
|
2010-04-05 22:06:50 +03:00
|
|
|
void setSecsPerDiv( float value ){ secsPerDiv = fabs(value);}
|
|
|
|
void setVoltsPerDiv( float value ){ voltsPerDiv = fabs(value);}
|
|
|
|
float getSecsPerDiv(){ return secsPerDiv; }
|
|
|
|
void setPointsPerPlot(int value);
|
2010-04-09 18:39:15 +03:00
|
|
|
void setColorTrace1(QColor color){colorTrace1=color;}
|
|
|
|
void setColorTrace2(QColor color){colorTrace2=color;}
|
2010-04-05 22:06:50 +03:00
|
|
|
|
|
|
|
private:
|
|
|
|
void paintEvent(QPaintEvent *event);
|
|
|
|
void drawGrid(QPainter &p, QColor colorGrid, int x, int y, int w, int h, int nx, int ny);
|
2010-04-09 18:39:15 +03:00
|
|
|
QPoint *wave1, *wave2;
|
2010-04-05 22:06:50 +03:00
|
|
|
float voltsPerDiv;
|
|
|
|
float secsPerDiv;
|
2010-04-09 18:39:15 +03:00
|
|
|
QColor colorTrace1,colorTrace2;
|
|
|
|
int secsIdx1, secsIdx2;
|
2010-04-05 22:06:50 +03:00
|
|
|
int w, h, ox, oy;
|
|
|
|
int pointsPerPlot;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SIGNALDISPLAY_H
|