...
 
Commits (8)
......@@ -132,11 +132,7 @@ class CallableWrite:
## @brief helper for automatic attribute to command mapping
# To be called from __getattr__
# if update_dict is True the __dict__ is updated for the new attribute
# means for next call to the attr will not pass through this helper but will get
# the callable object from the __dict_ object dictionnary.
# set update_dict to False to avoid keep reference of some objects you want to delete
def get_attr_4u(obj,name,interface,update_dict=True) :
def get_attr_4u(obj,name,interface) :
if name.startswith('read_') or name.startswith('write_') :
split_name = name.split('_')[1:]
......@@ -170,7 +166,7 @@ def get_attr_4u(obj,name,interface,update_dict=True) :
callable_obj = CallableWrite('_'.join(split_name),
function2Call)
if update_dict: obj.__dict__[name] = callable_obj
obj.__dict__[name] = callable_obj
return callable_obj
raise AttributeError('%s has no attribute %s' % (obj.__class__.__name__,name))
......
......@@ -188,7 +188,7 @@ def check_link_strict_version():
global StrictVersionPolicy
cmd = 'from Lima import Core; '
cmd += 'import os; print os.environ["LIMA_LINK_STRICT_VERSION"]'
cmd += 'import os; print (os.environ["LIMA_LINK_STRICT_VERSION"])'
args = ['python', '-c', cmd]
pobj = Popen(args, stdout=PIPE)
strict_link = pobj.stdout.readline().strip().upper()
......@@ -210,7 +210,7 @@ def setup_env(mod):
ver = 'v' + ver
filt_vers = [set_env_version_depth(x) for x in all_vers]
if ver not in filt_vers:
print 'Warning: could not find %s=%s' % (env_var_name, ver)
print ('Warning: could not find %s=%s' % (env_var_name, ver))
return
else:
ver = all_vers[-1]
......@@ -255,7 +255,7 @@ def check_lima_dir():
global LimaDir
if LimaDir is not None:
return LimaDir
args = ['python', '-c', 'from Lima import Core; print Core.__file__']
args = ['python', '-c', 'from Lima import Core; print (Core.__file__)']
pobj = Popen(args, stdout=PIPE)
core_init_dir = pobj.stdout.readline().strip()
core_dir = os.path.dirname(core_init_dir)
......@@ -271,7 +271,7 @@ def version_cmp(x, y):
def print_debug(msg):
if Debug:
print msg
print (msg)
def __get_ct_classes():
import Lima.Core
......@@ -384,7 +384,7 @@ def to_tango_object(ct, name_id):
return setattr(self.__dict__["__ct"], name, value)
def __dir__(self):
return dir(self.__dict__["__ct"]) + keys
return dir(self.__dict__["__ct"]) + list(keys)
def __reduce__(self):
import PyTango.client
......@@ -416,7 +416,6 @@ def create_tango_objects(ct_control, name_template):
# tango device will communicate with this object.
# tango stores a weakref to it so we must keep track of it
tango_ct_control = to_tango_object(ct_control, tango_ct_control_name)
for ct_name in __get_ct_classes():
# "CtImage" becomes "image()"
ct_func_name = ct_name[2:].lower()
......@@ -426,17 +425,14 @@ def create_tango_objects(ct_control, name_template):
ct = ct_func()
tango_ct_name = name_template.format(type=ct_name)
tango_ct = to_tango_object(ct, tango_ct_name)
# patch tango_ct_control
getter = functools.partial(lambda obj, ct: ct, tango_ct)
getter = types.MethodType(getter, tango_ct, tango_ct.__class__)
#getter = types.MethodType(getter, tango_ct, tango_ct.__class__)
getter = types.MethodType(getter, tango_ct)
setattr(tango_ct_control, ct_func_name, getter)
tango_object = server.register_object(tango_ct, tango_ct_name, ct_name,
member_filter=__filter)
tango_ct_map[tango_ct_name] = tango_ct, tango_object
print("ctcontrol.{0}() = {1}".format(ct_func_name, getattr(tango_ct_control, ct_func_name)()))
tango_object = server.register_object(tango_ct_control,
......
This diff is collapsed.
This diff is collapsed.
......@@ -112,6 +112,7 @@ maxNbImages ro DevLong The maximum number of im
pixelRate ro DevLong Actual Pixel Rate (Hz)
pixelRateInfo ro DevString Pixel Rate information
pixelRateValidValues ro DevString Allowed Pixel Rates
recorderForcedFifo rw DevLong Forced Fifo Mode (**only for recording cams**)
roiInfo ro DevString PCO ROI info
roiLastFixed ro DevString Last fixed ROI info
rollingShutter rw DevLong Rolling Shutter Mode (**only for some types of EDGE**)
......
......@@ -522,22 +522,12 @@ class LimaTacoCCDs(PyTango.Device_4Impl, object):
pars.fileFormat = Core.CtSaving.CBFFormat
elif pars.suffix.lower()[-3:] == '.h5':
pars.fileFormat = Core.CtSaving.HDF5
elif pars.suffix.lower()[-5:] == '.h5gz':
pars.fileFormat = Core.CtSaving.HDF5GZ
elif pars.suffix.lower()[-5:] == '.h5bs':
pars.fileFormat = Core.CtSaving.HDF5BS
elif pars.suffix.lower()[-5:] == '.hdf5':
pars.fileFormat = Core.CtSaving.HDF5
elif pars.suffix.lower()[-7:] == '.hdf5gz':
pars.fileFormat = Core.CtSaving.HDF5GZ
elif pars.suffix.lower()[-7:] == '.hdf5bs':
pars.fileFormat = Core.CtSaving.HDF5BS
elif pars.suffix.lower()[-5:] == '.tiff':
pars.fileFormat = Core.CtSaving.TIFFFormat
elif pars.suffix.lower()[-8:] == '.edf.lz4':
pars.fileFormat = Core.CtSaving.EDFLZ4
elif pars.suffix.lower()[-7:] == '.edflz4':
pars.fileFormat = Core.CtSaving.EDFLZ4
else:
pars.fileFormat = Core.CtSaving.RAW
saving.setParameters(pars)
......