def __init__(self, config): VoltaBox.__init__(self, config) self.source = config.get_option('volta', 'source') self.sample_rate = config.get_option('volta', 'sample_rate', 10000) self.chop_ratio = config.get_option('volta', 'chop_ratio') self.baud_rate = config.get_option('volta', 'baud_rate', 230400) self.grab_timeout = config.get_option('volta', 'grab_timeout') self.slope = config.get_option('volta', 'slope') self.offset = config.get_option('volta', 'offset') self.precision = config.get_option('volta', 'precision') self.power_voltage = config.get_option('volta', 'power_voltage') self.sample_swap = config.get_option('volta', 'sample_swap', False) # initialize data source try: self.source_opener = resource.get_opener(self.source) except: raise RuntimeError( 'Device %s not found. Please check VoltaBox USB connection', self.source) self.source_opener.baud_rate = self.baud_rate self.source_opener.read_timeout = self.grab_timeout self.data_source = self.source_opener() logger.debug('Data source initialized: %s', self.data_source) self.pipeline = None self.grabber_q = None self.process_currents = None
def __init__(self, config, core): VoltaBox.__init__(self, config, core) self.sample_rate = config.get_option('volta', 'sample_rate', 10000) self.baud_rate = config.get_option('volta', 'baud_rate', 230400) self.source_opener.baud_rate = self.baud_rate self.source_opener.read_timeout = self.grab_timeout self.data_source = self.source_opener() logger.debug('Data source initialized: %s', self.data_source) self.my_metrics = {} self.__create_my_metrics()
def __init__(self, config): VoltaBox.__init__(self, config) self.source = config.get('source', '/dev/cu.wchusbserial1420') self.sample_rate = config.get('sample_rate', 10000) self.chop_ratio = config.get('chop_ratio', 1) self.baud_rate = config.get('baud_rate', 230400) self.grab_timeout = config.get('grab_timeout', 1) # initialize data source self.source_opener = resource.get_opener(self.source) self.source_opener.baud_rate = self.baud_rate self.source_opener.read_timeout = self.grab_timeout self.data_source = self.source_opener() logger.debug('Data source initialized: %s', self.data_source)
def __init__(self, config): VoltaBox.__init__(self, config) self.source = config.get_option('volta', 'source') self.chop_ratio = config.get_option('volta', 'chop_ratio') self.sample_rate = config.get_option('volta', 'sample_rate', 500) self.baud_rate = config.get_option('volta', 'baud_rate', 115200) self.grab_timeout = config.get_option('volta', 'grab_timeout') # initialize data source self.source_opener = resource.get_opener(self.source) self.source_opener.baud_rate = self.baud_rate self.source_opener.read_timeout = self.grab_timeout self.data_source = self.source_opener() logger.debug('Data source initialized: %s', self.data_source) self.pipeline = None self.grabber_q = None self.process_currents = None