diff --git a/script/devices/StdDaq.py b/script/devices/StdDaq.py index a0a9949..5b3ad0c 100644 --- a/script/devices/StdDaq.py +++ b/script/devices/StdDaq.py @@ -22,6 +22,8 @@ class StdDaq(DeviceBase): def start(self, n_images, output_file): self.state.assertIs(State.Ready) + self.n_images=n_images + self.output_file=output_file if not self.simulated: data = {"sources":"eiger", "n_images":10, "output_file":"/tmp/test.h5"} headers = {'Content-type': 'application/json'} @@ -45,14 +47,18 @@ class StdDaq(DeviceBase): self.setState(State.Ready) def monitor(self): - count=0 + done = False + start=time.time() + timeout = 5 if self.simulated else -1 while self.getState()==State.Busy: - time.sleep(1.0) - count=count+1 - if count==3: - print "Ok" + if (timeout >=0) and ((time.time()-start)>=timeout): + done = True + if not self.simulated: + pass #TODO: Check Status + if done: self.setCache(None, None) self.setState(State.Ready) + time.sleep(0.2) def get_config(self):