mirror of
https://github.com/bec-project/ophyd_devices.git
synced 2025-05-31 00:50:40 +02:00
fixed bug fixed again (overwritten by import)
This commit is contained in:
parent
a23e197659
commit
8eff1f7638
@ -322,6 +322,7 @@ class SynAxisOPAAS(Device, PositionerBase):
|
|||||||
raise LimitError(f"position={pos} not within limits {self.limits}")
|
raise LimitError(f"position={pos} not within limits {self.limits}")
|
||||||
|
|
||||||
def set(self, value):
|
def set(self, value):
|
||||||
|
self._stopped = False
|
||||||
self.check_value(value)
|
self.check_value(value)
|
||||||
old_setpoint = self.sim_state["setpoint"]
|
old_setpoint = self.sim_state["setpoint"]
|
||||||
self.sim_state["is_moving"] = 1
|
self.sim_state["is_moving"] = 1
|
||||||
@ -371,7 +372,7 @@ class SynAxisOPAAS(Device, PositionerBase):
|
|||||||
updates = np.ceil(
|
updates = np.ceil(
|
||||||
np.abs(old_setpoint - move_val) / self.speed * self.update_frequency
|
np.abs(old_setpoint - move_val) / self.speed * self.update_frequency
|
||||||
)
|
)
|
||||||
for ii in np.linspace(old_setpoint, move_val - 5, int(updates)):
|
for ii in np.linspace(old_setpoint, move_val, int(updates)):
|
||||||
ttime.sleep(1 / self.update_frequency)
|
ttime.sleep(1 / self.update_frequency)
|
||||||
update_state(ii)
|
update_state(ii)
|
||||||
update_state(move_val)
|
update_state(move_val)
|
||||||
@ -384,8 +385,9 @@ class SynAxisOPAAS(Device, PositionerBase):
|
|||||||
timestamp=self.sim_state["is_moving_ts"],
|
timestamp=self.sim_state["is_moving_ts"],
|
||||||
)
|
)
|
||||||
except DeviceStop:
|
except DeviceStop:
|
||||||
self._stopped = False
|
|
||||||
success = False
|
success = False
|
||||||
|
finally:
|
||||||
|
self._stopped = False
|
||||||
self._done_moving(success=success)
|
self._done_moving(success=success)
|
||||||
st.set_finished()
|
st.set_finished()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user