ophyd.device.Component¶
-
class
ophyd.device.Component(cls, suffix=None, *, lazy=False, trigger_value=None, add_prefix=None, doc=None, kind=<Kind.normal: 1>, **kwargs)¶ A descriptor representing a device component (or signal)
Unrecognized keyword arguments will be passed directly to the component class initializer.
Parameters: - cls : class
Class of signal to create. The required signature of cls.__init__ is (if suffix is given):
def __init__(self, pv_name, parent=None, **kwargs):
or (if suffix is None)
def __init__(self, parent=None, **kwargs):
The class may have a wait_for_connection() which is called during the component instance creation.
- suffix : str, optional
The PV suffix, which gets appended onto
parent.prefixto generate the final PV that the instance component will bind to. Also seeadd_prefix- lazy : bool, optional
Lazily instantiate the signal. If
False, the signal will be instantiated upon component instantiation- trigger_value : any, optional
Mark as a signal to be set on trigger. The value is sent to the signal at trigger time.
- add_prefix : sequence, optional
Keys in the kwargs to prefix with the Device PV prefix during creation of the component instance. Defaults to
('suffix', 'write_pv', )- doc : str, optional
string to attach to component DvcClass.component.__doc__
-
__init__(cls, suffix=None, *, lazy=False, trigger_value=None, add_prefix=None, doc=None, kind=<Kind.normal: 1>, **kwargs)¶
Methods
__init__(cls[, suffix, lazy, trigger_value, …])create_component(instance)Instantiate the object described by this Component for a Device make_docstring(parent_class)Create a docstring for the Component maybe_add_prefix(instance, kw, suffix)Add prefix to a suffix if kw is in self.add_prefix sub_default(func)Default subscription decorator sub_meta(func)Metadata subscription decorator sub_value(func)Value subscription decorator subscriptions(event_type)(Decorator) Specify subscriptions callbacks in the Device definition