added proper waiting for the start of the move
This commit is contained in:
@@ -68,12 +68,22 @@ class SmarActAxis(Adjustable):
|
||||
stopper = lambda: self.pvs.stop.put(1)
|
||||
return self._as_task(change, stopper=stopper, hold=hold)
|
||||
|
||||
def _move(self, value, checktime=0.1):
|
||||
|
||||
def _move(self, value, checktime=0.1, timeout=60):
|
||||
timeout += time.time()
|
||||
|
||||
self.pvs.drive.put(value)
|
||||
time.sleep(checktime)
|
||||
|
||||
while not self.is_moving():
|
||||
time.sleep(checktime)
|
||||
if time.time() >= timeout:
|
||||
tname = typename(self)
|
||||
raise SmarActError(f"starting to move {tname} \"{self.name}\" to {value} {self.units} timed out")
|
||||
|
||||
while self.is_moving():
|
||||
time.sleep(checktime)
|
||||
|
||||
|
||||
def is_moving(self):
|
||||
"""
|
||||
0 : Stopped
|
||||
|
||||
Reference in New Issue
Block a user