(self, display_output=False, serial_number=None, is_research=False, write=False,
                 write_encrypted=False, write_decrypted=False, write_values=True, input_source="emotiv",
                 sys_platform=system_platform, verbose=False, output_path=None, chunk_writes=True, chunk_size=32,
                 force_epoc_mode=False, force_old_crypto=False)
Sets up initial values.

        :param display_output - Should non-error output be displayed to console?
        :param serial_number - Specify serial_number, needed to decrypt packets for raw data reader and special cases.
        :param is_research - Is EPOC headset research edition? Doesn't seem to work even if it is.
        :param write - Write data to csv.
        :param write_encrypted - Write encrypted data, may impact read performance.
        :param write_values - Write decrypted sensor data, True overwrites exporting data from dongle pre-processing.
        :param input_source - Source to read from, emotiv or a file name
                   (must be a csv, exported from emokit or following our format)
        :param sys_platform - Operating system, to avoid global statement
        :param verbose - Detailed logging.
        :param output_path - The path to output data files to.
        :param chunk_writes - Write a chunk of data instead of a single line.
        :param chunk_size - The number of packets to buffer before writing.

        Expect performance to suffer when writing data to a csv, maybe.
Sets up initial values.
Sets up initial values .
def __init__(self, display_output=False, serial_number=None, is_research=False, write=False,
                 write_encrypted=False, write_decrypted=False, write_values=True, input_source="emotiv",
                 sys_platform=system_platform, verbose=False, output_path=None, chunk_writes=True, chunk_size=32,
                 force_epoc_mode=False, force_old_crypto=False):
        """
        Sets up initial values.

        :param display_output - Should non-error output be displayed to console?
        :param serial_number - Specify serial_number, needed to decrypt packets for raw data reader and special cases.
        :param is_research - Is EPOC headset research edition? Doesn't seem to work even if it is.
        :param write - Write data to csv.
        :param write_encrypted - Write encrypted data, may impact read performance.
        :param write_values - Write decrypted sensor data, True overwrites exporting data from dongle pre-processing.
        :param input_source - Source to read from, emotiv or a file name
                   (must be a csv, exported from emokit or following our format)
        :param sys_platform - Operating system, to avoid global statement
        :param verbose - Detailed logging.
        :param output_path - The path to output data files to.
        :param chunk_writes - Write a chunk of data instead of a single line.
        :param chunk_size - The number of packets to buffer before writing.

        Expect performance to suffer when writing data to a csv, maybe.

        """
        print("Initializing Emokit...")
        self.new_format = False
        self.running = False
        self.chunk_writes = chunk_writes
        self.chunk_size = chunk_size
        # Queue with EmotivPackets that have been received.
        self.packets = Queue()
        # Battery percent, as int.
        self.battery = 0
        # Display sensor values in console.
        self.display_output = display_output
        # Print details of operation in console, exceptions, etc.
        self.verbose = verbose
        # Should be True for research edition EPOCs and newer EPOC+s, apparently.
        self.is_research = is_research
        self.sensors = sensors_mapping
        # The EPOCs serial number.
        self.serial_number = serial_number
        # Only really applies to quality value calculation, probably needs some updating.
        self.old_model = False
        # Write data to disk.
        self.write = write
        # Assume we are going to read encrypted data from the headset.
        self.read_encrypted = True
        # Not used at the moment.
        self.read_values = False
        # Write the data received as is.
        self.write_encrypted = write_encrypted
        # Write the data received after decrypting it.
        self.write_decrypted = write_decrypted
        # Write values and quality values of each sensor.
        self.write_values = write_values
        # The current platform.
        self.platform = sys_platform
        # The number of times data was received.
        self.packets_received = 0
        # The number of times data was decrypted or made into EmotivPackets.
        self.packets_processed = 0
        # The source of the emotiv data.
        self.input_source = input_source
        # If the input source is not an emotiv headset, it is a file.
        self.reader = None
        self.lock = Lock()
        # Setup output writers, multiple types can be output now at once.
        self.encrypted_writer = None
        self.decrypted_writer = None
        self.value_writer = None
        self.output_path = output_path
        self.force_epoc_mode = force_epoc_mode
        self.force_old_crypto = force_old_crypto
        self.crypto = None
        # Setup the crypto thread, if we are reading from an encrypted data source.

        # Setup emokit loop thread. This thread coordinates the work done from the reader to be decrypted and queued
        # into EmotivPackets.
        self.output = None
        self.thread = Thread(target=self.run)
        self._stop_signal = False
        self.thread.setDaemon(True)
        self.start()
def __init__ ( self , display_output = False , serial_number = None , is_research = False , write = False , write_encrypted = False , write_decrypted = False , write_values = True , input_source = "emotiv" , sys_platform = system_platform , verbose = False , output_path = None , chunk_writes = True , chunk_size = 32 , force_epoc_mode = False , force_old_crypto = False ) : print ( "Initializing Emokit..." ) self . new_format = False self . running = False self . chunk_writes = chunk_writes self . chunk_size = chunk_size # Queue with EmotivPackets that have been received. self . packets = Queue ( ) # Battery percent, as int. self . battery = 0 # Display sensor values in console. self . display_output = display_output # Print details of operation in console, exceptions, etc. self . verbose = verbose # Should be True for research edition EPOCs and newer EPOC+s, apparently. self . is_research = is_research self . sensors = sensors_mapping # The EPOCs serial number. self . serial_number = serial_number # Only really applies to quality value calculation, probably needs some updating. self . old_model = False # Write data to disk. self . write = write # Assume we are going to read encrypted data from the headset. self . read_encrypted = True # Not used at the moment. self . read_values = False # Write the data received as is. self . write_encrypted = write_encrypted # Write the data received after decrypting it. self . write_decrypted = write_decrypted # Write values and quality values of each sensor. self . write_values = write_values # The current platform. self . platform = sys_platform # The number of times data was received. self . packets_received = 0 # The number of times data was decrypted or made into EmotivPackets. self . packets_processed = 0 # The source of the emotiv data. self . input_source = input_source # If the input source is not an emotiv headset, it is a file. self . reader = None self . lock = Lock ( ) # Setup output writers, multiple types can be output now at once. self . encrypted_writer = None self . decrypted_writer = None self . value_writer = None self . output_path = output_path self . force_epoc_mode = force_epoc_mode self . force_old_crypto = force_old_crypto self . crypto = None # Setup the crypto thread, if we are reading from an encrypted data source. # Setup emokit loop thread. This thread coordinates the work done from the reader to be decrypted and queued # into EmotivPackets. self . output = None self . thread = Thread ( target = self . run ) self . _stop_signal = False self . thread . setDaemon ( True ) self . start ( )