1
0
mirror of git://projects.qi-hardware.com/nn-usb-fpga.git synced 2025-01-10 23:00:15 +02:00
nn-usb-fpga/Examples/ADC/QT_src/signaldisplay.h

32 lines
773 B
C
Raw Normal View History

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);
void addPoint( int value1);
void setSecsPerDiv( float value ){ secsPerDiv = fabs(value);}
void setVoltsPerDiv( float value ){ voltsPerDiv = fabs(value);}
float getSecsPerDiv(){ return secsPerDiv; }
void setPointsPerPlot(int value);
void setColorTrace(QColor color){colorTrace=color;};
private:
void paintEvent(QPaintEvent *event);
void drawGrid(QPainter &p, QColor colorGrid, int x, int y, int w, int h, int nx, int ny);
QPoint *waves;
float voltsPerDiv;
float secsPerDiv;
QColor colorTrace;
int secsIdx;
int w, h, ox, oy;
int pointsPerPlot;
};
#endif // SIGNALDISPLAY_H