Commit 2f31e0ea authored by bliss administrator's avatar bliss administrator
Browse files

undulators tango access logs

parent 2dff4ab0
Pipeline #69964 failed
import functools
import pytest import pytest
from bliss.common import tango
from bliss.common.axis import NoSettingsAxis from bliss.common.axis import NoSettingsAxis
from bliss.common.logtools import log_debug, log_warning from bliss.common.logtools import log_debug, log_warning
from bliss.controllers.motors.esrf_undulator import ESRF_Undulator from bliss.controllers.motors.esrf_undulator import ESRF_Undulator
...@@ -38,6 +40,25 @@ class UnduAxis(esrf_undulator.Axis): ...@@ -38,6 +40,25 @@ class UnduAxis(esrf_undulator.Axis):
Axis = UnduAxis Axis = UnduAxis
def _log_devfailed (func):
@functools.wraps(func)
def wrapper(*a, **b):
try:
return func(*a, **b)
except tango.DevFailed as e:
log_warning(
func,
"Undulator tango.DevFailed (Timeout? when executing {0} ({1}) ".format(
func.__name__,
e,
)
)
raise e
return wrapper
class ID26_Undulator(ESRF_Undulator): class ID26_Undulator(ESRF_Undulator):
def __init__(self, *args, **kwargs): def __init__(self, *args, **kwargs):
...@@ -63,3 +84,27 @@ class ID26_Undulator(ESRF_Undulator): ...@@ -63,3 +84,27 @@ class ID26_Undulator(ESRF_Undulator):
log_debug(self, f"end of start {motion.axis.name}") log_debug(self, f"end of start {motion.axis.name}")
@_log_devfailed
def _set_attribute(self, *args):
return ESRF_Undulator._set_attribute (self, *args)
@_log_devfailed
def _get_attribute(self, *args):
return ESRF_Undulator._get_attribute (self, *args)
@_log_devfailed
def read_position(self, axis):
return ESRF_Undulator.read_position (self, axis)
@_log_devfailed
def state(self, axis):
return ESRF_Undulator.state (self, axis)
@_log_devfailed
def stop(self, axis):
return ESRF_Undulator.stop(self, axis)
@_log_devfailed
def stop_all(self, *motion_list):
return ESRF_Undulator.stop_all(self, *motion_list)
Supports Markdown
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