pcdsdevices.signal.EpicsSignalBaseEditMD
- class pcdsdevices.signal.EpicsSignalBaseEditMD(*args, enum_attrs: list[str | None] | None = None, enum_strs: list[str] | None = None, parent: OphydObject | None = None, name: str | None = None, **kwargs)
EpicsSignal variant which allows for user correction of various metadata.
- Parameters:
enum_strings (list of str, optional) – List of enum strings to replace the EPICS originals. May not be used in conjunction with the dynamic
enum_attrs
.enum_attrs (list of str, optional) – List of signal attribute names, relative to the parent device. That is to say a given attribute is assumed to be a sibling of this signal instance. Attribute names may be
None
in the case where the original enum string should be passed through.
See also
Methods
- describe()
Return the signal description as a dictionary.
Units, limits, precision, and enum strings may be overridden.
- Returns:
dict – Dictionary of name and formatted description string
- get(*, count=None, as_string=None, timeout=<object object>, connection_timeout=<object object>, form='time', use_monitor=None, **kwargs)
Get the readback value through an explicit call to EPICS.
- Parameters:
count (int, optional) – Explicitly limit count for array data
as_string (bool, optional) – Get a string representation of the value, defaults to as_string from this signal, optional
as_numpy (bool) – Use numpy array as the return type for array data.
timeout (float, optional) – maximum time to wait for value to be received. (default = 0.5 + log10(count) seconds)
use_monitor (bool, optional) – to use value from latest monitor callback or to make an explicit CA call for the value. (default: True)
connection_timeout (float, optional) – If not already connected, allow up to
connection_timeout
seconds for the connection to complete.form ({'time', 'ctrl'}) – PV form to request
- read()
Put the status of the signal into a simple dictionary format for data acquisition
- Returns:
dict
- read_configuration()
Dictionary mapping names to value dicts with keys: value, timestamp
- set(value, *, timeout=None, settle_time=None, **kwargs)
Set the value of the Signal and return a Status object.
- Returns:
st (Status) – This status object will be finished upon return in the case of basic soft Signals
- classmethod set_default_timeout(**kwargs)
- classmethod set_defaults(*, timeout=2.0, connection_timeout=1.0, write_timeout=None, auto_monitor=False)
Set class-wide defaults for EPICS CA communications
This may be called only before any instances of EpicsSignalBase are made.
This setting applies to the class it is called on and all its subclasses. For example,
>>> EpicsSignalBase.set_defaults(...)
will apply to
EpicsSignalRO
andEpicsSignal
, which are both subclasses ofEpicsSignalBase
.but
>>> EpicsSignal.set_defaults(...)
will not apply to
EpicsSignalRO
.- Parameters:
auto_monitor (bool, optional) – If
True
, update cached value from EPICS CA monitor callbacks. IfFalse
, request new value from EPICS each time get() is called.connection_timeout (float, optional) – Time (seconds) allocated for establishing a connection with the IOC.
timeout (float, optional) – Total time budget (seconds) for reading, not including connection time.
write_timeout (float, optional) – Time (seconds) allocated for writing, not including connection time. The write_timeout is very different than the connection and read timeouts above. It relates to how long an action takes to complete. Any default value we choose here is likely to cause problems—either by being too short and giving up too early on a lengthy action or being too long and delaying the report of a failure. The default, None, waits forever.
- Raises:
RuntimeError – If called after
EpicsSignalBase
has been instantiated for the first time.
- trigger()
Call that is used by bluesky prior to read()
Attributes
- SUB_META = 'meta'
- alarm_severity
PV alarm severity
- alarm_status
PV status
- as_string
Attempt to cast the EPICS PV value to a string by default
- connected
Is the signal connected and ready to use?
- connection_timeout
- enum_attrs
Enum attribute names - the source of each enum string.
- enum_strs
List of enum strings.
For an EpicsSignalEditMD, this could be one of:
The original enum strings from the PV
- The strings found from the respective signals referenced by
enum_attrs
.
The user-provided strings in
enum_strs
.
- high_limit
The high, inclusive control limit for the Signal
- hints
Field hints for plotting
- kind
- limits
The PV limits as reported by EPICS (or EpicsSignalEditMD).
- low_limit
The low, inclusive control limit for the Signal
- metadata
- metadata_keys
Metadata keys that will be passed along on value subscriptions
- precision
The PV precision as reported by EPICS (or EpicsSignalEditMD).
- pvname
The readback PV name
- read_access
Can the signal be read?
- source_name
- timeout
- timestamp
Timestamp of readback PV, according to EPICS
- tolerance
The absolute tolerance associated with the value.
- value
The signal’s value
- write_access
Can the signal be written to?
- write_timeout