devctrl.devices.voltmeter.impl.dummy.DummyVoltmeter#

class DummyVoltmeter(amplitude: float = 1.0, frequency: float = 20.0)[source]#

Bases: Voltmeter, DummyDevice

Methods

add_device

Manually add a specific device.

allow_only_dummy_devices

connect

connect_device

This function should be overridden by device implementations only, and is not intended to be used directly.

connect_dummy

Connect an instance of the device's dummy implementation

get_base_classes

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}

get_device_name

get_device_type_name

get_status

Query the status of the device and return a string describing errors.

is_connected

Query whether the device is (still) connected

list_devices

Get a list of all devices for this type.

measure

Take voltage readings at regular intervals

read_value

Read a single voltage measurement

reset

run

run_script

test_connection

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.

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

measure(interval: int, update_func: Callable[[int, float, float], None] | None = None, max_measurements: int | None = None)[source]#

Take voltage readings at regular intervals

Dummy implementation that does nothing (simulated measurements are generated on-demand).

Parameters:
  • interval – Milliseconds to wait between readings (unused in dummy)

  • update_func – Function called after each reading (unused in dummy)

  • max_measurements – Number of readings to perform (unused in dummy)

read_value() tuple[float, float][source]#

Read a single voltage measurement

Generates a simulated sine wave voltage reading with configurable amplitude and frequency.

Returns:

Tuple of (timestamp, voltage) values