Source code for pyaml.control.deviceaccess

from abc import ABCMeta, abstractmethod

# TODO: correctly type value


[docs] class DeviceAccess(metaclass=ABCMeta): """ Abstract class providing access to a control system variable """
[docs] @abstractmethod def name(self) -> str: """Return the name of the variable""" pass
[docs] @abstractmethod def measure_name(self) -> str: """Return the name of the measure""" pass
[docs] @abstractmethod def set(self, value): """Write a control system device variable (i.e. a power supply current)""" pass
[docs] @abstractmethod def set_and_wait(self, value): """Write a control system device variable (i.e. a power supply current)""" pass
[docs] @abstractmethod def get(self): """Return the setpoint(s) of a control system device variable""" pass
[docs] @abstractmethod def readback(self): """Return the measured variable""" pass
[docs] @abstractmethod def unit(self) -> str: """Return the variable unit""" pass
[docs] @abstractmethod def get_range(self) -> list[float]: """ Get the valid range for the device variable. Returns ------- list[float] List containing [min, max] values """ pass
[docs] @abstractmethod def check_device_availability(self) -> bool: """ Check if the device is available and accessible. Returns ------- bool True if device is available, False otherwise """ pass