ni_measurement_plugin_sdk_service.measurement.client_support
Support functions for the Measurement Plug-In Client.
Classes
Class that represents the metadata of parameters. |
Functions
|
Creates two message types in one file descriptor proto. |
|
Deserialize parameter bytes into separate parameter values. |
|
Serialize parameter values into a parameter byte string. |
Module Contents
- class ni_measurement_plugin_sdk_service.measurement.client_support.ParameterMetadata[source]
Bases:
NamedTupleClass that represents the metadata of parameters.
- type: google.protobuf.type_pb2.Field.Kind.ValueType
The datatype of the parameter represented by the gRPC field enum.
- repeated: bool
Indicates whether the parameter is a scalar or 1D array.
True for 1D array and false for scalar.
- default_value: Any
The default value of the parameter.
- message_type: str = ''
The gRPC full name of the message type.
Required when ‘type’ is Kind.TypeMessage. Ignored for any other ‘type’.
- enum_type: SupportedEnumType | None = None
Enum type of parameter
- ni_measurement_plugin_sdk_service.measurement.client_support.create_file_descriptor(service_name, output_metadata, input_metadata, pool)[source]
Creates two message types in one file descriptor proto.
- ni_measurement_plugin_sdk_service.measurement.client_support.deserialize_parameters(parameter_metadata_dict, parameter_bytes, message_name, *, convert_paths=True)[source]
Deserialize parameter bytes into separate parameter values.
- Parameters:
parameter_metadata_dict (dict[int, ni_measurement_plugin_sdk_service._internal.parameter.metadata.ParameterMetadata]) – Parameter metadata by ID.
parameter_byte – Byte string to deserialize.
message_name (str) – gRPC message name (e.g. f”{service_class}.Outputs”).
convert_paths (bool) – Specifies whether to convert path parameters to pathlib.Path.
parameter_bytes (bytes)
- Returns:
Deserialized parameter values, ordered by ID.
- Return type:
- ni_measurement_plugin_sdk_service.measurement.client_support.serialize_parameters(parameter_metadata_dict, parameter_values, message_name)[source]
Serialize parameter values into a parameter byte string.
- Parameters:
parameter_metadata_dict (dict[int, ni_measurement_plugin_sdk_service._internal.parameter.metadata.ParameterMetadata]) – Parameter metadata by ID.
parameter_values (collections.abc.Sequence[Any]) – Parameter values to serialize, ordered by ID.
message_name (str) – gRPC message name (e.g. f”{service_class}.Configurations”).
- Returns:
Serialized byte string containing parameter values.
- Return type: