caproto.server.pvproperty¶
- class caproto.server.pvproperty(get=None, put=None, startup=None, shutdown=None, *, scan=None, name=None, dtype=None, value=None, max_length=None, alarm_group=None, doc=None, read_only=None, field_spec=None, fields=None, record=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
- fieldsFieldSpec, 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_type
strThe 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.