当前位置: 首页>>代码示例>>Python>>正文


Python DeviceServer.initServer方法代码示例

本文整理汇总了Python中labrad.devices.DeviceServer.initServer方法的典型用法代码示例。如果您正苦于以下问题:Python DeviceServer.initServer方法的具体用法?Python DeviceServer.initServer怎么用?Python DeviceServer.initServer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在labrad.devices.DeviceServer的用法示例。


在下文中一共展示了DeviceServer.initServer方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: initServer

# 需要导入模块: from labrad.devices import DeviceServer [as 别名]
# 或者: from labrad.devices.DeviceServer import initServer [as 别名]
 def initServer(self):
     """This method loads default settings from the registry,
        sets up instruments, and sets up listeners for GPIB device 
        connect/disconnect messages."""
     DeviceServer.initServer(self)
     try:
         yield self.client.registry.cd(self.ADRSettingsPath)
         self.file_path = yield self.client.registry.get('Log Path')
     except Exception as e:
         self.logMessage( '{Saving log failed.  Check that AFS is working.} ' )
     yield self.loadDefaults()
     yield util.wakeupCall( 3 ) # on the round ADR, the HP DMM takes forever to initialize.  This prevents it from going on before it is ready.
     yield self.initializeInstruments()
     # subscribe to messages
     # the server ones are not used right now, but at some point they could be
     connect_func = lambda c, (s, payload): self.gpib_device_connect(*payload)
     disconnect_func = lambda c, (s, payload): self.gpib_device_disconnect(*payload)
     serv_conn_func = lambda c, (s, payload): self.serversChanged(*payload)
     serv_disconn_func = lambda c, (s, payload): self.serversChanged(*payload)
     mgr = self.client.manager
     self._cxn.addListener(connect_func, source=mgr.ID, ID=10)
     self._cxn.addListener(disconnect_func, source=mgr.ID, ID=11)
     self._cxn.addListener(serv_conn_func, source=mgr.ID, ID=12)
     self._cxn.addListener(serv_disconn_func, source=mgr.ID, ID=13)
     yield mgr.subscribe_to_named_message('GPIB Device Connect', 10, True)
     yield mgr.subscribe_to_named_message('GPIB Device Disconnect', 11, True)
     yield mgr.subscribe_to_named_message('Server Connect', 12, True)
     yield mgr.subscribe_to_named_message('Server Disconnect', 13, True)
     self.updateState()
开发者ID:McDermott-Group,项目名称:LabRAD,代码行数:31,代码来源:ADRServer.py

示例2: initServer

# 需要导入模块: from labrad.devices import DeviceServer [as 别名]
# 或者: from labrad.devices.DeviceServer import initServer [as 别名]
 def initServer(self):
     print 'loading config info...',
     self.reg = self.client.registry()
     yield self.loadConfigInfo()
     print 'done.'
     print self.serialLinks
     yield DeviceServer.initServer(self)
开发者ID:afylab,项目名称:afyservers,代码行数:9,代码来源:lakeshore_350.py

示例3: initServer

# 需要导入模块: from labrad.devices import DeviceServer [as 别名]
# 或者: from labrad.devices.DeviceServer import initServer [as 别名]
 def initServer(self):
     print 'Loading config from registry...',
     self.reg = self.client.registry()
     yield self.loadConfigInfo()
     print 'Finished.'
     print("Serial links found: %s"%str(self.serialLinks))
     yield DeviceServer.initServer(self)
开发者ID:ckometter,项目名称:afyservers,代码行数:9,代码来源:ad5764_dcbox.py

示例4: initServer

# 需要导入模块: from labrad.devices import DeviceServer [as 别名]
# 或者: from labrad.devices.DeviceServer import initServer [as 别名]
 def initServer(self):
     """Initializes the server"""
     print("Server initializing")        
     self.reg = self.client.registry()
     yield self.loadConfigInfo()
     yield DeviceServer.initServer(self)
     # Set the maximum acceptible pressures. This is a list
     # of 6 values corresponding to the 6 sensors.
     # Index 0 of thresholdMax corresponds to the maximum acceptible
     # value of sensor 1 and index 5, sensor 6. Likewise, index 0 of
     # thresholdMin corresponds to sensor 1.
     # These values can be left as is (default) or they can be changed
     # using the set_thresholds setting.
     # In order to use the setting, type:
     #   [instance name].set_thresholds([low], [high])
     # As an example:
     #   vacuum.set_thresholds([0, 0, 0, 5E-5, 5E-5, 5E-5],
     #                         [0, 0, 0, 5E-4, 5E-4, 5E-4])
     # It is a good idea to allow for a wide range of values if you
     # know that a sensor is not connected because the unit sometimes
     # misreports status codes. This makes it seem as though a sensor
     # is connected, and a 'don't-care' value is treated as an error.
     self.thresholdMax = [1e-2, 1e-2, 1e-2, 5e-7, 5e-7, 1e-4] * units.bar
     # Set the minimum acceptible pressures.
     self.thresholdMin = [0, 0, 0, 5E-8, 5E-8, 5E-8] * units.bar
     self.alertInterval = 10 # seconds
     self.measurements = [0, 0, 0, 0, 0, 0] * units.bar
     self.statusCodes = [0, 0, 0, 0, 0, 0]
     self.t1 = [0,0,0,0,0,0]
     self.t2 = [0,0,0,0,0,0]
开发者ID:McDermott-Group,项目名称:servers,代码行数:32,代码来源:pfeiffer_vacuum_maxigauge.py

示例5: initServer

# 需要导入模块: from labrad.devices import DeviceServer [as 别名]
# 或者: from labrad.devices.DeviceServer import initServer [as 别名]
 def initServer(self):
     self.output = None
     self.current = None
     print 'loading config info...',
     self.reg = self.client.registry()
     yield self.loadConfigInfo()
     print self.serialLinks
     yield DeviceServer.initServer(self)
开发者ID:barium-project,项目名称:barium,代码行数:10,代码来源:current_controller_server.py

示例6: initServer

# 需要导入模块: from labrad.devices import DeviceServer [as 别名]
# 或者: from labrad.devices.DeviceServer import initServer [as 别名]
 def initServer(self):
     """
     Makes a connection to the registry where port information and other server
     specific settings can be retrieved.
     """
     print 'loading config info...',
     self.reg = self.client.registry()
     yield self.loadConfigInfo()
     yield DeviceServer.initServer(self)  # starts server after configurations loaded
开发者ID:CampbellGroup,项目名称:common,代码行数:11,代码来源:stepper_motor_server.py

示例7: initServer

# 需要导入模块: from labrad.devices import DeviceServer [as 别名]
# 或者: from labrad.devices.DeviceServer import initServer [as 别名]
 def initServer(self):
     """Initialize the Temperature Monitor Server"""
     print "Server Initializing"
     self.reg = self.client.registry()
     yield self.loadConfigInfo()
     yield DeviceServer.initServer(self)
     # Set the maximum acceptible temperature.
     self.thresholdMax = 50 * units.degF
     # Set the minimum acceptible temperature.
     self.thresholdMin = 30 * units.degF
     self.alertInterval = 10 # seconds
     self.t1 = 0
     self.t2 = 0
开发者ID:McDermott-Group,项目名称:servers,代码行数:15,代码来源:omega_temperature_monitor.py

示例8: initServer

# 需要导入模块: from labrad.devices import DeviceServer [as 别名]
# 或者: from labrad.devices.DeviceServer import initServer [as 别名]
 def initServer(self):
     """Initializes the server"""
     print("Server Initializing...")        
     self.reg = self.client.registry()
     yield self.loadConfigInfo()
     yield DeviceServer.initServer(self)
     # Set the maximum acceptible flow rate.
     self.thresholdMax = 5 * units.galUS / units.min
     # Set the minimum acceptible flow rate.
     self.thresholdMin = 1.5* units.galUS / units.min
     self.alertInterval = 10 # seconds
     self.t1 = 0
     self.t2 = 0
开发者ID:McDermott-Group,项目名称:servers,代码行数:15,代码来源:omega_ratemeter.py

示例9: initServer

# 需要导入模块: from labrad.devices import DeviceServer [as 别名]
# 或者: from labrad.devices.DeviceServer import initServer [as 别名]
    def initServer(self):
        """
        This method loads default settings from the registry,
        sets up instruments, and sets up listeners for GPIB device
        connect/disconnect messages.
        """
        yield DeviceServer.initServer(self)
        try:
            yield self.client.registry.cd(self.ADRSettingsPath)
            self.file_path = yield self.client.registry.get('Log Path')
        except Exception as e:
            self.logMessage('{Saving log failed. '
                            ' Check that AFS is working.} ')
        yield self.loadDefaults()
        yield self.initializeInstruments()
        # subscribe to messages
        # the server ones are not used right now, but at some point they could be
        serv_conn_func = lambda c, (s, payload): self.serversChanged(*payload)
        serv_disconn_func = lambda c, (s, payload): self.serversChanged(*payload)
        mgr = self.client.manager
        self._cxn.addListener(serv_conn_func, source=mgr.ID, ID=12)
        self._cxn.addListener(serv_disconn_func, source=mgr.ID, ID=13)
        yield mgr.subscribe_to_named_message('Server Connect', 12, True)
        yield mgr.subscribe_to_named_message('Server Disconnect', 13, True)

        # listen for device connect/disconnect signals
        dev_con_changed = lambda c, payload: self.device_connection_changed(*payload)
        try: # in case the device manager is not running
             # &&& do this whenever device manager starts or something?
            devManager = self.client.gpib_device_manager
            yield devManager.device_connection_changed(self.ID)
            yield devManager.addListener(listener = dev_con_changed,
                                         source = None,
                                         ID = self.ID)
        except Exception as e:
            print str(e)
        self.updateState()
开发者ID:McDermott-Group,项目名称:servers,代码行数:39,代码来源:adr_server.py

示例10: initServer

# 需要导入模块: from labrad.devices import DeviceServer [as 别名]
# 或者: from labrad.devices.DeviceServer import initServer [as 别名]
 def initServer(self):
     print "Server Initializing"
     self.reg = self.client.registry()
     yield self.loadConfigInfo()
     yield DeviceServer.initServer(self)
开发者ID:McDermott-Group,项目名称:servers,代码行数:7,代码来源:LaserEndpointMonitor.py

示例11: initServer

# 需要导入模块: from labrad.devices import DeviceServer [as 别名]
# 或者: from labrad.devices.DeviceServer import initServer [as 别名]
 def initServer(self):
     print 'loading config info...',
     self.reg = self.client.registry()
     yield self.loadConfigInfo()
     yield self.reg.cd(['', 'settings'], True)
     yield DeviceServer.initServer(self)
开发者ID:CampbellGroup,项目名称:common,代码行数:8,代码来源:UCLA_piezo_server.py

示例12: initServer

# 需要导入模块: from labrad.devices import DeviceServer [as 别名]
# 或者: from labrad.devices.DeviceServer import initServer [as 别名]
 def initServer(self):
     print 'loading config info...',
     yield self.loadConfigInfo()
     print 'done.'
     yield DeviceServer.initServer(self)
开发者ID:McDermott-Group,项目名称:servers,代码行数:7,代码来源:dc_rack_server.py

示例13: initServer

# 需要导入模块: from labrad.devices import DeviceServer [as 别名]
# 或者: from labrad.devices.DeviceServer import initServer [as 别名]
 def initServer(self):
     print 'loading config info...',
     self.reg = self.client.registry()
     yield self.loadConfigInfo()
     yield DeviceServer.initServer(self)
开发者ID:CampbellGroup,项目名称:common,代码行数:7,代码来源:evPumpServer.py

示例14: initServer

# 需要导入模块: from labrad.devices import DeviceServer [as 别名]
# 或者: from labrad.devices.DeviceServer import initServer [as 别名]
 def initServer(self):
     print("Server <%s> of type <%s>"%(self.name,self.deviceName))
     self.reg = self.client.registry()
     yield self.loadConfigInfo()
     print(self.serialLinks)
     yield DeviceServer.initServer(self)
开发者ID:afylab,项目名称:afyservers,代码行数:8,代码来源:ad9854_acbox.py

示例15: initServer

# 需要导入模块: from labrad.devices import DeviceServer [as 别名]
# 或者: from labrad.devices.DeviceServer import initServer [as 别名]
 def initServer(self):
     '''Initialize the MKSPDR2000 server.'''
     print "Server Initializing"
     self.reg = self.client.registry()
     yield self.loadConfigInfo()
     yield DeviceServer.initServer(self)
开发者ID:McDermott-Group,项目名称:servers,代码行数:8,代码来源:MKSPDR2000.py


注:本文中的labrad.devices.DeviceServer.initServer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。