mpylab.device.amplifier module

mpylab.device.amplifier module.

class mpylab.device.amplifier.AMPLIFIER(SearchPaths=None)

Bases: NPORT

Child class for all py-drivers for amplifiers The parent class is NPORT

This class is to be used for all passive amplifiers (no remote control). The class adds the methods ‘Operate’, ‘Standby’, ‘Pon’, ‘POff’ and ‘SetState’ to NPORT to complete the AMPLIFIER API.

The class is base class for all drivers of remote controlled amplifies.

Parameters:

SearchPaths (sequence of path-like, optional) – Directories searched for device INI files and referenced NPORT data.

GetState()

Return the last successfully requested amplifier state.

Returns:

(0, state) with the cached canonical state.

Return type:

tuple

Init(ini=None, channel=None, ignore_bus=None)

Initialize NPORT data and optional amplifier communication.

Parameters:
  • ini (path-like or file-like, optional) – Device configuration source.

  • channel (int or str, optional) – Initial logical channel.

  • ignore_bus (bool or None, optional) – Bus policy. None selects the active amplifier default and initializes communication. Passive or virtual amplifier drivers may override that class default.

Returns:

Device status; zero indicates success.

Return type:

int

Operate()

Switch to the Operate state.

Returns:

Device status returned by SetState().

Return type:

int

POff()

Switch to the POff state.

Returns:

Device status returned by SetState().

Return type:

int

POn()

Switch to the POn state.

Returns:

Device status returned by SetState().

Return type:

int

Quit()

Power off and close the driver.

Returns:

Bitwise combination of shutdown and base-driver errors.

Return type:

int

STATES = ('Operate', 'Standby', 'POn', 'POff')
SetState(state)

Set the remotely controlled amplifier state.

Parameters:

state (str) – State matching Operate, Standby, POn, or POff. Close spellings are normalized by fuzzy matching.

Returns:

Device status; zero indicates success.

Return type:

int

Standby()

Switch to the Standby state.

Returns:

Device status returned by SetState().

Return type:

int

mpylab.device.amplifier.main()

main function.