def __init__(self, app):
     Thread.__init__(self) 
     ### APP REFERENCE ################
     self.app = app
     ### data ###########
     self.all_data_store = np.empty(shape=(self.app.constants.CHANNELS, 0))
     ########### SHARED QUEUE ###########
     self.app.slots.append(self.append_to_store)
     self.filter_bank = filter_bank_class(self.app.constants)
     self.filter_bank.update_filters()
     self.spectrum = spectrum(self.app.constants)
     ##### Mutex #####
     self.muttex = Lock()
 def __init__(self, constants, queue, buffer, slots):
     Thread.__init__(self) 
     ### data ###########
     self.constants = constants
     self.queue = queue
     self.slots = slots
     self.buffer = buffer
     self.all_data_store = np.empty(shape=(self.constants.CHANNELS, 0))
     ########### SHARED QUEUE ###########
     self.slots.append(self.append_to_store)
     self.filter_bank = filter_bank_class(self.constants)
     self.filter_bank.update_filters()
     self.spectrum = spectrum(self.constants)
     ##### Mutex #####
     self.muttex = Lock()
示例#3
0
 def __init__(self, app):
     Thread.__init__(self)  #Inicializa el hilo
     self.app = app  #Guarda la aplicación
     ### data ###########
     self.all_data_store = np.empty(
         shape=(self.app.constants.CHANNELS,
                0))  #Crea una matriz vacía con la forma:
     # filas = número de sensores/canales
     # columnas  = 0
     ########### SHARED QUEUE ###########
     self.app.slots.append(
         self.append_to_store)  #Introducir un callback en la lista
     self.filter_bank = filter_bank_class(
         self.app.constants)  #Enviar las constantes al filtro
     self.filter_bank.update_filters()
     self.spectrum = spectrum(
         self.app.constants)  #Enviar las constantes al espectro
     self.muttex = Lock()  #Asociar el mutex a una variable
 def __init__(self, queue):
     Thread.__init__(self)
     ### data ###########
     self.EEG_buffer = EEG_buffer()
     self.all_data_store = []
     self.queue = queue
     ########### SHARED QUEUE ###########
     self.filter_bank = filter_bank_class(self.EEG_buffer.LOWCUT,
                                          self.EEG_buffer.HIGHCUT,
                                          self.EEG_buffer.NOTCH,
                                          self.EEG_buffer.ORDER,
                                          self.EEG_buffer.SAMPLE_RATE)
     self.filter_bank.set_filters(self.EEG_buffer.LOWCUT,
                                  self.EEG_buffer.HIGHCUT)
     self.spectrum = spectrum(self.EEG_buffer.NDIMS,
                              self.EEG_buffer.SAMPLE_RATE)
     # -- flag --
     self.exit = Event()
     self.exit.set()
     ###### mutex lock
     self.mutexBuffer = Lock()