omove works without crash

This commit is contained in:
gac-x06da
2025-01-27 18:27:09 +01:00
parent 4fc31e5f5d
commit 4b76d1b191
+13 -1
View File
@@ -100,8 +100,11 @@ class SmarGonSignalRO(Signal):
self.put(r, force=True) self.put(r, force=True)
return self._readback return self._readback
def poll(self, *args, **kwargs): def poll(self, *args, **kwargs):
""" Fooo""" """ Fooo"""
time.sleep(2)
while True: while True:
time.sleep(0.2) time.sleep(0.2)
self.get() self.get()
@@ -112,6 +115,8 @@ class SmarGonAxis(PVPositioner):
This class controls the SmarGon goniometer via the REST interface. This class controls the SmarGon goniometer via the REST interface.
""" """
USER_ACCESS = ["omove"]
# Status attributes # Status attributes
sg_url = Component(Signal, kind=Kind.config, metadata={"write_access": False}) sg_url = Component(Signal, kind=Kind.config, metadata={"write_access": False})
corr = Component(SmarGonSignalRO, read_addr="corr_type", kind=Kind.config) corr = Component(SmarGonSignalRO, read_addr="corr_type", kind=Kind.config)
@@ -120,7 +125,7 @@ class SmarGonAxis(PVPositioner):
# Axis parameters # Axis parameters
readback = Component(SmarGonSignalRO, kind=Kind.hinted, auto_monitor=True) readback = Component(SmarGonSignalRO, kind=Kind.hinted, auto_monitor=True)
setpoint = Component(SmarGonSignal, kind=Kind.normal) 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 = Component(SmarGonMovingSignalRO, kind=Kind.config)
moving = 1 moving = 1
_tol = 0.001 _tol = 0.001
@@ -179,6 +184,13 @@ class SmarGonAxis(PVPositioner):
) )
return status 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): def _go_n_get(self, address, **kwargs):
"""Helper function to connect to smargopolo""" """Helper function to connect to smargopolo"""
cmd = f"{self.sg_url.get()}/{address}" cmd = f"{self.sg_url.get()}/{address}"