def __init__(self, nodename, host, port, credential): """Initialize a NodeServer instance. Args: nodename (str): The name of this node, e.g. from the LABRADNODE environment variable. host (str): The host where the labrad manager is running. port (int): The port where the labrad manager is running. credential (labrad.auth.Password): Credentials for connecting to the labrad manager. """ LabradServer.__init__(self) self.nodename = nodename self.name = 'node %s' % nodename self.host = host self.port = port self.credential = credential # Mapping from server name to ServerConfig that describes how to launch # instances of the server. self.server_configs = {} # Mapping from instance name to ServerProcess object. Instances are # added to this mapping when they are successfully started and removed # when they send a message indicating that the server process has # stopped. self.instances = {}
def __init__(self, adapters=[]): LabradServer.__init__(self) # make a dictionary of adapters, indexable by id or name d = {} for i, adapter in enumerate(adapters): d[i] = d[adapter.name] = adapter self.adapters = d
def __init__(self): #Backward compatibility for servers that don't use a #deviceWrappers dict if not hasattr(self, 'deviceWrappers'): names = self.deviceName if isinstance(names, str): names = [names] self.deviceWrappers = dict((name, self.deviceWrapper) for name in names) LabradServer.__init__(self)
def __init__(self, configuration): LabradServer.__init__(self) self.digital_lock_state = False self.digital_lock_delayed_call = None self.load_configuration(configuration) self.init_pid() self.update = Signal(self.update_id, 'signal: update', 's')
def __init__(self, config_path='./config.json'): self.parameters = {} self.experiment_queue = deque([]) self.data = {} self.data_path = None self.do_print_delay = False self.do_debug = False self.load_config(config_path) LabradServer.__init__(self)
def __init__(self, nodename, host, port): LabradServer.__init__(self) self.nodename = nodename self.name = 'node %s' % nodename self.host = host self.port = port self.servers = {} self.instances = {} self.starters = {} self.runners = {} self.stoppers = {} self.initMessages(True)
def __init__(self, config_path='./config.json'): self.parameters = {} self.experiment_queue = deque([]) self.data = {} self.data_path = None self.do_print_delay = False self.load_config(config_path) LabradServer.__init__(self) # added KM 09/10/2017 self.advance_dict = {} self.advance_counter = 0
def __init__(self, session_store): LabradServer.__init__(self) self.session_store = session_store # session signals self.onNewDir = Signal(543617, 'signal: new dir', 's') self.onNewDataset = Signal(543618, 'signal: new dataset', 's') self.onTagsUpdated = Signal(543622, 'signal: tags updated', '*(s*s)*(s*s)') # dataset signals self.onDataAvailable = Signal(543619, 'signal: data available', '') self.onNewParameter = Signal(543620, 'signal: new parameter', '') self.onCommentsAvailable = Signal(543621, 'signal: comments available', '')
def __init__(self, name, uuid): LabradServer.__init__(self) self.name = name self.uuid = uuid self.server_list = {1: ServerConnection(1, 'Manager', 'The LabRAD Manager handles the interactions between parts of the LabRAD system.', '')} self.client_list = {} self.next_ID = 2 self.serverID_cache = {} # name -> ID self.context_cache = {} self.server_list[1].visible = True self.named_messages = {} for s in self._findSettingHandlers(): self._checkSettingConflicts(s) self.settings[s.ID] = s info = s.getRegistrationInfo() self.s__register_setting(None, *info)
def __init__(self, host, port, password, hub, path, session_store): LabradServer.__init__(self) self.host = host self.port = port self.password = password self.hub = hub self.path = path self.session_store = session_store self.alive = False # session signals self.onNewDir = Signal(543617, 'signal: new dir', 's') self.onNewDataset = Signal(543618, 'signal: new dataset', 's') self.onTagsUpdated = Signal(543622, 'signal: tags updated', '*(s*s)*(s*s)') # dataset signals self.onDataAvailable = Signal(543619, 'signal: data available', '') self.onNewParameter = Signal(543620, 'signal: new parameter', '') self.onCommentsAvailable = Signal(543621, 'signal: comments available', '')
def __init__(self, config_path='./config.json'): self.config = self.load_config(config_path) self.is_locked = False self.lock_status = False self.log_path = None pid_config = self.config['pid'] self.pid = PID(overall_gain=pid_config['overall_gain'], prop_gain=pid_config['prop_gain'], int_gain=pid_config['int_gain'], diff_gain=pid_config['diff_gain'], min_max=pid_config['range'], offset=pid_config['offset']) sa_config = self.config['spectrum_analyzer'] self.peak_threshold = sa_config['threshold'] self.capture_range = sa_config['capture_range'] self.lock_span = sa_config['lock_span'] self.name = '{}_comb_lock'.format(self.config['lock_name']) LabradServer.__init__(self)
def __init__(self): self.devices = {} self.context_device_ids = {} device_class = self.device_class for attribute_name in dir(device_class): attribute = getattr(device_class,attribute_name) if hasattr(attribute,DEVICE_SETTING): ds = attribute setattr( self, attribute_name, _device_setting( getattr( ds, DEVICE_SETTING_ID ), **getattr( ds, DEVICE_SETTING_PARAMS ) )(ds) ) if isinstance(attribute,DeviceSignal): device_signal = attribute signal = _DeviceSignal_( device_signal.ID, device_signal.name, device_signal.returns ) device_signal.signal=signal setattr( self, attribute_name, signal ) LabradServer.__init__(self)
def __init__(self): self.locked_settings = {} LabradServer.__init__(self)
def __init__(self, nodename, host, port): LabradServer.__init__(self) self.nodename = nodename self.name = 'node %s' % nodename self.host = host self.port = port
def __init__(self, config_path='./config.json'): self.config = self.load_config(config_path) LabradServer.__init__(self)
def __init__(self, modules, *args, **kwargs): self.initModules(modules) LabradServer.__init__(self, *args, **kwargs)
def __init__(self, registry_path): if not os.path.isdir(registry_path): os.mkdir(registry_path) # If only the last directory is missing, create it, else fail self.root_path = os.path.join(registry_path, '') LabradServer.__init__(self)
def __init__(self): LabradServer.__init__(self)