(self, source=None)
return
Do not call explicitly, called upon initialization of class
Do not call explicitly, called upon initialization of class
Do not call explicitly called upon initialization of class
def run(self, source=None):
        """Do not call explicitly, called upon initialization of class"""
        if self.platform == 'Windows':
            source.set_raw_data_handler(self.data_handler)
            source.open()
        self.lock.acquire()
        while self.running:
            self.lock.release()
            if not self.platform == 'Windows':
                try:
                    if not self._stop_signal:
                        data = read_platform[self.platform](source, new_format=self.new_format)
                        self.data.put_nowait(EmotivReaderTask(data=data, timestamp=datetime.now()))
                except Exception as ex:

                    print("Reader Error: {}".format(ex.message))
                    # Catching StopIteration for some reason stops at the second record,
                    #  even though there are more results.
            else:
                time.sleep(0.00001)
            self.lock.acquire()
            if self._stop_signal:
                print("Reader stopping...")
                self.running = False
        if self.file is not None:
            self.file.close()
        if type(source) != int and type(source) != list:
            source.close()
        if self.hid is not None:
            if type(self.hid) != int:
                self.hid.close()
        if system_platform != "Windows":
            try:
                hidapi.hid_close(source)
            except Exception:
                pass
            try:
                hidapi.hid_exit()
            except Exception:
                pass
        print("Reader stopped...")
        self.stopped = True
        return
def run ( self , source = None ) : if self . platform == 'Windows' : source . set_raw_data_handler ( self . data_handler ) source . open ( ) self . lock . acquire ( ) while self . running : self . lock . release ( ) if not self . platform == 'Windows' : try : if not self . _stop_signal : data = read_platform [ self . platform ] ( source , new_format = self . new_format ) self . data . put_nowait ( EmotivReaderTask ( data = data , timestamp = datetime . now ( ) ) ) except Exception as ex : print ( "Reader Error: {}" . format ( ex . message ) ) # Catching StopIteration for some reason stops at the second record, #  even though there are more results. else : time . sleep ( 0.00001 ) self . lock . acquire ( ) if self . _stop_signal : print ( "Reader stopping..." ) self . running = False if self . file is not None : self . file . close ( ) if type ( source ) != int and type ( source ) != list : source . close ( ) if self . hid is not None : if type ( self . hid ) != int : self . hid . close ( ) if system_platform != "Windows" : try : hidapi . hid_close ( source ) except Exception : pass try : hidapi . hid_exit ( ) except Exception : pass print ( "Reader stopped..." ) self . stopped = True return