feat(reffoilchanger): Added function to get all foils by name
This commit is contained in:
@@ -37,7 +37,7 @@ class OpMode(int, enum.Enum):
|
||||
class Reffoilchanger(PSIDeviceBase):
|
||||
"""Class for the ES2 Reference Foil Changer"""
|
||||
|
||||
USER_ACCESS = ["insert"]
|
||||
USER_ACCESS = ["get_all_foils", "insert"]
|
||||
|
||||
inserted = Cpt(
|
||||
EpicsSignalRO, suffix="ES2-REF:TRY-FilterInserted", kind="config", doc="Inserted indicator"
|
||||
@@ -53,13 +53,21 @@ class Reffoilchanger(PSIDeviceBase):
|
||||
EpicsSignal, suffix="ES2-REF:SELN-FilterState-ENUM_RBV", kind="config", doc="Status"
|
||||
)
|
||||
status_string = Cpt(
|
||||
EpicsSignal, suffix="ES2-REF:SELN-FilterState-ENUM_RBV", kind="config", doc="Status", string=True
|
||||
EpicsSignal,
|
||||
suffix="ES2-REF:SELN-FilterState-ENUM_RBV",
|
||||
kind="config",
|
||||
doc="Status",
|
||||
string=True,
|
||||
)
|
||||
op_mode = Cpt(
|
||||
EpicsSignalWithRBV, suffix="ES2-REF:SELN-OpMode-ENUM", kind="config", doc="Status"
|
||||
)
|
||||
op_mode_string = Cpt(
|
||||
EpicsSignalWithRBV, suffix="ES2-REF:SELN-OpMode-ENUM", kind="config", doc="Status", string=True
|
||||
EpicsSignalWithRBV,
|
||||
suffix="ES2-REF:SELN-OpMode-ENUM",
|
||||
kind="config",
|
||||
doc="Status",
|
||||
string=True,
|
||||
)
|
||||
ref_set = Cpt(EpicsSignal, suffix="ES2-REF:SELN-SET", kind="config", doc="Requested reference")
|
||||
ref_rb = Cpt(
|
||||
@@ -149,6 +157,13 @@ class Reffoilchanger(PSIDeviceBase):
|
||||
self.foil38,
|
||||
]
|
||||
|
||||
def get_all_foils(self) -> list[str]:
|
||||
"""Returns a list of strings of all available foils"""
|
||||
foils_list = []
|
||||
for foil in self.foils:
|
||||
foils_list.append(foil.get())
|
||||
return foils_list
|
||||
|
||||
def insert(self, ref: str, wait: bool = False) -> DeviceStatus:
|
||||
"""Insert a reference
|
||||
|
||||
|
||||
Reference in New Issue
Block a user