fastcs.transports.epics.pva.types#

Members

AlarmInfo

The alarm state of a PV, following the PVXS alarm_t normative type.

P4PAlarmState

Wraps AlarmInfo as the alarm sub-structure of a p4p NT* Value.

Severity

Alarm severity for a PV, as defined by the PVXS alarm_t normative type.

Status

Alarm status for a PV.

cast_from_p4p_value

Converts from a p4p value to a FastCS Attribute value.

cast_to_p4p_value

Converts a FastCS Attribute value to a p4p value

make_p4p_type

Creates a p4p type for a given Attribute DataType.

p4p_alarm_states

Returns the p4p alarm structure for a given severity, status, and message, validated as a Pydantic model.

p4p_display

Gets the p4p display structure for a given attribute.

p4p_timestamp_now

The p4p timestamp structure for the current time.

fastcs.transports.epics.pva.types.make_p4p_type(attribute: Attribute) NTScalar | NTEnum | NTNDArray | NTTable[source]#

Creates a p4p type for a given Attribute DataType.

fastcs.transports.epics.pva.types.cast_from_p4p_value(attribute: Attribute[DType_T, AttributeIORef], value: object) DType_T[source]#

Converts from a p4p value to a FastCS Attribute value.

class fastcs.transports.epics.pva.types.Severity(value)[source]#

Alarm severity for a PV, as defined by the PVXS alarm_t normative type.

Whether MINOR or MAJOR applies is context-dependent and can vary per PV. INVALID indicates the current value should not be treated as a meaningful reading (e.g. of the underlying measured quantity) and typically reflects the last known good value rather than a fresh one.

class fastcs.transports.epics.pva.types.Status(value)[source]#

Alarm status for a PV.

Identifies which part of the system raised the alarm, as defined by the PVXS alarm_t normative type.

class fastcs.transports.epics.pva.types.AlarmInfo(*, severity: Severity = Severity.NO_ALARM, status: Status = Status.NO_ALARM, message: str = '')[source]#

The alarm state of a PV, following the PVXS alarm_t normative type.

See https://epics-base.github.io/pvxs/nt.html#alarm-t.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

class fastcs.transports.epics.pva.types.P4PAlarmState(*, alarm: AlarmInfo)[source]#

Wraps AlarmInfo as the alarm sub-structure of a p4p NT* Value.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

fastcs.transports.epics.pva.types.p4p_alarm_states(severity: Severity = Severity.NO_ALARM, status: Status = Status.NO_ALARM, message: str = '') P4PAlarmState[source]#

Returns the p4p alarm structure for a given severity, status, and message, validated as a Pydantic model.

fastcs.transports.epics.pva.types.p4p_timestamp_now() dict[str, dict[str, int]][source]#

The p4p timestamp structure for the current time.

fastcs.transports.epics.pva.types.p4p_display(attribute: Attribute) dict[source]#

Gets the p4p display structure for a given attribute.

fastcs.transports.epics.pva.types.cast_to_p4p_value(attribute: Attribute[DType_T, AttributeIORef], value: DType_T) object[source]#

Converts a FastCS Attribute value to a p4p value