Merge branch 'sls_info' into 'master'
fix: online fixes See merge request bec/ophyd_devices!10
This commit is contained in:
commit
c1cb33e0fc
@ -119,6 +119,13 @@ class Eiger1p5MDetector(Device):
|
|||||||
# set the exposure time
|
# set the exposure time
|
||||||
self.exp_time.set(exp_time)
|
self.exp_time.set(exp_time)
|
||||||
|
|
||||||
|
# wait for detector control to become "ready"
|
||||||
|
while True:
|
||||||
|
det_ctrl = self.detector_control.get()
|
||||||
|
if det_ctrl == "ready":
|
||||||
|
break
|
||||||
|
time.sleep(0.005)
|
||||||
|
|
||||||
# send the "begin" flag to start processing the above commands
|
# send the "begin" flag to start processing the above commands
|
||||||
self.detector_control.set("begin")
|
self.detector_control.set("begin")
|
||||||
|
|
||||||
@ -146,6 +153,8 @@ class Eiger1p5MDetector(Device):
|
|||||||
)
|
)
|
||||||
time_waited += sleep_time
|
time_waited += sleep_time
|
||||||
time.sleep(sleep_time)
|
time.sleep(sleep_time)
|
||||||
|
if self._stopped:
|
||||||
|
break
|
||||||
continue
|
continue
|
||||||
break
|
break
|
||||||
self.detector_control.put("stop")
|
self.detector_control.put("stop")
|
||||||
@ -154,6 +163,7 @@ class Eiger1p5MDetector(Device):
|
|||||||
self.device_manager.producer.set_and_publish(
|
self.device_manager.producer.set_and_publish(
|
||||||
MessageEndpoints.device_read(self.name), msg.dumps()
|
MessageEndpoints.device_read(self.name), msg.dumps()
|
||||||
)
|
)
|
||||||
|
self._stopped = False
|
||||||
return super().unstage()
|
return super().unstage()
|
||||||
|
|
||||||
def stop(self, *, success=False):
|
def stop(self, *, success=False):
|
||||||
|
@ -88,8 +88,17 @@ class RtLamniController(Controller):
|
|||||||
try:
|
try:
|
||||||
self.sock.open()
|
self.sock.open()
|
||||||
# discuss - after disconnect takes a while for the server to be ready again
|
# discuss - after disconnect takes a while for the server to be ready again
|
||||||
welcome_message = self.sock.receive()
|
max_retries = 10
|
||||||
self.connected = True
|
tries = 0
|
||||||
|
while not self.connected:
|
||||||
|
try:
|
||||||
|
welcome_message = self.sock.receive()
|
||||||
|
self.connected = True
|
||||||
|
except ConnectionResetError as conn_reset:
|
||||||
|
if tries > max_retries:
|
||||||
|
raise conn_reset
|
||||||
|
tries += 1
|
||||||
|
time.sleep(2)
|
||||||
except ConnectionRefusedError as conn_error:
|
except ConnectionRefusedError as conn_error:
|
||||||
logger.error("Failed to open a connection to RTLamNI.")
|
logger.error("Failed to open a connection to RTLamNI.")
|
||||||
raise RtLamniCommunicationError from conn_error
|
raise RtLamniCommunicationError from conn_error
|
||||||
|
Loading…
x
Reference in New Issue
Block a user