elkpy.ParameterController

class elkpy.parametercontroller.ParameterController(address='localhost:51051', sushi_proto_def='/usr/share/sushi/sushi_rpc.proto')[source]

Bases: object

A class to control the parameter in sushi via gRPC. It manages the parameters of sushi. Enabling getting and setting of values as well as getting info about what parameters are availble and their ranges, types, etc.

Attributes:
_stub (ParameterControllerStub): Connection stubs to the gRPC parameter interface implemented in sushi.
__init__(address='localhost:51051', sushi_proto_def='/usr/share/sushi/sushi_rpc.proto')[source]

The constructor for the ParameterController class setting up the gRPC connection with sushi.

Parameters:
address (str): ‘ip-addres:port’ The ip-addres and port at which to connect to sushi. sushi_proto_def (str): path to .proto file with SUSHI’s gRPC services definition
get_parameter_id(processor_identifier: int, parameter_name: str) → int[source]

Get the id of the parameter of the specified processor corresponding to the specified parameter name.

Parameters:
processor_identifier (int): The id of the processor to get the parameter id from. parameter_name (str): The name of the parameter to get the id from.
Returns:
int: The id of the parameter matching the parameter name.
get_parameter_info(processor_identifier: int, parameter_identifier: int) → elkpy.sushi_info_types.ParameterInfo[source]

Get info about the specified parameter on the specified processor.

Parameters:
processor_identifier (int): The id of the processor to get the parameter info from. parameter_identifier (int): The id of the parameter to get the info from.
Returns:
info_types.ParameterInfo: Info of the parameter matching the id.
get_parameter_value(processor_identifier: int, parameter_identifier: int) → float[source]

Get the value of the parameter matching the specified parameter on the specified processor.

Parameters:
processor_identifier (int): The id of the processor to get the parameter value from. parameter_identifier (int): The id of the parameter to get the value from.
Returns:
float: The value of the parameter matching the id.
get_parameter_value_as_string(processor_identifier: int, parameter_identifier: int) → str[source]

Get the value of the parameter matching the specified parameter on the specified processor as a string.

Parameters:
processor_identifier (int): The id of the processor to get the parameter value string from. parameter_identifier (int): The id of the parameter to get value string from.
Returns:
str: The value as a string of the parameter matching the id.
get_parameter_value_in_domain(processor_identifier: int, parameter_identifier: int) → float[source]

Get the normalised value of the parameter matching the specified parameter on the specified processor.

Parameters:
processor_identifier (int): The id of the processor to get the normalised parameter value from. parameter_identifier (int): The id of the parameter to get the normalised value from.
Returns:
float: The normalised value of the parameter matching the id.
get_processor_parameters(processor_identifier: int) → List[elkpy.sushi_info_types.ParameterInfo][source]

Get a list of the parameters available to the specified processor.

Parameters:
processor_identifier (int): The id of the processor to get the parameters from.
Returns:
List[info_types.ParameterInfo]: A list of the parameters available to the processor matching the id.
get_processor_properties(processor_identifier: int) → List[elkpy.sushi_info_types.PropertyInfo][source]

Get a list of the string properties available to the specified processor.

Parameters:
processor_identifier (int): The id of the processor to get the properties from.
Returns:
List[info_types.PropertyInfo]: A list of the properties available to the processor matching the id.
get_property_id(processor_identifier: int, property_name: str) → int[source]

Get the id of the property of the specified processor corresponding to the specified property name.

Parameters:
processor_identifier (int): The id of the processor to get the parameter id from. property_name (str): The name of the property to get the id from.
Returns:
int: The id of the property matching the property name.
get_property_info(processor_identifier: int, property_identifier: int) → elkpy.sushi_info_types.PropertyInfo[source]

Get info about the specified property on the specified processor.

Parameters:
processor_identifier (int): The id of the processor to get the parameter info from. property_identifier (int): The id of the string property to get the info from.
Returns:
info_types.PropertyInfo: Info of the property matching the id.
get_property_value(processor_identifier: int, property_identifier: int) → str[source]

Get the value of the property matching the specified property on the specified processor.

Parameters:
processor_identifier (int): The id of the processor to get the parameter value string from. property_identifier (int): The id of the string property to get value string from.
Returns:
str: The value of the property matching the id.
get_track_parameters(track_identifier: int) → List[elkpy.sushi_info_types.ParameterInfo][source]

Get a list of parameters available on the specified track.

Parameters:
track_identifier (int): The id of the track to get the parameter list from.
Returns:
List[info_types.ParameterInfo]: A list of the info of the parameters assigned to the track matching the id.
get_track_properties(track_identifier: int) → List[elkpy.sushi_info_types.PropertyInfo][source]

Get a list of string properties available on the specified track.

Parameters:
track_identifier (int): The id of the track to get the property list from.
Returns:
List[info_types.PropertyInfo]: A list of the info of the properties assigned to the track matching the id.
set_parameter_value(processor_identifier: int, parameter_identifier: int, value: float) → None[source]

Set the value of the specified parameter on the specified processor.

Parameters:
processor_identifier (int): The id of the processor that has the parameter to be changed. parameter_identifier (int): The id of the property to set the value of.
set_property_value(processor_identifier: int, property_identifier: int, value: float) → None[source]

Set the value of the specified property on the specified processor.

Parameters:
processor_identifier (int): The id of the processor that has the property to be changed. property_identifier (int): The id of the property to set the value of. value (string) : The new value to assign to the property