diff --git a/acquisition/ioxos_data.py b/acquisition/ioxos_data.py index e519187..61fe9c8 100644 --- a/acquisition/ioxos_data.py +++ b/acquisition/ioxos_data.py @@ -64,6 +64,7 @@ class Ioxostools: for (m, channel) in enumerate(channels): channel.add_callback(callback = cb_getdata, ch = channel, m=m) while True: + sleep(0.01) if np.mean(counters) == N_pulses-1: break diff --git a/xoptics/dcm.py b/xoptics/dcm.py index 627b6f6..41b91b1 100755 --- a/xoptics/dcm.py +++ b/xoptics/dcm.py @@ -1,5 +1,7 @@ from ..devices_general.motors import MotorRecord from epics import PV +from ..devices_general.utilities import Changer +from time import sleep class Double_Crystal_Mono: def __init__(self,Id): @@ -16,11 +18,17 @@ class Double_Crystal_Mono: self.moving = PV(Id+':MOVING') self._stop = PV(Id +':STOP.PROC') + def move_and_wait(self,value,checktime=.01): + self.energy_sp.put(value) + #sleep(.1) + while not self.moving: + sleep(checktime) + def changeTo(self,value): - self.energy_sp.put(value) + self.energy_sp.put(value) def stop(self): - self._stop.put(1) + self._stop.put(1) def get_current_value(self): currentenergy = self.energy_rbk.get()