AndorServer.py 文件源码

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

项目:barium 作者: barium-project 项目源码 文件源码
def waitForKinetic(self, c, timeout = WithUnit(1,'s')):
        '''Waits until the given number of kinetic images are completed'''
        requestCalls = int(timeout['s'] / 0.050 ) #number of request calls
        for i in range(requestCalls):
            print 'acquiring: {}'.format(self.waitForKinetic.__name__)
            yield self.lock.acquire()
            try:
                print 'acquired : {}'.format(self.waitForKinetic.__name__)
                status = yield deferToThread(self.camera.get_status)
                #useful for debugging of how many iterations have been completed in case of missed trigger pulses
                a,b = yield deferToThread(self.camera.get_series_progress)
                print a,b
                print status
            finally:
                print 'releasing: {}'.format(self.waitForKinetic.__name__)
                self.lock.release()
            if status == 'DRV_IDLE':
                returnValue(True)
            yield self.wait(0.050)
        returnValue(False)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号