You are reading the documentation for the main branch, which may contain unreleased changes. The most recent release is v0.1.0.

pnpq.devices.switch_thorlabs_osw_e_stub module#

class pnpq.devices.switch_thorlabs_osw_e_stub.OpticalSwitchThorlabsEStub(*, _is_open: bool = False, _current_state: pnpq.devices.switch_thorlabs_osw_e.State = <State.BAR: 1>)#

Bases: AbstractOpticalSwitchThorlabsE

Parameters:
  • _is_open (bool)

  • _current_state (State)

close()#

Close the serial connection to the switch.

Once closed, attempting to re-open the connection will cause an InvalidStateException.

Return type:

None

get_board_name()#
Returns:

The switch name and firmware version as a human-readable, unstructured string.

Return type:

str

get_state()#

Get the current state of the switch.

Returns:

The current state of the switch.

Return type:

State

get_type_code()#
Returns:

The board type code according to the configuration table, as a human-readable, unstructured string. The Thorlabs manual does not seem to explain what the configuration table is.

Return type:

str

open()#

Open the serial connection to the switch.

Once opened, attempting to call open() again will cause an InvalidStateException.

Return type:

None

set_state(state)#

Set the switch to the specified state. This function is idempotent; if the switch is already in the desired state, setting it to the same state again will not cause an error.

Parameters:

state (State) – The state to set the switch to.

Return type:

None