-
Notifications
You must be signed in to change notification settings - Fork 1
/
rtvtcontinuousviewerwidget.h
96 lines (79 loc) · 2.4 KB
/
rtvtcontinuousviewerwidget.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef RTVTCONTINUOUSVIEWERWIDGET_H
#define RTVTCONTINUOUSVIEWERWIDGET_H
#include <QWidget>
#include <QBrush>
#include <QPen>
#include "rtvtglobaldefinitions.h"
#define MEAN_WINDOW 6400
#define LEFT_BYTE_PAD 3200
#define RIGHT_BYTE_PAD 3200
#define LEFT_PAD_PERCENT 5
#define RIGHT_PAD_PERCENT 5
#define TOP_PAD_PERCENT 5
class QTimer;
class RTVTContinuousViewerWidget : public QWidget
{
Q_OBJECT
public:
// Variables
bool lineSmoothingEnabled;
double aspectRatio, vpWidth, vpHeight, fov, zFromCamera, interSampleLength;
float timeWindowInS;
int sampleRate, numberOfSamples;
bool drawingFromData;
bool viewNeedsRedraw;
bool smooth;
bool isPlaying;
int assignedViewerChannel;
double yPeakToPeak;
double yDragOrigin, xDragOrigin, thresholdOrigin;
double xScaleFactor;
double yScaleFactor;
bool setThresholdMode, setYScaleMode;
double thresholdPP;
int readFromDrawBufferFramePtr; // What frame are we on?
int readFromChannelDataPtr;
unsigned int readFromChannelFilterDataPtr;
unsigned int nextFilterWriteLocation;
int readStartPositionForChannel;
unsigned int readByteOffset;
unsigned int drawPixelOffset;
int drawWindowWidth;
int baseline;
bool askedToClear;
double storedYValueForNextFrame;
int storedXValueForNextFrame;
int secondCounter;
bool showInformation;
int meanCounter;
double meanSource[MEAN_WINDOW]; // Probably should be a filter length here...
// Data Variables
double localMean;
double adcFactor;
int ampGain;
int testMark;
bool waitUntilNextTransfer;
// Functions
RTVTContinuousViewerWidget( int timerInterval, int viewerChannel, QWidget *parent, QString name);
void enableLineSmoothing( bool bEnable );
void findStartPosition();
void keyPressEvent(QKeyEvent *e );
QSize sizeHint() const;
void play();
void stop();
signals:
void iWasDoubleClicked(int channel);
void iReachedEndOfData(int channel);
protected:
void mousePressEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void mouseDoubleClickEvent(QMouseEvent *me);
void mouseMoveEvent(QMouseEvent *event);
void timeOut();
void paintEvent(QPaintEvent *event);
protected slots:
void timeOutSlot();
private:
QTimer *glRedrawTimer;
};
#endif // RTVTCONTINUOUSVIEWERWIDGET_H