BioSignalPi  v2
samplingthread.h
Go to the documentation of this file.
1 #ifndef SAMPLINGTHREAD_H
2 #define SAMPLINGTHREAD_H
3 
4 #include <QPointF>
5 #include <QFile>
6 #include <QTextStream>
7 #include <QThread>
8 #include "deviceinterface.h"
9 #include <QElapsedTimer>
10 
11 
12 
13 class EcgCapture;
14 
28 {
29 Q_OBJECT
30 
31 public:
32  // SamplingThread(QObject *parent = NULL);
33  SamplingThread(DataStream& inputStream);
34  virtual ~SamplingThread();
35  void clearSamples();
36  void setSource(int);
37  void setFileName(QString);
38  void setFileType(QString);
39  void startThread();
40  virtual void stop();
41  virtual void run();
42 
43  virtual void getData(DataStream&);
44  virtual bool connected();
45  virtual void close();
46 
47 public slots:
48  void setChannel(int);
49 
50 private:
51 
52  QVector<QVector<QPointF> > *privateSamples;
53  QVector<QVector<double> > *sampleData;
54 
55  EcgCapture *ecg;
56 
57 
58  int sampleRate;
59  int Fs;
60  int sourceId;
61  int channelId;
62  int counter,counterII;
63  bool stopThread;
64  double prevTime;
65  double prevVal;
66  double sleepInterval;
67 
68  QString fileName;
69  QString fileType;
70  QElapsedTimer clock;
71 
76  void sample(double,DataStream&);
77  void saveAsText();
78  void saveAsBDF();
79 
80 };
81 
84 #endif // SAMPLINGTHREAD_H
void setChannel(int)
virtual void run()
void setFileName(QString)
void setFileType(QString)
Responsible for communication with ADAS.
Definition: ecgcapture.h:24
DeviceInterface Class responsible for sampling ECG.
virtual void getData(DataStream &)
Populates DataStream vector with values.
SamplingThread(DataStream &inputStream)
Abstract Interface that should be used for storing data in the memory.
Definition: datastream.h:16
virtual void close()
Closes the connection to bcm2835.
virtual bool connected()
Boolean for check whether the device is connected<.
Abstract interface for all devices.
virtual void stop()
virtual ~SamplingThread()