AsciiRegister¶
- class lsst.ts.tunablelaser.AsciiRegister(component, module_name, module_id, register_name, read_only=True, accepted_values=None)¶
Bases:
objectA 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_valuesargument is ignored.- Parameters:
- component
Laser Reference to the component.
- module_name
str The name of the module that is the parent of the register.
- module_id
int The id of the module that is the parent of the register.
- register_name
str The name of the register.
- read_only
bool, optional Whether the register is read only or writable.
- accepted_values
list[str] orlist[int] orNone, 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_mode
bool, optional A bool representing whether the register is in simulation mode or not. Currently is not implemented.
- component
- Attributes:
- log
logging.Logger The log for this class.
- commander
TCPIPClient A TCP/IP client for communicating with the TunableLaser.
- module_name
str The name of the module that is the parent of the register.
- module_id
int The id of the module that is the parent of the register.
- register_name
str The name of the register.
- read_only
bool Whether the register is read only or writable.
- accepted_values
list 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_mode
bool A bool representing whether the register is in simulation mode or not. Currently has a basic implementation.
- register_value
str The value of the register as gotten by
get_register_value().
- log
Methods Summary
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
- get_message:
- 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_message
bytes
- set_message
- 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