#ifndef SCOPE_H
#define SCOPE_H
#include <QWidget>
#include <QTimer>
#include <QSlider>
#include <stdint.h>
#include <QLabel>
#define TICK 250 // time in ms for one sample (LEN values)
#define LEN 100 // number of sampled values
#define DEF_SCALE 128 //divisor
#define DEF_SHIFT 37203
#define LEFT 10
#define TOP 10
#define PIXPT_X 4
#define PIXPT_Y 1
#define WIDTH (PIXPT_X*LEN)
#define HEIGHT (PIXPT_Y*512)
class Scope : public QWidget
{
Q_OBJECT
public:
Scope(QWidget *parent = 0);
~Scope();
public slots:
void getData();
void setScale(int val);
void setShift(int val);
protected:
void paintEvent(QPaintEvent *event);
private:
uint8_t buffer[2*LEN];
int data[LEN];
char dataAquired;
void UI(void);
int shift, scale;
QTimer *updateTimer;
QSlider *shiftSlider;
QSlider *scaleSlider;
QLabel * labels[5];
};
#endif