pylab_ml.collate_instrument.CollateInstrument

class CollateInstrument(*args, **kwargs)[source]

Bases: object

Singleton class to collate all instrument instantiations

__init__()[source]

Methods

__init__()

add(instrument)

Add an instrument to the collate instrument.

drop(interface, address[, force])

Drop an instrument from the collate instrument.

find_instrument(instName)

Find an instrument by its name.

get_instrument(interface, address)

Get an instrument from the collate instrument.

identification(interface, address[, ...])

Add identification information to an instrument.

list_int([interface])

List all instruments of the given interface(s) or all instruments if no interface is given.

add(instrument)[source]

Add an instrument to the collate instrument.

Parameters:

instrument (BaseInstrument) – Instrument to add

Returns:

instrument – Instrument that was added

Return type:

BaseInstrument

drop(interface, address, force=False)[source]

Drop an instrument from the collate instrument.

Parameters:
  • interface (Interface) – Interface of the instrument

  • address (int) – Address of the instrument

  • force (bool, optional) – Force drop the instrument even if not initialized

find_instrument(instName)[source]

Find an instrument by its name.

Parameters:

instName (str) – Name of the instrument

Returns:

The instrument item if found, otherwise None

Return type:

InstrumentItem or None

get_instrument(interface, address)[source]

Get an instrument from the collate instrument.

Parameters:
  • interface (Interface) – Interface of the instrument

  • address (int) – Address of the instrument

Returns:

The instrument item if found, otherwise None

Return type:

InstrumentItem or None

identification(interface, address, identity=None, module=None, initialized=None, instance=None, instName=None)[source]

Add identification information to an instrument.

Parameters:
  • interface (Interface) – Interface of the instrument

  • address (int) – Address of the instrument

  • identity (str, optional) – Identity of the instrument

  • module (str, optional) – Module name of the instrument

  • initialized (bool, optional) – Initialization status of the instrument

  • instance (object, optional) – Instance of the instrument

  • instName (str, optional) – Name of the instrument

list_int(interface=[])[source]

List all instruments of the given interface(s) or all instruments if no interface is given.

Parameters:

interface (list of Interface) – List of interfaces to list, if empty list is given, all interfaces are listed