Commit b2332465 authored by Samuel Debionne's avatar Samuel Debionne
Browse files

Py3 fix peaks attribute

Fix nb_prefetched_frames attribute
parent 752e3933
Pipeline #5884 passed with stages
in 10 minutes and 28 seconds
......@@ -133,7 +133,7 @@ class Simulator(PyTango.Device_4Impl):
gauss_peaks = _SimuCamera.getFrameGetter().getPeaks()
peak_list = [(p.x0, p.y0, p.fwhm, p.max) for p in gauss_peaks]
peak_list_flat = list(itertools.chain(*peak_list))
attr.set_value(map(float, peak_list_flat))
attr.set_value(peak_list_flat)
def write_peaks(self,attr) :
peak_list_flat = attr.get_write_value()
......@@ -164,6 +164,14 @@ class Simulator(PyTango.Device_4Impl):
sx, sy = attr.get_write_value()
_SimuCamera.getFrameGetter().setDiffractionSpeed(sx, sy)
def read_nb_prefetched_frames(self,attr) :
if (_SimuCamera.getMode() == SimuMod.Camera.MODE_GENERATOR_PREFETCH) or \
(_SimuCamera.getMode() == SimuMod.Camera.MODE_LOADER_PREFETCH) :
nb_prefetched_frames = _SimuCamera.getFrameGetter().getNbPrefetchedFrames()
else :
nb_prefetched_frames = 0
attr.set_value(nb_prefetched_frames)
# def read_mode(self,attr) :
# invMode = {v: k for k, v in self.__Mode.items()}
# mode = _SimuCamera.getMode()
......
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