Updated is_at_target to accept calculated value from readback and not just an epics pv flag.
This commit is contained in:
@ -198,8 +198,14 @@ class AttocubeAxis(Adjustable):
|
|||||||
def is_moving(self):
|
def is_moving(self):
|
||||||
return self.pvs.moving_status.value == 1
|
return self.pvs.moving_status.value == 1
|
||||||
|
|
||||||
def is_at_target(self):
|
def is_at_target(self,from_pv=False,tolerance = 0.3):
|
||||||
|
"""Check whether target was reached.
|
||||||
|
If from_pv is True TARGET_REACHED_RB is used, else it's calculated as diffrence between the readback and set value within tolerance.
|
||||||
|
Default is False, because otherwise tolerance can only be set and read out as an integer."""
|
||||||
|
if from_pv == True:
|
||||||
return self.pvs.target_reached.value == 1
|
return self.pvs.target_reached.value == 1
|
||||||
|
else:
|
||||||
|
return abs( self.pvs.readback.get() - self.pvs.drive.get() ) < tolerance
|
||||||
|
|
||||||
def allow_move(self):
|
def allow_move(self):
|
||||||
self.pvs.move.put(1, wait=True)
|
self.pvs.move.put(1, wait=True)
|
||||||
|
Reference in New Issue
Block a user