MNE-CPP  beta 1.0
babymeg.h
1 //=============================================================================================================
37 #ifndef BABYMEG_H
38 #define BABYMEG_H
39 
40 //*************************************************************************************************************
41 //=============================================================================================================
42 // INCLUDES
43 //=============================================================================================================
44 
45 #include "babymeg_global.h"
46 
47 #include "babymegclient.h"
48 
49 
50 #include "../../mne_rt_server/IConnector.h"
51 
52 
53 
54 //*************************************************************************************************************
55 //=============================================================================================================
56 // MNE INCLUDES
57 //=============================================================================================================
58 
59 #include <fiff/fiff_raw_data.h>
61 
62 
63 //*************************************************************************************************************
64 //=============================================================================================================
65 // QT INCLUDES
66 //=============================================================================================================
67 
68 #include <QString>
69 #include <QMutex>
70 
71 
72 //*************************************************************************************************************
73 //=============================================================================================================
74 // DEFINE NAMESPACE BabyeMEGPlugin
75 //=============================================================================================================
76 
77 namespace BabyMEGPlugin
78 {
79 
80 
81 //*************************************************************************************************************
82 //=============================================================================================================
83 // USED NAMESPACES
84 //=============================================================================================================
85 
86 using namespace RTSERVER;
87 using namespace IOBuffer;
88 
89 //*************************************************************************************************************
90 //=============================================================================================================
91 // FORWARD DECLARATIONS
92 //=============================================================================================================
93 
94 
95 //=============================================================================================================
101 class BABYMEGSHARED_EXPORT BabyMEG : public IConnector
102 {
103  Q_OBJECT
104  Q_PLUGIN_METADATA(IID "mne_rt_server/1.0" FILE "babymeg.json") //NEw Qt5 Plugin system replaces Q_EXPORT_PLUGIN2 macro
105  // Use the Q_INTERFACES() macro to tell Qt's meta-object system about the interfaces
106  Q_INTERFACES(RTSERVER::IConnector)
107 
108 public:
109 
110  //=========================================================================================================
114  BabyMEG();
115 
116  //=========================================================================================================
120  virtual ~BabyMEG();
121 
122  virtual void connectCommandManager();
123 
124  virtual ConnectorID getConnectorID() const;
125 
126  virtual const char* getName() const;
127 
128  virtual void info(qint32 ID);
129 
130  virtual bool start();
131 
132  virtual bool stop();
133 
134 
135  void setFiffInfo(FIFFLIB::FiffInfo);
136  void setFiffData(QByteArray DATA);
137  void setCMDData(QByteArray DATA);
138 
139 protected:
140  virtual void run();
141 
142 private:
143 
144  //Slots
145  //=========================================================================================================
151  void comBufsize(Command p_command);
152 
153  //=========================================================================================================
159  void comGetBufsize(Command p_command);
160 
161  //=========================================================================================================
167  void comFLL(Command p_command);
168 
170 
171  //=========================================================================================================
175  void init();
176 
177  QMutex mutex;
178 
179 
180  BabyMEGClient *myClient;
181  BabyMEGClient *myClientComm;
182  BabyMEGInfo *pInfo;
183  bool DataStartFlag;
184 
185 
186  FiffInfo m_FiffInfoBabyMEG;
188  bool m_bIsRunning;
189 
190  // OLD Simulation stuff
191  FiffRawData m_RawInfo;
192  quint32 m_uiBufferSampleSize;
194  CircularMatrixBuffer<float>::SPtr m_pRawMatrixBuffer;
196 };
197 
198 } // NAMESPACE
199 
200 #endif // BABYMEG_H
FIFF measurement file information.
Definition: fiff_info.h:96
The BabyMEGClient class provides a TCP/IP communication between Qt and Labview.
Definition: babymeginfo.h:70
CircularMatrixBuffer class declaration.
The BabyMEG class provides a Fiff data simulator.
Definition: babymeg.h:101
The circular matrix buffer.
The IConnector class is the interface class of all plugins.
Definition: IConnector.h:119
FIFF raw measurement data.
Definition: fiff_raw_data.h:94
The BabyMEGClient class provides a TCP/IP communication between Qt and Labview.
Definition: babymegclient.h:70
FiffRawData class declaration.