BioSignalPi  v2
plotandcapturewidget.h
Go to the documentation of this file.
1 /*
2  * plotandcapturewidget.h
3  *
4  * Created on: Oct 29, 2015
5  * Author: martin
6  */
7 
8 #ifndef PLOTANDCAPTUREWIDGET_H_
9 #define PLOTANDCAPTUREWIDGET_H_
10 
11 #include <QtWidgets>
12 #include <QString>
13 #include <qwt_plot.h>
14 #include <QElapsedTimer>
15 #include "devicemanager.h"
16 #include "datalogger.h"
17 #include "datastream.h"
18 
19 
20 class QLabel;
21 class QPushButton;
22 class Plot;
23 
31 class PlotAndCaptureWidget: public QWidget {
32 
33  Q_OBJECT
34 
35 public:
36  PlotAndCaptureWidget(QWidget * = NULL);
37  virtual ~PlotAndCaptureWidget();
38  void plotSample(double);
39 
40 
41 
42 public slots:
43  void startCapture();
44  void stopCapture();
45  void plotSampleVector(QVector<QVector<QPointF> >);
46  void updateStatus(QString);
47 
53  void takeScreen();
54 
55 
56 
57 private:
58  void setupComponents();
59  void setupActions();
60  void setupLayout();
61 
62  QGroupBox *sampleRateControlGroup;
63  QGroupBox *sourceControlGroup;
64  QGroupBox *channelControlGroup;
65  QPushButton *startButton;
66  QPushButton *stopButton;
67  QPushButton *applySettingsButton;
68  QPushButton *takeScreenshot;
69  QButtonGroup *channelControlButtonGroup;
70  QLabel *currentStatusLabel;
71  QLineEdit *nameTextBox;
72  QLineEdit *recordingNameTextBox;
73 
74  QElapsedTimer d_clock;
75  double currentTime;
76  double timeInterval;
77 
78  DeviceManager* device;
79  DataStream* stream;
80  DataLogger* logger;
81 
82 
83 
84  int counter, plottedPoints, loopCounter;
85  QRadioButton *leadIButton, *leadIIButton, *leadIIIButton, *respButton;
86 
87 
88  QVector<Plot *> d_plots;
89 
90 
91 };
92 
93 #endif /* PLOTANDCAPTUREWIDGET_H_ */
void stopCapture()
Stop the ECG capture, this will stop the sampling thread so no more samples will be collected...
PlotAndCaptureWidget(QWidget *=NULL)
Extension of QwtPlot used for plotting data.
Definition: plot.h:14
The DataLogger class.
Definition: datalogger.h:16
void plotSampleVector(QVector< QVector< QPointF > >)
void takeScreen()
Take a snapshot of the PLOT.
Widget used for capture and plotting of data from the connected DeviceManager.
Abstract Interface that should be used for storing data in the memory.
Definition: datastream.h:16
void plotSample(double)
Handles which device to connect through the DeviceInterface.
Definition: devicemanager.h:23