#ifndef SCOPE_H
#define SCOPE_H

#include <QWidget>
#include <QTimer>
#include <QSlider>
#include <stdint.h>

#define TICK 150   // time in ms for one sampling (of LEN values)
#define LEN 100    // number of sampled values

#define DEF_SCALE 256 //divisor
#define DEF_SHIFT 0

#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;
                 
     long shift, scale;

     QTimer *updateTimer;
     QSlider *shiftSlider;
     QSlider *scaleSlider;
};

#endif