Commit 23f50547 authored by bliss administrator's avatar bliss administrator

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

parent f4d7c007
Pipeline #8625 failed with stages
in 19 seconds
......@@ -52,7 +52,7 @@ 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 +101,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 +216,7 @@ 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]
......
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