1
0
mirror of git://projects.qi-hardware.com/nn-usb-fpga.git synced 2025-04-21 12:27:27 +03:00

Adding dual channel to scope example, fixing logic and QT source code.

This commit is contained in:
Juan64Bits
2010-04-09 10:39:15 -05:00
parent 168c584b06
commit beca2e0bd3
36 changed files with 220 additions and 717 deletions

View File

@@ -0,0 +1,33 @@
#ifndef SIGNALDISPLAY_H
#define SIGNALDISPLAY_H
#include <QWidget>
#include <cmath>
#include <QtGui>
class SignalDisplay : public QWidget
{
public:
SignalDisplay(QWidget *&parent);
void addPoint1( int value);
void addPoint2( int value);
void setSecsPerDiv( float value ){ secsPerDiv = fabs(value);}
void setVoltsPerDiv( float value ){ voltsPerDiv = fabs(value);}
float getSecsPerDiv(){ return secsPerDiv; }
void setPointsPerPlot(int value);
void setColorTrace1(QColor color){colorTrace1=color;}
void setColorTrace2(QColor color){colorTrace2=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 *wave1, *wave2;
float voltsPerDiv;
float secsPerDiv;
QColor colorTrace1,colorTrace2;
int secsIdx1, secsIdx2;
int w, h, ox, oy;
int pointsPerPlot;
};
#endif // SIGNALDISPLAY_H