2108 |
paro |
1 |
#ifndef SCOPE_H |
|
|
2 |
#define SCOPE_H |
|
|
3 |
|
|
|
4 |
#include <QWidget> |
|
|
5 |
#include <QTimer> |
|
|
6 |
#include <QSlider> |
|
|
7 |
#include <stdint.h> |
2119 |
paro |
8 |
#include <QLabel> |
2108 |
paro |
9 |
|
2119 |
paro |
10 |
#define TICK 250 // time in ms for one sample (LEN values) |
2115 |
paro |
11 |
#define LEN 100 // number of sampled values |
|
|
12 |
|
2119 |
paro |
13 |
#define DEF_SCALE 128 //divisor |
|
|
14 |
#define DEF_SHIFT 37203 |
2115 |
paro |
15 |
|
|
|
16 |
#define LEFT 10 |
|
|
17 |
#define TOP 10 |
|
|
18 |
#define PIXPT_X 4 |
|
|
19 |
#define PIXPT_Y 1 |
|
|
20 |
#define WIDTH (PIXPT_X*LEN) |
|
|
21 |
#define HEIGHT (PIXPT_Y*512) |
|
|
22 |
|
2108 |
paro |
23 |
class Scope : public QWidget |
|
|
24 |
{ |
|
|
25 |
Q_OBJECT |
|
|
26 |
|
|
|
27 |
public: |
|
|
28 |
Scope(QWidget *parent = 0); |
|
|
29 |
~Scope(); |
|
|
30 |
|
|
|
31 |
public slots: |
|
|
32 |
void getData(); |
|
|
33 |
void setScale(int val); |
|
|
34 |
void setShift(int val); |
|
|
35 |
|
|
|
36 |
protected: |
|
|
37 |
void paintEvent(QPaintEvent *event); |
|
|
38 |
|
|
|
39 |
private: |
2119 |
paro |
40 |
|
2115 |
paro |
41 |
uint8_t buffer[2*LEN]; |
|
|
42 |
int data[LEN]; |
2108 |
paro |
43 |
char dataAquired; |
2119 |
paro |
44 |
void UI(void); |
2108 |
paro |
45 |
|
2119 |
paro |
46 |
int shift, scale; |
2108 |
paro |
47 |
|
|
|
48 |
QTimer *updateTimer; |
|
|
49 |
QSlider *shiftSlider; |
|
|
50 |
QSlider *scaleSlider; |
2119 |
paro |
51 |
|
|
|
52 |
QLabel * labels[5]; |
2108 |
paro |
53 |
}; |
|
|
54 |
|
|
|
55 |
#endif |