sig_chain时序图frontendfrontendrouter_eegrouter_eeg«Recriver»receiver«Recriver»receiver«Preprocess»preprocess«Preprocess»preprocess«Buffer»buffer_plot«Buffer»buffer_plot«Buffer»buffer_classify_online«Buffer»buffer_classify_online«Connecter»connecter«Connecter»connecter«Buffer»buffer_save«Buffer»buffer_savehardware_sdkhardware_sdk«Saver»saver«Saver»saverbuffer_saverbuffer_saver1s1s1sdelay_milliseconds = 0.5s主要逻辑websocket: xxx/eeg/data(get_wave_from_buffer)loop[直到 is_ready==False]buffer数据时长/2 s 后receive_waveNeuracleControllerReadDataalt[成功]NeuracleResult_Succeedref保存数据,并通知观察者True[失败]其它标志Falseget_data_from_bufferget_sigalt[数据够了]ret = {'data':data, 'status': 'ok', 'timestamp':timestamp}清空buffer[数据不够]ret = {'data':None, 'status': 'warn', 'timestamp':None}retalt[status == 'ok']opt[预处理]滤波、降采样之类目前已知问题是,如果buffer_plot 返回的数据长度不能被降采样率整除,返回的数据长度就不对!!{'eegdata':data}子模块详情保存数据,并通知观察者[_add_a_data_block_to_buffer]alt[满足保存条件(有buffer_save, 有saver, 且saver准备好了)]updateget_sig清空bufferalt[status == 'ok']save_raw_dataupdate前提是buffer_plot已加入connector的观察者列表,注意:buffer的长度不能低于每次取包的长度(即delay_millisecond), 否则一定丢失数据update前提是buffer_classify_online已加入connector的观察者列表,注意:buffer的长度不能低于每次取包的长度(即delay_millisecond), 否则一定丢失数据