Commit 3a790b5f authored by Alejandro Homs Puron's avatar Alejandro Homs Puron Committed by Laurent Claustre
Browse files

Tango: add espia_lib/drv_debug_level properties and attributes

parent 0720d5f1
......@@ -25,6 +25,8 @@ from Lima import Espia
from limafrelon import *
from processlib import Tasks
EspiaDevNbInvalid = 256
class FrelonAcq:
DEB_CLASS(DebModApplication, 'FrelonAcq')
......@@ -123,6 +125,12 @@ class FrelonAcq:
espia_dev_nb2 = kws.get('espia_dev_nb2', None)
if len(args) > 0:
espia_dev_nb2 = args[0]
req_lib_dbg_lvl = kws.get('espia_lib_debug_level', -1)
if len(args) > 1:
req_lib_dbg_lvl = args[1]
req_drv_dbg_lvl = kws.get('espia_drv_debug_level', -1)
if len(args) > 2:
req_drv_dbg_lvl = args[2]
self.m_cam_inited = False
......@@ -134,6 +142,13 @@ class FrelonAcq:
self.m_bpm_task = Tasks.BpmTask(self.m_bpm_mgr)
self.m_ser_edev = Espia.Dev(espia_dev_nb)
lib_dbg_lvl, drv_dbg_lvl = self.m_ser_edev.getDebugLevels()
if req_lib_dbg_lvl >= 0:
lib_dbg_lvl = req_lib_dbg_lvl
if req_drv_dbg_lvl >= 0:
drv_dbg_lvl = req_drv_dbg_lvl
self.m_ser_edev.setDebugLevels(lib_dbg_lvl, drv_dbg_lvl)
self.m_eserline = Espia.SerialLine(self.m_ser_edev)
self.m_cam = Frelon.Camera(self.m_eserline)
......@@ -141,7 +156,7 @@ class FrelonAcq:
model = self.m_cam.getModel()
f16 = (model.getChipType() == Frelon.Andanta_CcdFT2k)
if f16:
if espia_dev_nb2 is not None:
if espia_dev_nb2 not in [None, EspiaDevNbInvalid]:
self.m_acq_edev = Espia.Meta([espia_dev_nb, espia_dev_nb2])
else:
model.setF16ForceSingle(True);
......
......@@ -154,6 +154,28 @@ class Frelon(PyTango.Device_4Impl):
espia_dev_nb2 = self.espia_dev_nb2
attr.set_value(espia_dev_nb2)
def read_espia_lib_debug_level(self,attr) :
edev = _FrelonAcq.getEspiaAcqDev()
lib_deb_lvl, drv_deb_lvl = edev.getDebugLevels()
attr.set_value(lib_deb_lvl)
def write_espia_lib_debug_level(self,attr) :
edev = _FrelonAcq.getEspiaAcqDev()
lib_deb_lvl, drv_deb_lvl = edev.getDebugLevels()
lib_deb_lvl = attr.get_write_value()
edev.setDebugLevels(lib_deb_lvl, drv_deb_lvl)
def read_espia_drv_debug_level(self,attr) :
edev = _FrelonAcq.getEspiaAcqDev()
lib_deb_lvl, drv_deb_lvl = edev.getDebugLevels()
attr.set_value(drv_deb_lvl)
def write_espia_drv_debug_level(self,attr) :
edev = _FrelonAcq.getEspiaAcqDev()
lib_deb_lvl, drv_deb_lvl = edev.getDebugLevels()
drv_deb_lvl = attr.get_write_value()
edev.setDebugLevels(lib_deb_lvl, drv_deb_lvl)
def read_roi_bin_offset(self,attr) :
cam = _FrelonAcq.getFrelonCamera()
roi_bin_offset = cam.getRoiBinOffset()
......@@ -187,6 +209,12 @@ class FrelonClass(PyTango.DeviceClass):
'espia_dev_nb2':
[PyTango.DevShort,
"Second Espia board device number",[EspiaDevNbInvalid]],
'espia_lib_debug_level':
[PyTango.DevLong,
"Espia library debug level",[-1]],
'espia_drv_debug_level':
[PyTango.DevLong,
"Espia driver debug level",[-1]],
}
cmd_list = {
......@@ -218,6 +246,14 @@ class FrelonClass(PyTango.DeviceClass):
[[PyTango.DevShort,
PyTango.SCALAR,
PyTango.READ]],
'espia_lib_debug_level':
[[PyTango.DevLong,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'espia_drv_debug_level':
[[PyTango.DevLong,
PyTango.SCALAR,
PyTango.READ_WRITE]],
'image_mode' :
[[PyTango.DevString,
PyTango.SCALAR,
......@@ -486,10 +522,14 @@ FrelonTacoProxyCont = [FrelonTacoProxy()]
#----------------------------------------------------------------------------
_FrelonAcq = None
def get_control(espia_dev_nb = 0, espia_dev_nb2 = EspiaDevNbInvalid, **keys) :
def get_control(espia_dev_nb = 0, espia_dev_nb2 = EspiaDevNbInvalid,
espia_lib_debug_level = -1, espia_drv_debug_level = -1,
**keys) :
global _FrelonAcq
if _FrelonAcq is None:
_FrelonAcq = FrelonHw.FrelonAcq(int(espia_dev_nb), int(espia_dev_nb2))
_FrelonAcq = FrelonHw.FrelonAcq(int(espia_dev_nb), int(espia_dev_nb2),
int(espia_lib_debug_level),
int(espia_drv_debug_level))
return _FrelonAcq.getGlobalControl()
def get_tango_specific_class_n_device():
......
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