MNE-CPP  beta 1.0
ecgsimulator.h
Go to the documentation of this file.
1 //=============================================================================================================
36 #ifndef ECGSIMULATOR_H
37 #define ECGSIMULATOR_H
38 
39 
40 //*************************************************************************************************************
41 //=============================================================================================================
42 // INCLUDES
43 //=============================================================================================================
44 
45 #include "ecgsimulator_global.h"
46 
47 #include "ecgsimchannel.h"
48 
52 
53 
54 //*************************************************************************************************************
55 //=============================================================================================================
56 // QT STL INCLUDES
57 //=============================================================================================================
58 
59 #include <QtWidgets>
60 #include <QVector>
61 
62 
63 //*************************************************************************************************************
64 //=============================================================================================================
65 // DEFINE NAMESPACE ECGSimulatorPlugin
66 //=============================================================================================================
67 
68 namespace ECGSimulatorPlugin
69 {
70 
71 
72 //*************************************************************************************************************
73 //=============================================================================================================
74 // USED NAMESPACES
75 //=============================================================================================================
76 
77 using namespace MNEX;
78 using namespace XMEASLIB;
79 using namespace IOBuffer;
80 
81 
82 //*************************************************************************************************************
83 //=============================================================================================================
84 // FORWARD DECLARATIONS
85 //=============================================================================================================
86 
87 class ECGProducer;
88 //class ECGChannel;
89 
90 
91 //=============================================================================================================
98 {
99  Q_OBJECT
100  Q_PLUGIN_METADATA(IID "mne_x/1.0" FILE "ecgsimulator.json") //NEw Qt5 Plugin system replaces Q_EXPORT_PLUGIN2 macro
101  // Use the Q_INTERFACES() macro to tell Qt's meta-object system about the interfaces
102  Q_INTERFACES(MNEX::ISensor)
103 
104  friend class ECGProducer;
105  friend class ECGSetupWidget;
106 
107 public:
108  //=========================================================================================================
112  ECGSimulator();
113 
114  //=========================================================================================================
118  virtual ~ECGSimulator();
119 
120  //=========================================================================================================
124  virtual QSharedPointer<IPlugin> clone() const;
125 
126  //=========================================================================================================
130  virtual void init();
131 
132  //=========================================================================================================
136  virtual void unload();
137 
138  //=========================================================================================================
142  void initChannels();
143 
144 
145  virtual bool start();
146  virtual bool stop();
147 
148  virtual IPlugin::PluginType getType() const;
149  virtual QString getName() const;
150 
151  virtual QWidget* setupWidget();
152 
153  //=========================================================================================================
159  QString getResourcePath() const {return m_qStringResourcePath;}
160 
161 protected:
162  virtual void run();
163 
164 private:
169  float m_fSamplingRate;
170  int m_iDownsamplingFactor;
171  dBuffer::SPtr m_pInBuffer_I;
172  dBuffer::SPtr m_pInBuffer_II;
173  dBuffer::SPtr m_pInBuffer_III;
174  QSharedPointer<ECGProducer> m_pECGProducer;
176  QString m_qStringResourcePath;
178  ECGSimChannel::SPtr m_pECGChannel_ECG_I;
179  ECGSimChannel::SPtr m_pECGChannel_ECG_II;
180  ECGSimChannel::SPtr m_pECGChannel_ECG_III;
182  bool m_bIsRunning;
184 };
185 
186 } // NAMESPACE
187 
188 #endif // ECGSIMULATOR_H
The ECGSimulator class provides a ECG simulator.
Definition: ecgsimulator.h:97
QSharedPointer< PluginOutputData< T > > SPtr
The ISensor class provides an interface for a sensor plugin.
Definition: ISensor.h:63
The ECGProducer class provides a ECG data producer for a given sampling rate.
Definition: ecgproducer.h:87
#define ECGSIMULATORSHARED_EXPORT
Contains the declaration of the ECGChannel class.
Contains the ECGSimulator library export/import macros.
Contains the declaration of the NewRealTimeSampleArray class.
Definition: arrow.h:75
CircularBuffer class declaration.
The ECGSetupWidget class provides the ECG configuration window.
Contains declaration of IIinverseAlgorithm interface class.
QSharedPointer< ECGSimChannel > SPtr
Definition: ecgsimchannel.h:87