Hardware Design: SIE
Sign in or create your account | Project List | Help
Hardware Design: SIE Git Source Tree
Root/
1 | #ifndef SIGNALDISPLAY_H |
2 | #define SIGNALDISPLAY_H |
3 | |
4 | #include <QWidget> |
5 | #include <cmath> |
6 | #include <QtGui> |
7 | |
8 | class SignalDisplay : public QWidget |
9 | { |
10 | public: |
11 | SignalDisplay(QWidget *&parent); |
12 | void addPoint1( int value); |
13 | void addPoint2( int value); |
14 | void setSecsPerDiv( float value ){ secsPerDiv = fabs(value);} |
15 | void setVoltsPerDiv( float value ){ voltsPerDiv = fabs(value);} |
16 | float getSecsPerDiv(){ return secsPerDiv; } |
17 | void setPointsPerPlot(int value); |
18 | void setColorTrace1(QColor color){colorTrace1=color;} |
19 | void setColorTrace2(QColor color){colorTrace2=color;} |
20 | |
21 | private: |
22 | void paintEvent(QPaintEvent *event); |
23 | void drawGrid(QPainter &p, QColor colorGrid, int x, int y, int w, int h, int nx, int ny); |
24 | QPoint *wave1, *wave2; |
25 | float voltsPerDiv; |
26 | float secsPerDiv; |
27 | QColor colorTrace1,colorTrace2; |
28 | int secsIdx1, secsIdx2; |
29 | int w, h, ox, oy; |
30 | int pointsPerPlot; |
31 | }; |
32 | |
33 | #endif // SIGNALDISPLAY_H |
34 |
Branches:
master