common_tsp_error_check_mixin

A mixin class that contains common methods for checking the TSP device for errors.

CommonTSPErrorCheckMixin

CommonTSPErrorCheckMixin(config_entry: DeviceConfigEntry, verbose: bool)

Bases: _AbstractDeviceVISAWriteQueryControl, ABC

flowchart LR tm_devices.driver_mixins.shared_implementations.common_tsp_error_check_mixin.CommonTSPErrorCheckMixin[CommonTSPErrorCheckMixin] tm_devices.driver_mixins.device_control._abstract_device_visa_write_query_control._AbstractDeviceVISAWriteQueryControl[_AbstractDeviceVISAWriteQueryControl] tm_devices.driver_mixins.device_control._abstract_device_control._AbstractDeviceControl[_AbstractDeviceControl] tm_devices.driver_mixins.device_control._abstract_device_visa_write_query_control._AbstractDeviceVISAWriteQueryControl --> tm_devices.driver_mixins.shared_implementations.common_tsp_error_check_mixin.CommonTSPErrorCheckMixin tm_devices.driver_mixins.device_control._abstract_device_control._AbstractDeviceControl --> tm_devices.driver_mixins.device_control._abstract_device_visa_write_query_control._AbstractDeviceVISAWriteQueryControl click tm_devices.driver_mixins.shared_implementations.common_tsp_error_check_mixin.CommonTSPErrorCheckMixin href "" "tm_devices.driver_mixins.shared_implementations.common_tsp_error_check_mixin.CommonTSPErrorCheckMixin" click tm_devices.driver_mixins.device_control._abstract_device_visa_write_query_control._AbstractDeviceVISAWriteQueryControl href "" "tm_devices.driver_mixins.device_control._abstract_device_visa_write_query_control._AbstractDeviceVISAWriteQueryControl" click tm_devices.driver_mixins.device_control._abstract_device_control._AbstractDeviceControl href "" "tm_devices.driver_mixins.device_control._abstract_device_control._AbstractDeviceControl"

A mixin class that contains common methods for checking the TSP device for errors.

Important

Any class that inherits this mixin must also inherit the TSPControl mixin in order to have access to the methods required by this class.

Parameters:
  • config_entry (DeviceConfigEntry) –

    A config entry object parsed by the DMConfigParser.

  • verbose (bool) –

    A boolean indicating if verbose output should be printed. If True, communication printouts will be logged with a level of INFO. If False, communication printouts will be logged with a level of DEBUG.

device_type abstractmethod cached property

device_type: str

Return a string representing the device type.

ip_address abstractmethod cached property

ip_address: str

The IP address of the device.

manufacturer abstractmethod cached property

manufacturer: str

Return the manufacturer of the device.

model abstractmethod cached property

model: str

Return the full model of the device.

name_and_alias abstractmethod cached property

name_and_alias: str

A string containing the device name and alias.

serial abstractmethod cached property

serial: str

Return the serial number of the device.

sw_version abstractmethod cached property

sw_version: Version

Return the software version of the device.

expect_esr

expect_esr(
    esr: int, error_messages: tuple[str, ...] = (), *, use_regex_match: bool = False
) -> bool

Checks for the expected esr value and queued error messages.

Parameters:
  • esr (int) –

    Expected *ESR? value as a decimal-weighted integer.

  • error_messages (tuple[str, ...], default: () ) –

    Expected error buffer messages in a tuple.

  • use_regex_match (bool, default: False ) –

    A boolean indicating if the messages should be compared using regular expressions. Does not affect the esr value comparison.

Returns:
  • bool

    Boolean True when all checks pass. False means the checks failed (however, failing a check will always result in an AssertionError being raised, so the result will not really be usable).

Raises:
  • AssertionError

    Indicating that the device’s error code and messages don’t match the expected values.

query abstractmethod

query(*args: Any, **kwargs: Any) -> str

Query the device.

write abstractmethod

write(*args: Any, **kwargs: Any) -> None

Write to the device.