fastcs.attributes#
Members
An AttributeIO callback that takes an AttrR and updates its value |
|
Callbacks to be called when the setpoint of an attribute is changed |
|
A callback to be called when the value of the attribute is updated |
|
A read-only |
|
A read-write |
|
Callbacks to be called when the setpoint of an attribute is changed |
|
A callback to be called periodically to update an attribute |
|
A write-only |
|
Base FastCS attribute. |
|
Special value to indicate that an attribute should be updated once on start up. |
- fastcs.attributes.ONCE = inf#
Special value to indicate that an attribute should be updated once on start up.
- class fastcs.attributes.Attribute(datatype: DataType[T], io_ref: AttributeIORefT | None = None, group: str | None = None, description: str | None = None)[source]#
Base FastCS attribute.
Instances of this class added to a
Controllerwill be used by the FastCS class.
- fastcs.attributes.AttrIOUpdateCallback#
An AttributeIO callback that takes an AttrR and updates its value
- fastcs.attributes.AttrUpdateCallback#
A callback to be called periodically to update an attribute
- fastcs.attributes.AttrOnUpdateCallback#
A callback to be called when the value of the attribute is updated
- class fastcs.attributes.AttrR(datatype: DataType[T], io_ref: AttributeIORefT | None = None, group: str | None = None, initial_value: T | None = None, description: str | None = None)[source]#
A read-only
Attribute.- async update(value: T) None[source]#
Update the value of the attibute
This sets the cached value of the attribute presented in the API. It should generally only be called from an IO or a controller that is updating the value from some underlying source.
To request a change to the setpoint of the attribute, use the
putmethod, which will attempt to apply the change to the underlying source.
- add_on_update_callback(callback: Callable[[T], Awaitable[None]]) None[source]#
Add a callback to be called when the value of the attribute is updated
The callback will be called with the updated value.
- fastcs.attributes.AttrOnPutCallback#
Callbacks to be called when the setpoint of an attribute is changed
- fastcs.attributes.AttrSyncSetpointCallback#
Callbacks to be called when the setpoint of an attribute is changed
- class fastcs.attributes.AttrW(datatype: DataType[T], io_ref: AttributeIORefT | None = None, group: str | None = None, description: str | None = None)[source]#
A write-only
Attribute.- async put(setpoint: T, sync_setpoint: bool = False) None[source]#
Set the setpoint of the attribute
This should be called by clients to the attribute such as transports to apply a change to the attribute. The
_on_put_callbackwill be called with this new setpoint, which may or may not take effect depending on the validity of the new value. For example, if the attribute has an IO to some device, the value might be rejected.To directly change the value of the attribute, for example from an update loop that has read a new value from some underlying source, call the
updatemethod.