Beam Flags Instrument

Instrument for homebuilt Arduino based beam flags. Designed to work with Arduino running:

qnd_simple_double_flag_controller.ino “QND Simple Double Flag Controller, version 0.1, date 2019-09-17”
class hyperion.instrument.misc.beam_flags_instr.BeamFlagsInstr(settings)

Beam Flags Instrument Intended to be used with an arduino running:

qnd_simple_double_flag_controller.ino “QND Simple Double Flag Controller, version 0.1, date 2019-09-17”
Parameters:settings (dict) – This includes all the settings needed to connect to the device in question.
f1

bool: Set/get flag with label ‘1’ (True for ‘g’, False for ‘r’)

f2

bool: Set/get flag with label ‘2’ (True for ‘g’, False for ‘r’)

f3

bool: Set/get flag with label ‘2’ (True for ‘g’, False for ‘r’)

finalize()

Closes the connection to the device.

get_flag(flag_number)

Get flag state as bool. Identify flag by its number (in stead of string)

Parameters:flag_number (int) – The number indicating the flag
Returns:True for ‘g’ and False for ‘r’, (None for other)
Return type:bool
get_specific_flag_state(flag_name)

Query the state of a specific flag. Also updates this Instruments internal state if the flag name occurs in the dictionary. (Does not check for valid flag_name)

Parameters:flag_name (string) – the name of the flag
Returns:state of the flag
Return type:string
idn()

Identify command.

Returns:Identification string of the device (if it has it)
Return type:str
initialize()

Starts the connection to the device.

passive_update_from_manual_changes()

When toggle switches are manually changed, the arduino will send messages like 1g or 2r. This method will read the Serial buffer-in and update this Instruments internal state of the flags according to the last states found in the buffer.

Returns:if it changed any state
Return type:bool
set_flag(flag_number, bool_state)

Set flag using its number and bool state.

Parameters:
  • flag_number (int) –
  • bool_state (bool) – flag state (True for ‘g’, False for ‘r’)
set_specific_flag_state(flag_name, flag_state)

Sets a beam flag to a specific state.

Parameters:
  • flag_name (str) – The one character flag name listed in the settings (i.e. ‘1’ or ‘2’)
  • flag_state (str) – The one character state string listed in the settings (i.e. ‘r’ or ‘g’)
update_all_states()

Queries all flag states and updates this Instruments internal flag states. Returns if any internal state has changed.

Returns:true if any state has changed
Return type:bool