Commit df6eed31 authored by Matias Guijarro's avatar Matias Guijarro

rename add_counter to create_counter

parent 56405f7d
......@@ -197,7 +197,7 @@ class Input(SamplingCounterController):
# useful attribute for a temperature controller writer
self._attr_dict = {}
self.add_counter(SamplingCounter, self.name, unit=config.get("unit", "N/A"))
self.create_counter(SamplingCounter, self.name, unit=config.get("unit", "N/A"))
def read_all(self, *counters):
return [self.read()]
......@@ -320,7 +320,7 @@ class Output(SamplingCounterController):
# useful attribute for a temperature controller writer
self._attr_dict = {}
self.add_counter(SamplingCounter, self.name, unit=config.get("unit", "N/A"))
self.create_counter(SamplingCounter, self.name, unit=config.get("unit", "N/A"))
def read_all(self, *counters):
return [self.read()]
......@@ -661,7 +661,7 @@ class Loop(SamplingCounterController):
self.reg_plot = None
self.add_counter(SamplingCounter, self.name, unit=config.get("unit", "N/A"))
self.create_counter(SamplingCounter, self.name, unit=config.get("unit", "N/A"))
# ----------- BASE METHODS -----------------------------------------
......
......@@ -48,7 +48,7 @@ class CounterController:
def counters(self):
return counter_namespace(self._counters)
def add_counter(self, counter_class, *args, **kwargs):
def create_counter(self, counter_class, *args, **kwargs):
counter = counter_class(*args, controller=self, **kwargs)
return counter
......
......@@ -77,13 +77,13 @@ class CT2Controller(Proxy, CounterController):
ct_name = channel.get("counter name", None)
if ct_name:
address = int(channel["address"])
slave.add_counter(CT2Counter, ct_name, address)
slave.create_counter(CT2Counter, ct_name, address)
# Add ct2 counter timer
timer = device_config.get("timer", None)
if timer is not None:
ct_name = timer.get("counter name", None)
if ct_name:
slave.add_counter(CT2CounterTimer, ct_name)
slave.create_counter(CT2CounterTimer, ct_name)
self._counters = slave._counters
......
......@@ -98,7 +98,7 @@ class EMH(CounterController):
# BPM COUNTERS
for counter_conf in config.get("counters", list()):
unit = counter_conf.get_inherited("unit")
self.add_counter(
self.create_counter(
EmhCounter, counter_conf["counter_name"], counter_conf["channel"], unit
)
......
......@@ -63,7 +63,7 @@ class Mythen(CounterController):
self._hostname = config["hostname"]
self._interface = MythenInterface(self._hostname)
self._apply_configuration()
self.add_counter(MythenCounter)
self.create_counter(MythenCounter)
def get_acquisition_object(self, acq_params, ctrl_params, parent_acq_params):
return MythenAcquistionSlave(self, ctrl_params=ctrl_params, **acq_params)
......
......@@ -386,11 +386,11 @@ class musst(CounterController):
)
if channel_type in ("cnt",):
self.integrating_counters.add_counter(
self.integrating_counters.create_counter(
MusstIntegratingCounter, cnt_name, cnt_channel, channel_config
)
elif channel_type in ("encoder", "ssi", "adc5", "adc10"):
cnt = self.sampling_counters.add_counter(
cnt = self.sampling_counters.create_counter(
MusstSamplingCounter, cnt_name, cnt_channel, channel_config
)
cnt_mode = channel_config.get("counter_mode")
......
......@@ -629,7 +629,7 @@ class PEPU(CounterController):
self.out_channels.values(),
self.calc_channels.values(),
):
self.add_counter(PepuCounter, channel.name)
self.create_counter(PepuCounter, channel.name)
if "template" in config:
template_name = "TEMPLATE_" + config["template"].upper()
......
......@@ -609,7 +609,7 @@ class SpeedgoatCountersController(CounterController):
# create counters
for cnt_name in sig_cnt.keys():
self.add_counter(
self.create_counter(
SimpleCounter, cnt_name, sig_cnt[cnt_name], par_cnt[cnt_name]
)
......
Markdown is supported
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