Commit 90d875b9 authored by bliss administrator's avatar bliss administrator Committed by Sebastien Petitdemange
Browse files

scanning/acquisition/counter.py: by default, prepare() is called only once;

by default, start() is called for every point
parent 00d1c263
...@@ -17,7 +17,7 @@ from bliss.common.utils import all_equal ...@@ -17,7 +17,7 @@ from bliss.common.utils import all_equal
class BaseCounterAcquisitionDevice(AcquisitionDevice): class BaseCounterAcquisitionDevice(AcquisitionDevice):
def __init__(self, counter, count_time, **keys): def __init__(self, counter, count_time, **keys):
npoints = max(1, keys.pop('npoints', 1)) npoints = max(1, keys.pop('npoints', 1))
prepare_once = keys.pop('prepare_once', npoints > 1) prepare_once = keys.pop('prepare_once', True)
start_once = keys.pop('start_once', npoints > 1) start_once = keys.pop('start_once', npoints > 1)
AcquisitionDevice.__init__(self, counter, counter.name, "zerod", AcquisitionDevice.__init__(self, counter, counter.name, "zerod",
...@@ -96,12 +96,12 @@ class SamplingCounterAcquisitionDevice(BaseCounterAcquisitionDevice): ...@@ -96,12 +96,12 @@ class SamplingCounterAcquisitionDevice(BaseCounterAcquisitionDevice):
def prepare(self): def prepare(self):
self.device.prepare(*self.grouped_read_counters) self.device.prepare(*self.grouped_read_counters)
def start(self):
self._nb_acq_points = 0 self._nb_acq_points = 0
self._stop_flag = False self._stop_flag = False
self._ready_flag = True self._ready_flag = True
self._event.clear() self._event.clear()
def start(self):
self.device.start(*self.grouped_read_counters) self.device.start(*self.grouped_read_counters)
def stop(self): def stop(self):
...@@ -177,10 +177,11 @@ class IntegratingCounterAcquisitionDevice(BaseCounterAcquisitionDevice): ...@@ -177,10 +177,11 @@ class IntegratingCounterAcquisitionDevice(BaseCounterAcquisitionDevice):
def prepare(self): def prepare(self):
self.device.prepare(*self.grouped_read_counters) self.device.prepare(*self.grouped_read_counters)
def start(self):
self._nb_acq_points = 0 self._nb_acq_points = 0
self._stop_flag = False self._stop_flag = False
def start(self):
self.device.start(*self.grouped_read_counters) self.device.start(*self.grouped_read_counters)
def stop(self): def stop(self):
......
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