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)
评论列表
文章目录