devctrl.devices.wheel.impl.thorlabs_fw.ThorlabsFW#

class ThorlabsFW(port, slots: list[str] | None = None, respect_bound=True)[source]#

Bases: Wheel

Methods

add_device

Manually add a specific device.

allow_only_dummy_devices

connect

connect_device

Connect a filter wheel from the device name.

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_position

get_slot

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.

set_position

set_slot

_CLASS_TYPE = 'implementation'#
__abstractmethods__ = frozenset({})#
__annotations__ = {'_manual_devices': list[str]}#
__dict__ = mappingproxy({'__module__': 'devctrl.devices.wheel.impl.thorlabs_fw', '__firstlineno__': 11, '_CLASS_TYPE': 'implementation', '__init__': <function ThorlabsFW.__init__>, 'set_position': <function ThorlabsFW.set_position>, 'get_position': <function ThorlabsFW.get_position>, 'set_slot': <function ThorlabsFW.set_slot>, 'get_slot': <function ThorlabsFW.get_slot>, 'get_status': <function ThorlabsFW.get_status>, 'connect_device': <classmethod(<function ThorlabsFW.connect_device>)>, '_enumerate_devices': <classmethod(<function ThorlabsFW._enumerate_devices>)>, 'is_connected': <function ThorlabsFW.is_connected>, '__repr__': <function ThorlabsFW.__repr__>, '__static_attributes__': ('_log_name', 'device', 'port', 'slots'), '__doc__': None, '__abstractmethods__': frozenset(), '_abc_impl': <_abc._abc_data object>, '_children': {}, '_manual_devices': []})#
__firstlineno__ = 11#
__init__(port, slots: list[str] | None = None, respect_bound=True)[source]#
__module__ = 'devctrl.devices.wheel.impl.thorlabs_fw'#
__repr__()[source]#
Returns:

The name of the device. If applicable, this should include serial port, GPIB address, etc.

__slots__ = ()#
__static_attributes__ = ('_log_name', 'device', 'port', 'slots')#
__weakref__#

list of weak references to the object

_abc_impl = <_abc._abc_data object>#
_children = {}#
_dummies_only = False#
classmethod _enumerate_devices() list[str][source]#

List all available Thorlabs Filter Wheels.

List all serial devices with no product field, serial number starting with “TP” and “FTDI” as manufacturer. Alternatively, find out the COM port of your board and manually add the device using

ThorlabsFW.add_device(‘Filter Whel’, port=’COMx’, slots=[‘420LP’, ‘375LP’,…])

_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: str)[source]#

Connect a filter wheel from the device name.

The name must contain port=<PORT-NAME>. It may also contain slots=<slot1>,<slot2>,<slot3>,<slot4>,<slot5>,<slot6>, where ´`<slotX>`` is the name of the filter or sample in the slot. Set to None if the slot is empty. No spaces or special characters allowed.

Returns:

Device instance

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_position() int[source]#
get_slot() str[source]#
get_status() str[source]#

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[source]#

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

set_position(position: int)[source]#
set_slot(slot: str)[source]#