caproto.server.pvproperty

Inheritance diagram of pvproperty
class caproto.server.pvproperty(get: Getter | None = None, put: Putter | None = None, startup: Startup | None = None, shutdown: Shutdown | None = None, *, scan=None, name: str | None = None, dtype: Type[T_Data] | None = None, value: Any | None = None, max_length: int | None = None, alarm_group: str | None = None, doc: str | None = None, read_only: bool | None = None, field_spec: FieldSpec | None = None, fields: Tuple[Tuple[Tuple[str, str], Getter | Putter | Startup | Shutdown | Scan], ...] | None = None, record: str | Type[T_RecordFields] | None = None, **cls_kwargs)[source]

A property-like descriptor for specifying a PV in a PVGroup.

Parameters:
getasync callable, optional

Called when PV is read through channel access

putasync callable, optional

Called when PV is written to through channel access

startupasync callable, optional

Called at start of server; a hook for initialization and background processing

shutdownasync callable, optional

Called at shutdown of server; a hook for cleanup

scanasync callable, optional

Called periodically at a configured rate.

namestr, optional

The PV name (defaults to the attribute name of the pvproperty)

dtypeChannelType or builtin type, optional

The data type

valueany, optional

The initial value

max_lengthint, optional

The maximum possible length acceptable for the data By default, this is len(value) or 1

alarm_groupstr, optional

The alarm group the PV should be attached to

read_onlybool, optional

Read-only PV over channel access

docstr, optional

Docstring associated with the property

fieldslist of FieldSpecItem, optional

Specification for record fields

**cls_kwargs

Keyword arguments for the ChannelData-based class

Attributes:
pvspecPVSpec

The information from __init__ is aggregated into a single, immutable PVSpec instance.

record_typestr

The configured record type to report.

field_specFieldSpec

The field specification information helper.

Methods

from_pvspec(pvspec, **kwargs)

Create a pvproperty from a PVSpec instance.

getter(get)

Usually used as a decorator, this sets the getter in the PVSpec.

putter(put)

Usually used as a decorator, this sets the putter in the PVSpec.

scan(period, *[, subtract_elapsed, ...])

Periodically call a function to update a pvproperty.

shutdown(shutdown)

Usually used as a decorator, this sets shutdown in the PVSpec.

startup(startup)

Usually used as a decorator, this sets startup in the PVSpec.

Attributes

fields

record_type

The configured record type to report.