gpib_device_manager.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:barium 作者: barium-project 项目源码 文件源码
def refreshDeviceLists(self):
        """Ask all GPIB bus servers for their available GPIB devices."""
        servers = [s for n, s in self.client.servers.items()
                     if (('GPIB Bus' in n) or ('gpib_bus' in n)) and \
                        (('List Devices' in s.settings) or \
                         ('list_devices' in s.settings))]
        serverNames = [s.name for s in servers]
        print 'Pinging servers:', serverNames
        resp = yield DeferredList([s.list_devices() for s in servers])
        for serverName, (success, addrs) in zip(serverNames, resp):
            if not success:
                print 'Failed to get device list for:', serverName
            else:
                print 'Server %s has devices: %s' % (serverName, addrs)
                for addr in addrs:
                    self.gpib_device_connect(serverName, addr)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号