Commit 94a8125d authored by bliss administrator's avatar bliss administrator

[wip] included stop error code (warning) for different controllers

[wip] reformated files

[wip] wait_ready / temporary patch (eiger & basler)

[wip] testing failed pipeline

[wip] testomg failed pipeline
parent a221ddd8
......@@ -52,7 +52,9 @@ def _atomic_communication(fn):
class PI_HEXA(Controller):
COMMAND = enum.Enum("PI_HEXA.COMMAND", "POSITIONS MOVE_STATE MOVE_SEP INIT")
COMMAND = enum.Enum(
"PI_HEXA.COMMAND", "POSITIONS MOVE_STATE MOVE_SEP INIT STOP_ERROR"
)
def __init__(self, *args, **kwargs):
Controller.__init__(self, *args, **kwargs)
......@@ -101,12 +103,14 @@ class PI_HEXA(Controller):
self.COMMAND.MOVE_STATE: ("\5", lambda x: int(x)),
self.COMMAND.MOVE_SEP: "",
self.COMMAND.INIT: "INI X",
self.COMMAND.STOP_ERROR: 2,
},
887: {
self.COMMAND.POSITIONS: "\3",
self.COMMAND.MOVE_STATE: ("\5", lambda x: int(x, 16)),
self.COMMAND.MOVE_SEP: " ",
self.COMMAND.INIT: "FRF X",
self.COMMAND.STOP_ERROR: 10,
},
}
......@@ -214,7 +218,9 @@ class PI_HEXA(Controller):
def _check_error_and_raise(self, ignore_stop=False, **kwargs):
err = int(self.command("ERR?", **kwargs))
if err > 0:
if ignore_stop and err == 2: # stopped by user
if (
ignore_stop and err == self._commands[self.COMMAND.STOP_ERROR]
): # stopped by user
return
human_error = get_error_str(err)
errors = [self.name, err, human_error]
......
......@@ -240,8 +240,8 @@ class IntegratingCounterAcquisitionDevice(BaseCounterAcquisitionDevice):
reader,
count_time,
npoints=None,
prepare_once=keys.pop('prepare_once',None),
start_once=keys.pop('start_once',None),
prepare_once=keys.pop("prepare_once", None),
start_once=keys.pop("start_once", None),
**keys
)
for cnt in counters:
......
......@@ -191,7 +191,8 @@ class LimaAcquisitionMaster(AcquisitionMaster):
return True
def wait_ready(self):
if self.device.camera_model.find('Eiger') > -1:
return
if self.device.camera_model.find("Eiger") > -1:
return True
if self._reading_task:
self._ready_event.wait()
......@@ -203,7 +204,7 @@ class LimaAcquisitionMaster(AcquisitionMaster):
return
with self.__lock:
self.device.startAcq()
self.device.startAcq()
acq_trigger_mode = self.parameters.get(
"acq_trigger_mode", "INTERNAL_TRIGGER"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment