devctrl.devices.temperature_controller.impl.dummy.DummyTemperatureController#
- class DummyTemperatureController[source]#
Bases:
TemperatureController,DummyDeviceMethods
Manually add a specific device.
This function should be overridden by device implementations only, and is not intended to be used directly.
Connect an instance of the device's dummy implementation
Return a flat dictionary of all base classes below this class :param recurse: If True, recursively search for base classes :return: dict of {class name: class}
Query the status of the device and return a string describing errors.
Query whether the device is (still) connected
Get a list of all devices for this type.
Wait until the device temperature reaches the target temperature
- _CLASS_TYPE = 'dummy'#
- __abstractmethods__ = frozenset({})#
- __annotations__ = {}#
- __dict__ = mappingproxy({'__module__': 'devctrl.devices.temperature_controller.impl.dummy', '__firstlineno__': 4, '__init__': <function DummyTemperatureController.__init__>, 'get_temperature_C': <function DummyTemperatureController.get_temperature_C>, 'set_temperature_C': <function DummyTemperatureController.set_temperature_C>, 'enable': <function DummyTemperatureController.enable>, 'disable': <function DummyTemperatureController.disable>, 'is_enabled': <function DummyTemperatureController.is_enabled>, 'wait_for_temperature_C': <function DummyTemperatureController.wait_for_temperature_C>, '__repr__': <function DummyTemperatureController.__repr__>, '__static_attributes__': ('_enabled', 'status', 'temperature_C'), '__doc__': None, '__abstractmethods__': frozenset(), '_abc_impl': <_abc._abc_data object>, '_children': {}, '_manual_devices': [], '_CLASS_TYPE': 'dummy'})#
- __firstlineno__ = 4#
- __module__ = 'devctrl.devices.temperature_controller.impl.dummy'#
- __repr__()[source]#
- Returns:
The name of the device. If applicable, this should include serial port, GPIB address, etc.
- __slots__ = ()#
- __static_attributes__ = ('_enabled', 'status', 'temperature_C')#
- __weakref__#
list of weak references to the object
- _abc_impl = <_abc._abc_data object>#
- _children = {}#
- _dummies_only = False#
- classmethod _enumerate_devices() list[str]#
This function should be overridden by device implementations only, and is not intended to be used directly. Instead, use list_devices() to get a list of devices. Use enumerate_devices only directly when you only want to list devices of one specific implementation, i.e., only SR830 Lock-In: SR830._enumerate_devices() :param class_name: The name of the device class
- _manual_devices: list[str] = []#
- classmethod add_device(connect_info)#
Manually add a specific device. The device will show up when list_devices() is called for the device type. Call this from the device class implementation, e.g. use ModelXYZ9000.add_device(‘GPIB:1234:5678’) to add a specific device with a fixed GPIB address. This is useful when automatic discovery is undesired/impossible, either because it is not implemented or it disturbs other devices which can’t handle a identification request. :param cls: The device implementation class :param connect_info: A string argument that is passed to the connect() method of the device implementation, when the device is being connected.
- static allow_only_dummy_devices()#
- classmethod connect(device_type_name: str, device_name: str | None, **kwargs) Device#
- Parameters:
device_type_name – The name of the device class
device_name – The name of the device class
- classmethod connect_device(device_name)#
This function should be overridden by device implementations only, and is not intended to be used directly. Instead, use list_devices() to get a list of devices, and pass the selected device type and name to connect() :param device_name: The name of the device class
- classmethod connect_dummy(**kwargs) Device#
Connect an instance of the device’s dummy implementation
- classmethod get_base_classes(recurse=True) dict[str, type[Device]]#
Return a flat dictionary of all base classes below this class :param recurse: If True, recursively search for base classes :return: dict of {class name: class}
- classmethod get_device_name() str#
- Returns:
The specific type name of the device, e.g., SR830 or Keithly2600
- classmethod get_device_type_name() str#
- Returns:
The general type name of the device, e.g., Lock-In Amplifier or Voltmeter
- get_status() str#
Query the status of the device and return a string describing errors. If everything is ok, empty string must be returned :return: String of device status
- is_connected() bool#
Query whether the device is (still) connected
- classmethod list_devices() list[tuple[str, str]]#
Get a list of all devices for this type. The list made up of: - Manually added devices - Available devices (those returned by _enumerate_devices) - A dummy device (if a dummy implementation exists) - List of all devices of child classes
- Returns:
list of available devices
- wait_for_temperature_C(target_temperature_C, timeout_s=None, sleep_interval=1, n_digits=0) float[source]#
Wait until the device temperature reaches the target temperature
Blocks until the device temperature equals the target temperature (both rounded to the specified number of digits).
- Parameters:
target_temperature_C – Target temperature in °C. Note: the controller must already be set to this temperature
timeout_s – Maximum number of seconds to wait. None for no timeout. If temperatures are not equal within timeout, raises RuntimeError
sleep_interval – Seconds to sleep between temperature checks
n_digits – Number of digits to round both temperatures before comparing
log_interval – Minimum seconds between log messages
- Returns:
Number of seconds required to reach target temperature
- Raises:
RuntimeError – If target temperature not reached within timeout period