From 4b76d1b191efc32f0be7ff55a5a1ab9b6cf1f2c4 Mon Sep 17 00:00:00 2001 From: gac-x06da Date: Mon, 27 Jan 2025 18:27:09 +0100 Subject: [PATCH] omove works without crash --- pxiii_bec/devices/SmarGon.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pxiii_bec/devices/SmarGon.py b/pxiii_bec/devices/SmarGon.py index 1ddad0f..86149e0 100644 --- a/pxiii_bec/devices/SmarGon.py +++ b/pxiii_bec/devices/SmarGon.py @@ -99,9 +99,12 @@ class SmarGonSignalRO(Signal): else: self.put(r, force=True) return self._readback + + def poll(self, *args, **kwargs): """ Fooo""" + time.sleep(2) while True: time.sleep(0.2) self.get() @@ -112,6 +115,8 @@ class SmarGonAxis(PVPositioner): This class controls the SmarGon goniometer via the REST interface. """ + USER_ACCESS = ["omove"] + # Status attributes sg_url = Component(Signal, kind=Kind.config, metadata={"write_access": False}) corr = Component(SmarGonSignalRO, read_addr="corr_type", kind=Kind.config) @@ -120,7 +125,7 @@ class SmarGonAxis(PVPositioner): # Axis parameters readback = Component(SmarGonSignalRO, kind=Kind.hinted, auto_monitor=True) setpoint = Component(SmarGonSignal, kind=Kind.normal) - done = Component(SignalRO, value=1, kind=Kind.normal) + done = Component(Signal, value=1, kind=Kind.normal) # moving = Component(SmarGonMovingSignalRO, kind=Kind.config) moving = 1 _tol = 0.001 @@ -178,6 +183,13 @@ class SmarGonAxis(PVPositioner): self.readback, on_target, timeout=timeout, settle_time=0.1 ) return status + + def omove(self, position, wait=True, timeout=None, moved_cb=None): + """ Original move command without the BEC wrappers""" + return self.move(position, wait, timeout, moved_cb) + + def _pos_changed(self, timestamp=None, value=None, **kwargs): + pass def _go_n_get(self, address, **kwargs): """Helper function to connect to smargopolo"""