streaming_data_types/logdata_f142.py
def serialise_f142(
    value: Any,
    source_name: str,
    timestamp_unix_ns: int = 0,
    alarm_status: Union[int, None] = None,
    alarm_severity: Union[int, None] = None,
) -> bytes:
    """
    Serialise value and corresponding timestamp as an f142 Flatbuffer message.
    Should automagically use a sensible type for value in the message, but if
    in doubt pass value in as a numpy ndarray of a carefully chosen dtype.

    :param value: only scalar value currently supported; if ndarray then ndim must be 0
    :param source_name: name of the data source
    :param timestamp_unix_ns: timestamp corresponding to value, e.g. when value was measured, in nanoseconds
    :param alarm_status: EPICS alarm status, best to provide using enum-like class defined in logdata_f142.AlarmStatus
    :param alarm_severity: EPICS alarm severity, best to provide using enum-like class defined in logdata_f142.AlarmSeverity
    """
    builder, source = _setup_builder(source_name)
    value = np.array(value)

    if value.ndim == 0:
        _serialise_value(
            builder, source, value, _serialise_string, _map_scalar_type_to_serialiser
        )
    elif value.ndim == 1:
        _serialise_value(
            builder,
            source,
            value,
            _serialise_stringarray,
            _map_array_type_to_serialiser,
        )
    else:
        raise NotImplementedError("f142 only supports scalars or 1D array values")

    return bytes(
        _complete_buffer(builder, timestamp_unix_ns, alarm_status, alarm_severity)
    )

    Serialise value and corresponding timestamp as an f142 Flatbuffer message.
    Should automagically use a sensible type for value in the message, but if
    in doubt pass value in as a numpy ndarray of a carefully chosen dtype.

    :param value: only scalar value currently supported; if ndarray then ndim must be 0
    :param source_name: name of the data source
    :param timestamp_unix_ns: timestamp corresponding to value, e.g. when value was measured, in nanoseconds
    :param alarm_status: EPICS alarm status, best to provide using enum-like class defined in logdata_f142.AlarmStatus
    :param alarm_severity: EPICS alarm severity, best to provide using enum-like class defined in logdata_f142.AlarmSeverity
    
Serialise value and corresponding timestamp as an f142 Flatbuffer message.
Should automagically use a sensible type for value in the message, but if
in doubt pass value in as a numpy ndarray of a carefully chosen dtype.
Serialise value and corresponding timestamp as an f142 Flatbuffer message . Should automagically use a sensible type for value in the message but if in doubt pass value in as a numpy ndarray of a carefully chosen dtype .
def serialise_f142(
    value: Any,
    source_name: str,
    timestamp_unix_ns: int = 0,
    alarm_status: Union[int, None] = None,
    alarm_severity: Union[int, None] = None,
) -> bytes:
    builder, source = _setup_builder(source_name)
    value = np.array(value)
    if value.ndim == 0:
        _serialise_value(
            builder, source, value, _serialise_string, _map_scalar_type_to_serialiser
        )
    elif value.ndim == 1:
        _serialise_value(
            builder,
            source,
            value,
            _serialise_stringarray,
            _map_array_type_to_serialiser,
        )
    else:
        raise NotImplementedError("f142 only supports scalars or 1D array values")
    return bytes(
        _complete_buffer(builder, timestamp_unix_ns, alarm_status, alarm_severity)
    )
def serialise_f142 ( value : Any , source_name : str , timestamp_unix_ns : int = 0 , alarm_status : Union [ int , None ] = None , alarm_severity : Union [ int , None ] = None , ) -> bytes : builder , source = _setup_builder ( source_name ) value = np . array ( value ) if value . ndim == 0 : _serialise_value ( builder , source , value , _serialise_string , _map_scalar_type_to_serialiser ) elif value . ndim == 1 : _serialise_value ( builder , source , value , _serialise_stringarray , _map_array_type_to_serialiser , ) else : raise NotImplementedError ( "f142 only supports scalars or 1D array values" ) return bytes ( _complete_buffer ( builder , timestamp_unix_ns , alarm_status , alarm_severity ) )
Serialise value and corresponding timestamp as an f142 Flatbuffer message.
Serialise value and corresponding timestamp as an f142 Flatbuffer message .
"""
    Serialise value and corresponding timestamp as an f142 Flatbuffer message.
    Should automagically use a sensible type for value in the message, but if
    in doubt pass value in as a numpy ndarray of a carefully chosen dtype.

    :param value: only scalar value currently supported; if ndarray then ndim must be 0
    :param source_name: name of the data source
    :param timestamp_unix_ns: timestamp corresponding to value, e.g. when value was measured, in nanoseconds
    :param alarm_status: EPICS alarm status, best to provide using enum-like class defined in logdata_f142.AlarmStatus
    :param alarm_severity: EPICS alarm severity, best to provide using enum-like class defined in logdata_f142.AlarmSeverity
    """
value
Any
only scalar value currently supported; if ndarray then ndim must be 0
only scalar value currently supported ; if ndarray then ndim must be 0
source_name
str
name of the data source
name of the data source
timestamp_unix_ns
int
timestamp corresponding to value, e.g. when value was measured, in nanoseconds
timestamp corresponding to value e . g . when value was measured in nanoseconds
alarm_status
Union[int, None]
EPICS alarm status, best to provide using enum-like class defined in logdata_f142.AlarmStatus
EPICS alarm status best to provide using enum - like class defined in logdata_f142 . AlarmStatus
alarm_severity
Union[int, None]
EPICS alarm severity, best to provide using enum-like class defined in logdata_f142.AlarmSeverity
EPICS alarm severity best to provide using enum - like class defined in logdata_f142 . AlarmSeverity