use separate magnet file; fixed enumeration typos

This commit is contained in:
2022-09-17 09:59:39 +02:00
parent 349ddfa57f
commit 8ee20f9278
2 changed files with 17 additions and 21 deletions

27
Ecol.py
View File

@ -1,6 +1,9 @@
from slic.core.adjustable import Adjustable, PVAdjustable
from slic.core.device import SimpleDevice
from magnet import Magnet
class EcolScaler(Adjustable):
def __init__(self, ID="ECOL-SCALER", factor=1):
super().__init__(ID)
@ -20,15 +23,15 @@ class EcolScaler(Adjustable):
ID,
m01=mag01,
m02=mag02,
m02=mag03,
m02=mag04,
m02=mag05,
m02=mag06,
m02=mag07,
m02=mag08,
m02=mag09,
m02=mag10,
m02=mag11
m03=mag03,
m04=mag04,
m05=mag05,
m06=mag06,
m07=mag07,
m08=mag08,
m09=mag09,
m10=mag10,
m11=mag11
)
def get_current_value(self):
return self.factor
@ -45,9 +48,5 @@ class EcolScaler(Adjustable):
def is_moving(self):
return any(m.is_moving() for m in self.magnets)
class Magnet(PVAdjustable):
def __init__(self, ID):
pvn_set = ID + ":I-SET"
pvn_read = ID + ":I-READ"
super().__init__(pvn_set, pvn_read, accuracy=0.01)

View File

@ -1,6 +1,9 @@
from slic.core.adjustable import Adjustable, PVAdjustable
from slic.core.device import SimpleDevice
from magnet import Magnet
class MagnetsScaler(Adjustable):
def __init__(self, ID="MAGNETS-SCALER", factor=1):
super().__init__(ID)
@ -28,11 +31,5 @@ class MagnetsScaler(Adjustable):
def is_moving(self):
return any(m.is_moving() for m in self.magnets)
class Magnet(PVAdjustable):
def __init__(self, ID):
pvn_set = ID + ":I-SET"
pvn_read = ID + ":I-READ"
# pvn_comp = ID + ":I_COMP"
# super().__init__(pvn_set, pvn_read, pvname_moving=pvn_comp) # COMP updates only once per second, so we cannot use it.
super().__init__(pvn_set, pvn_read, accuracy=0.01)