AsciiRegister

class lsst.ts.tunablelaser.AsciiRegister(component, module_name, module_id, register_name, read_only=True, accepted_values=None)

Bases: object

A representation of an Ascii register inside of a module of the laser.

The class corresponds to a register within a module of a laser. A register can be read only or writable. If it is read only then the accepted_values argument is ignored.

Parameters:
componentLaser

Reference to the component.

module_namestr

The name of the module that is the parent of the register.

module_idint

The id of the module that is the parent of the register.

register_namestr

The name of the register.

read_onlybool, optional

Whether the register is read only or writable.

accepted_valueslist [str] or list [int] or None, optional

If read_only is set to true then this parameter can be None. If not, this parameter must contain a list of values accepted by this register and can be of int or str.

simulation_modebool, optional

A bool representing whether the register is in simulation mode or not. Currently is not implemented.

Attributes:
loglogging.Logger

The log for this class.

commanderTCPIPClient

A TCP/IP client for communicating with the TunableLaser.

module_namestr

The name of the module that is the parent of the register.

module_idint

The id of the module that is the parent of the register.

register_namestr

The name of the register.

read_onlybool

Whether the register is read only or writable.

accepted_valueslist

If read_only is set to true then this parameter can be None. If not, this parameter must contain a list of values accepted by this register and can be of int or str.

simulation_modebool

A bool representing whether the register is in simulation mode or not. Currently has a basic implementation.

register_valuestr

The value of the register as gotten by get_register_value().

Methods Summary

create_get_message()

Generate the message that will get the register value.

create_set_message(set_value)

Create the message that sets the value of the register provided that it is not read only.

send_command([set_value])

Read the value of the register.

Methods Documentation

create_get_message()

Generate the message that will get the register value.

Returns:
get_message: bytes
create_set_message(set_value)

Create the message that sets the value of the register provided that it is not read only.

Parameters:
set_valueAny
Returns:
set_messagebytes
Raises:
ReadOnlyException

Indicates that the register is read only.

ValueError

Indicates that the value received is not in the acceptable values for the register.

async send_command(set_value=None)

Read the value of the register.

Returns:
None