37 #include "babymeginfo.h"
52 emit SendCMDPackage(DATA);
59 emit SendDataPackage(DATA);
70 for(qint32 i=0;i<cmdstr.size();i++)
92 return cmdstr.mid(bPos,ePos-bPos);
104 for (qint32 i=0;i<cmdstr.size();i++)
109 QString t = cmdstr.mid(sp,ep-sp);
132 for(qint32 k =0; k<sList.size(); k++)
134 QString t = sList.at(k);
135 for (qint32 z=0;z<t.size();z++)
139 lm_ch_names.append(t.left(z));
152 QByteArray CMD = cmdstr.left(4);
159 cmdstr.remove(0,T.size());
164 cmdstr.remove(0,T.size());
166 dataLength = T.toInt();
169 cmdstr.remove(0,T.size());
171 sfreq = T.toDouble();
172 qDebug()<<
"[babyMEGinfo] chnNum:" << chnNum <<
"Data Length" <<dataLength<<
"sampling rate"<<sfreq;
190 m_FiffInfo.
sfreq = sfreq;
193 m_FiffInfo.
acq_pars = QString(
"BabyMEG");
197 m_FiffInfo.
nchan = chnNum;
200 for(qint32 i = 0; i < chnNum; i++)
204 t_ch.
ch_name = lm_ch_names.at(i);
210 t_ch.
loc.setZero(12,1);
212 QString type = t_ch.
ch_name.left(3);
216 else if (type ==
"EEG")
221 t_ch.
kind = FIFFV_MEG_CH;
222 t_ch.
unit = FIFF_UNIT_T;
227 t_ch.
kind = FIFFV_EEG_CH;
228 t_ch.
unit = FIFF_UNIT_V;
233 t_ch.
kind = FIFFV_MEG_CH;
234 t_ch.
unit = FIFF_UNIT_T;
240 m_FiffInfo.
chs.append(t_ch);
244 emit fiffInfoAvailable(m_FiffInfo);
254 if (g_queue.size() == g_maxlen) {
255 qDebug() <<
"g_queue is full, waiting!";
256 g_queueNotFull.wait(&g_mutex);
258 g_queue.enqueue(DataIn);
259 g_queueNotEmpty.wakeAll();
261 qDebug() <<
"Data In...[size="<<g_queue.size()<<
"]";
267 QMutexLocker locker(&g_mutex);
268 if (g_queue.isEmpty()) {
269 qDebug() <<
"g_queue empty, waiting!";
270 g_queueNotEmpty.wait(&g_mutex);
272 QByteArray val = g_queue.dequeue();
273 g_queueNotFull.wakeAll();
274 qDebug() <<
"Data Out...[size="<<g_queue.size()<<
"]";
void MGH_LM_Parse_Para(QByteArray cmdstr)
void MGH_LM_Get_Channel_Info(QByteArray cmdstr)
#define FIFFV_COIL_BABY_MAG
QByteArray MGH_LM_Get_Field(QByteArray cmdstr)
void EnQueue(QByteArray DataIn)
void MGH_LM_Send_DataPackage(QByteArray DATA)
void MGH_LM_Send_CMDPackage(QByteArray DATA)
Matrix< double, 12, 1, DontAlign > loc
QStringList MGH_LM_Exact_Single_Channel_Info(QByteArray cmdstr)