MNE-CPP  beta 1.0
eegosports.h
Go to the documentation of this file.
1 //=============================================================================================================
37 #ifndef EEGOSPORTS_H
38 #define EEGOSPORTS_H
39 
40 
41 //*************************************************************************************************************
42 //=============================================================================================================
43 // INCLUDES
44 //=============================================================================================================
45 #include <iostream>
46 #include <fstream>
47 #include <direct.h>
48 
49 #include "eegosports_global.h"
50 
54 
55 #include <utils/layoutloader.h>
56 
57 #include <unsupported/Eigen/FFT>
58 #include <Eigen/Geometry>
59 
60 
61 //*************************************************************************************************************
62 //=============================================================================================================
63 // QT STL INCLUDES
64 //=============================================================================================================
65 
66 #include <QtWidgets>
67 #include <QVector>
68 #include <QTime>
69 #include <QtConcurrent/QtConcurrent>
70 
73 
74 
75 //*************************************************************************************************************
76 //=============================================================================================================
77 // FIFF INCLUDES
78 //=============================================================================================================
79 
80 #include <fiff/fiff.h>
81 
82 
83 //*************************************************************************************************************
84 //=============================================================================================================
85 // DEFINE NAMESPACE EEGoSportsPlugin
86 //=============================================================================================================
87 
88 namespace EEGoSportsPlugin
89 {
90 
91 
92 //*************************************************************************************************************
93 //=============================================================================================================
94 // USED NAMESPACES
95 //=============================================================================================================
96 
97 using namespace MNEX;
98 using namespace XMEASLIB;
99 using namespace IOBuffer;
100 using namespace FIFFLIB;
101 using namespace std;
102 using namespace UTILSLIB;
103 using namespace Eigen;
104 
105 
106 //*************************************************************************************************************
107 //=============================================================================================================
108 // FORWARD DECLARATIONS
109 //=============================================================================================================
110 
111 class EEGoSportsProducer;
112 
113 
114 //=============================================================================================================
121 {
122  Q_OBJECT
123  Q_PLUGIN_METADATA(IID "mne_x/1.0" FILE "eegosports.json") //NEw Qt5 Plugin system replaces Q_EXPORT_PLUGIN2 macro
124  // Use the Q_INTERFACES() macro to tell Qt's meta-object system about the interfaces
125  Q_INTERFACES(MNEX::ISensor)
126 
127  friend class EEGoSportsProducer;
128  friend class EEGoSportsSetupWidget;
129  friend class EEGoSportsImpedanceWidget;
130  friend class EEGoSportsSetupProjectWidget;
131 
132 public:
133  //=========================================================================================================
137  EEGoSports();
138 
139  //=========================================================================================================
143  virtual ~EEGoSports();
144 
145  //=========================================================================================================
149  virtual QSharedPointer<IPlugin> clone() const;
150 
151  //=========================================================================================================
155  virtual void init();
156 
157  //=========================================================================================================
161  virtual void unload();
162 
163  //=========================================================================================================
167  void setUpFiffInfo();
168 
169  //=========================================================================================================
173  virtual bool start();
174 
175  //=========================================================================================================
179  virtual bool stop();
180 
181  //=========================================================================================================
185  void setSampleData(MatrixXf &matRawBuffer);
186 
187  virtual IPlugin::PluginType getType() const;
188  virtual QString getName() const;
189 
190  virtual QWidget* setupWidget();
191 
192 protected:
193  //=========================================================================================================
199  virtual void run();
200 
201  //=========================================================================================================
205  void showSetupProjectDialog();
206 
207  //=========================================================================================================
211  void showStartRecording();
212 
213  //=========================================================================================================
217  void changeRecordingButton();
218 
219  //=========================================================================================================
223  bool dirExists(const std::string& dirName_in);
224 
225 private:
227  QSharedPointer<EEGoSportsSetupProjectWidget> m_pEEGoSportsSetupProjectWidget;
229  QString m_qStringResourcePath;
231  int m_iSamplingFreq;
232  int m_iNumberOfChannels;
233  int m_iSamplesPerBlock;
235  int m_iTriggerInterval;
236  QTime m_qTimerTrigger;
238  bool m_bUseChExponent;
239  bool m_bWriteToFile;
240  bool m_bWriteDriverDebugToFile;
241  bool m_bUseFiltering;
242  bool m_bIsRunning;
243  bool m_bBeepTrigger;
244  bool m_bCheckImpedances;
246  ofstream m_outputFileStream;
247  QString m_sOutputFilePath;
248  QString m_sElcFilePath;
249  QFile m_fileOut;
250  FiffStream::SPtr m_pOutfid;
251  QSharedPointer<FiffInfo> m_pFiffInfo;
252  RowVectorXd m_cals;
253 
254  QSharedPointer<RawMatrixBuffer> m_pRawMatrixBuffer_In;
256  QSharedPointer<EEGoSportsProducer> m_pEEGoSportsProducer;
258  MatrixXf m_matOldMatrix;
260  QMutex m_qMutex;
262  QAction* m_pActionSetupProject;
263  QAction* m_pActionStartRecording;
265  QSharedPointer<QTimer> m_pTimerRecordingChange;
266  qint16 m_iBlinkStatus;
268  QList<MatrixXf> m_qListReceivedSamples;
270  QMutex m_mutex;
271 
272 };
273 
274 } // NAMESPACE
275 
276 #endif // EEGOSPORTS_H
Contains the EEGoSports library export/import macros.
CircularMatrixBuffer class declaration.
The EEGProducer class provides a EEG data producer for a given sampling rate.
#define EEGOSPORTSSHARED_EXPORT
The EEGoSportsSetupWidget class provides the EEGoSports configuration window.
QSharedPointer< PluginOutputData< T > > SPtr
The EEGoSportsSetupProjectWidget class provides the EEGoSportsSetupProjectWidget configuration window...
The ISensor class provides an interface for a sensor plugin.
Definition: ISensor.h:63
QSharedPointer< FiffStream > SPtr
Definition: fiff_stream.h:132
Definition: arrow.h:75
Contains the declaration of the EEGoSportsSetupProjectWidget class.
Definition: fiff.h:98
Contains the declaration of the NewRealTimeMultiSampleArray class.
LayoutLoader class declaration.
The EEGoSports class provides a EEG connector. In order for this plugin to work properly the driver d...
Definition: eegosports.h:120
FIFF class declaration, which provides static wrapper functions to stay consistent with mne matlab to...
Contains the declaration of the EEGoSportsSetupWidget class.
Contains declaration of IIinverseAlgorithm interface class.