Example #1
0
    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 = {}
Example #2
0
    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 = {}
Example #3
0
 def __init__(self, config_path='./config.json'):
     self.is_locked = False
     self.task_state = False
     # self.lock_status = False
     # self.name = '{}_wlm_lock'.format(self.config['lock_name'])
     
     self.config = self.load_config(config_path)
     self.wlm_name = self.config['wlm_name']
     self.msquared_name = self.config['msquared_name']
     self.log_path = self.config['log_path']
     
     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'])
     self.pid.setpoint = pid_config['setpoint']
     
     wlm_config = self.config['wlm']
     self.wlm_channel = wlm_config['channel']
     self.wlm_units = wlm_config['units']
     
     LabradServer.__init__(self)
Example #4
0
    def __init__(self, config_path='./config.json'):
        LabradServer.__init__(self)
        self.devices = {}
        self.open_connections = {}
        self.quick_settings = []

        self.load_config(config_path)
Example #5
0
    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
Example #6
0
 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
Example #7
0
 def expireContext(self,c):
     for setting_id in [
             setting_id 
             for setting_id, context_id in 
             self.locked_settings.items() 
             if context_id == c.ID
     ]:            
         self._unlock_setting(setting_id)
     LabradServer.expireContext(self,c)
Example #8
0
 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)
Example #9
0
 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)
Example #10
0
    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')
Example #11
0
    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)
Example #12
0
 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)
Example #13
0
 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)
Example #14
0
    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
Example #15
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', '')
Example #16
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', '')
Example #17
0
 def initServer(self):
     self.IQcalsets = {}
     self.DACcalsets = {}
     print 'loading server settings...',
     self.loadServerSettings()
     print 'done.'
     yield LabradServer.initServer(self)
Example #18
0
 def initServer(self):
     self.IQcalsets = {}
     self.DACcalsets = {}
     print 'loading server settings...',
     self.loadServerSettings()
     print 'done.'
     yield LabradServer.initServer(self)
    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)
Example #20
0
    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', '')
Example #21
0
    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)
Example #22
0
 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)
Example #23
0
 def __init__(self, nodename, host, port):
     LabradServer.__init__(self)
     self.nodename = nodename
     self.name = 'node %s' % nodename
     self.host = host
     self.port = port
Example #24
0
    def __init__(self, config_path='./config.json'):
        self.config = self.load_config(config_path)

        LabradServer.__init__(self)
Example #25
0
    def __init__(self, modules, *args, **kwargs):
        self.initModules(modules)

        LabradServer.__init__(self, *args, **kwargs)
Example #26
0
 def __init__(self, nodename, host, port):
     LabradServer.__init__(self)
     self.nodename = nodename
     self.name = 'node %s' % nodename
     self.host = host
     self.port = port
Example #27
0
 def __init__(self):
     self.locked_settings = {}
     LabradServer.__init__(self)
    def __init__(self, config_path='./config.json'):
        self.config = self.load_config(config_path)

        LabradServer.__init__(self)
Example #29
0
 def expireContext(self, c):
     LabradServer.expireContext(self, c)
Example #30
0
    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)
Example #31
0
 def __init__(self):
     LabradServer.__init__(self)