Commit c13a54bd authored by Sebastien Petitdemange's avatar Sebastien Petitdemange
Browse files

Merge branch 'lima_fix' into 'master'

Lima scan bug fixes

See merge request !475
parents 1f0e99ab 89736fa4
......@@ -5,7 +5,7 @@
# Copyright (c) 2016 Beamline Control Unit, ESRF
# Distributed under the GNU LGPLv3. See LICENSE for more info.
import importlib
import PyTango
import tango.gevent
from bliss.config import settings
class Lima(object):
......@@ -185,33 +185,46 @@ class Lima(object):
in this dictionary we need to have:
tango_url -- tango main device url (from class LimaCCDs)
"""
self._proxy = PyTango.DeviceProxy(config_tree.get("tango_url"))
self._proxy = tango.gevent.DeviceProxy(config_tree.get("tango_url"))
self.name = name
self._roi_counters = None
self._camera = None
self._image = None
self._acquisition = None
@property
def proxy(self):
return self._proxy
@property
def image(self):
return Lima.Image(self._proxy)
if self._image is None:
self._image = Lima.Image(self._proxy)
return self._image
@property
def acquisition(self):
return Lima.Acquisition(self._proxy)
if self._acquisition is None:
self._acquisition = Lima.Acquisition(self._proxy)
return self._acquisition
@property
def roi_counters(self):
roi_counters_proxy = self._get_proxy(self.ROI_COUNTERS)
return Lima.RoiCounters(self.name,
PyTango.DeviceProxy(roi_counters_proxy))
if self._roi_counters is None:
roi_counters_proxy = self._get_proxy(self.ROI_COUNTERS)
proxy = tango.gevent.DeviceProxy(roi_counters_proxy)
self._roi_counters= Lima.RoiCounters(self.name, proxy)
return self._roi_counters
@property
def camera(self):
camera_type = self._proxy.lima_type
camera_proxy = self._get_proxy(camera_type)
camera_module = importlib.import_module('.%s' % camera_type,__package__)
return camera_module.Camera(self.name,PyTango.DeviceProxy(camera_proxy))
if self._camera is None:
camera_type = self._proxy.lima_type
camera_proxy = self._get_proxy(camera_type)
camera_module = importlib.import_module('.%s' % camera_type,__package__)
proxy = tango.gevent.DeviceProxy(camera_proxy)
self._camera = camera_module.Camera(self.name, proxy)
return self._camera
def prepareAcq(self):
self._proxy.prepareAcq()
......
......@@ -112,8 +112,8 @@ class LimaDataNode(DataNode):
while True:
self._new_image_status_event.wait()
self._new_image_status_event.clear()
local_dict = self._new_image_status_event
self._new_image_status_event = dict()
local_dict = self._new_image_status
self._new_image_status = dict()
if local_dict:
self.db_connection.hmset(self.db_name(),local_dict)
if self._stop_flag :
......
......@@ -33,7 +33,8 @@ class LimaAcquisitionDevice(AcquisitionDevice):
device = device.proxy
AcquisitionDevice.__init__(self, device, device.user_detector_name, "lima", acq_nb_frames,
trigger_type = trigger_type)
self._latency = self.device.latency_time
def prepare(self):
for param_name, param_value in self.parameters.iteritems():
setattr(self.device, param_name, param_value)
......@@ -76,7 +77,6 @@ class LimaAcquisitionDevice(AcquisitionDevice):
})
gevent.sleep(self.parameters['acq_expo_time']/2.0)
# TODO: self.dm.send_new_ref(self, {...}) ? or DataManager.send_new_ref(...) ?
print "end of read_data", self.device.acq_status.lower()
dispatcher.send("new_ref", self, { "type":"lima/image",
"last_image_acquired":self.device.last_image_acquired,
"last_image_saved":self.device.last_image_saved,
......
......@@ -499,7 +499,7 @@ class FileWriter(object):
lima_dev.saving_frame_per_file = 1
camera_name = lima_dev.camera_type
scan_name = scan_recorder.node.name()
lima_dev.saving_directory=full_path
lima_dev.saving_directory=scan_file_dir
lima_dev.saving_prefix='%s_%s' % (scan_name,camera_name)
lima_dev.saving_suffix='.edf'
pass # link
......
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