Merge branch 'master' of https://gitlab.psi.ch/bec/ophyd_devices
This commit is contained in:
commit
1ef5035f2c
@ -365,14 +365,14 @@ class GalilMotor(Device, PositionerBase):
|
|||||||
self.controller = GalilController(socket=socket_cls(host=host, port=port))
|
self.controller = GalilController(socket=socket_cls(host=host, port=port))
|
||||||
self.controller.set_axis(axis=self, axis_nr=self.axis_Id_numeric)
|
self.controller.set_axis(axis=self, axis_nr=self.axis_Id_numeric)
|
||||||
self.tolerance = kwargs.pop("tolerance", 0.5)
|
self.tolerance = kwargs.pop("tolerance", 0.5)
|
||||||
self.device_access = kwargs.pop("device_access", {})
|
self.device_mapping = kwargs.pop("device_mapping", {})
|
||||||
self.device_manager = device_manager
|
self.device_manager = device_manager
|
||||||
|
|
||||||
if len(self.device_access) > 0 and self.device_manager is None:
|
if len(self.device_mapping) > 0 and self.device_manager is None:
|
||||||
raise BECConfigError(
|
raise BECConfigError(
|
||||||
"device_access has been specified but the device_manager cannot be accessed."
|
"device_mapping has been specified but the device_manager cannot be accessed."
|
||||||
)
|
)
|
||||||
self.rt = self.device_access.get("rt")
|
self.rt = self.device_mapping.get("rt")
|
||||||
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
prefix,
|
prefix,
|
||||||
|
@ -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