Commit f05131a9 authored by Laurent Claustre's avatar Laurent Claustre

Merge branch 'slsdetector-v3' into 'master'

SlsDetector v3

See merge request !15
parents 6e424d4c 35225f8a
......@@ -49,7 +49,7 @@ from Lima import Core
from Lima import SlsDetector as SlsDetectorHw
from Lima.Server.AttrHelper import get_attr_4u, get_attr_string_value_list
def ConstListAttr(nl, vl=None, Defs=SlsDetectorHw.Defs):
def ConstListAttr(nl, vl=None, namespc=SlsDetectorHw.Defs):
def g(x):
n = ''
was_cap = True
......@@ -61,7 +61,7 @@ def ConstListAttr(nl, vl=None, Defs=SlsDetectorHw.Defs):
return n
if vl is None:
vl = [getattr(Defs, n) for n in nl]
vl = [getattr(namespc, n) for n in nl]
return OrderedDict([(g(n), v) for n, v in zip(nl, vl)])
......@@ -76,6 +76,9 @@ class SlsDetector(PyTango.Device_4Impl):
MilliVoltSuffix = '_mv'
ModelAttrs = ['parallel_mode', 'clock_div', 'high_voltage',
def __init__(self,*args) :
......@@ -116,8 +119,8 @@ class SlsDetector(PyTango.Device_4Impl):
nl = ['FullSpeed', 'HalfSpeed', 'QuarterSpeed', 'SuperSlowSpeed']
self.__ClockDiv = ConstListAttr(nl)
vl, nl =
self.__ReadoutFlags = ConstListAttr(nl, vl)
nl = ['Parallel', 'NonParallel', 'Safe']
self.__ParallelMode = ConstListAttr(nl, namespc=SlsDetectorHw.Eiger)
nl = ['PixelDepth4', 'PixelDepth8', 'PixelDepth16', 'PixelDepth32']
bdl = map(lambda x: getattr(SlsDetectorHw, x), nl)
......@@ -173,7 +176,11 @@ class SlsDetector(PyTango.Device_4Impl):
if stats_tok[1] in ['do_hist']:
stats_name = '_'.join(stats_tok)
return get_attr_4u(self, stats_name, SlsDetectorHw.SimpleStat)
return get_attr_4u(self, name,
obj =
for attr in self.ModelAttrs:
if attr in name:
obj = self.model
return get_attr_4u(self, name, obj)
def read_config_fname(self, attr):
......@@ -232,14 +239,14 @@ class SlsDetector(PyTango.Device_4Impl):
def read_all_trim_bits(self, attr):
val_list =
val_list = self.model.getAllTrimBitsList()
deb.Return("val_list=%s" % val_list)
def write_all_trim_bits(self, attr):
for i, val in self.get_write_mod_idx_val_list(attr):, val)
self.model.setAllTrimBits(i, val)
def get_write_mod_idx_val_list(self, attr):
......@@ -480,11 +487,15 @@ class SlsDetectorClass(PyTango.DeviceClass):
PyTango.READ_WRITE, 64]],
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