introduced distinction between ID and name (like for Adjustables)
This commit is contained in:
@@ -11,9 +11,9 @@ MSG_MISSING_TYPE = "'type' channel field not found. Parse as 64-bit floating-poi
|
||||
|
||||
class BSSensor(Sensor):
|
||||
|
||||
def __init__(self, name, **kwargs):
|
||||
super().__init__(name, **kwargs)
|
||||
self.thread = thread = BSMonitorThread(name, self._collect)
|
||||
def __init__(self, ID, **kwargs):
|
||||
super().__init__(ID, **kwargs)
|
||||
self.thread = thread = BSMonitorThread(ID, self._collect)
|
||||
thread.start()
|
||||
|
||||
def get_current_value(self):
|
||||
|
||||
@@ -4,9 +4,9 @@ from .sensor import Sensor
|
||||
|
||||
class PVSensor(Sensor):
|
||||
|
||||
def __init__(self, name, **kwargs):
|
||||
super().__init__(name, **kwargs)
|
||||
self.pv = PV(name)
|
||||
def __init__(self, ID, **kwargs):
|
||||
super().__init__(ID, **kwargs)
|
||||
self.pv = PV(ID)
|
||||
self._cb_index = None
|
||||
|
||||
|
||||
|
||||
@@ -5,8 +5,9 @@ from .basesensor import BaseSensor
|
||||
|
||||
class Sensor(BaseSensor):
|
||||
|
||||
def __init__(self, name, units=None, aggregation=np.mean):
|
||||
self.name = name
|
||||
def __init__(self, ID, name=None, units=None, aggregation=np.mean):
|
||||
self.ID = ID
|
||||
self.name = name or ID
|
||||
self.units = units
|
||||
self.aggregation = aggregation
|
||||
self._cache = []
|
||||
|
||||
Reference in New Issue
Block a user