Typhos Data Plugins for PyDM
Add a new Signal to the registry.
The Signal object is kept within
signal_registryfor reference by name in the
SignalConnection. Signals can be added multiple times, but only the first register_signal call for each unique signal name has any effect.
Signals can be referenced by their
nameattribute or by their full dotted path starting from the parent’s name.
- class typhos.plugins.SignalConnection(channel, address, protocol=None, parent=None)[source]
Connection to monitor an Ophyd Signal.
This is meant as a generalized connection to any type of Ophyd Signal. It handles reporting updates to listeners as well as pushing new values that users request in the PyDM interface back to the underlying signal.
The signal data_type is used to inform PyDM on the Python type that the signal will expect and emit. It is expected that this type is static through the execution of the application.
Stored signal object.
Add a listener channel to this connection.
This attaches values input by the user to the send_new_value function in order to update the Signal object in addition to the default setup performed in PyDMConnection.
Cast a value to the correct Python type based on
signal_typeis not set, the result of
ophyd.Signal.describeis used to determine what the correct Python type for value is. We need to be aware of the correct Python type so that we can emit the value through the correct signal and convert values returned by the widget to the correct type before handing them to Ophyd Signal.
Pass a value from the UI to Signal.
We are not guaranteed that this signal is writeable so catch exceptions if they are created. We attempt to cast the received value into the reported type of the signal unless it is of type
- remove_listener(channel, destroying=False, **kwargs)[source]
Remove a listener channel from this connection.
This removes the send_new_value connections from the channel in addition to the default disconnection performed in PyDMConnection.
- send_new_meta(connected=None, write_access=None, severity=None, precision=None, units=None, enum_strs=None, **kwargs)[source]
Update the UI with new metadata from the Signal.
Signal metadata updates always send all available metadata, so default values to this function will not be sent ever if the signal has valid data there.
We default missing metadata to None and skip emitting in general, but for severity we default to NO_ALARM for UI purposes. We don’t want the UI to assume that anything is in an alarm state.
These functions will not be imported if
happi is not installed in the
current Python environment
Register a Happi Client to be used with the DataPlugin.
This is not required to be called by the user, if your environment is setup such that
happi.Client.from_config()will return the desired client.
- class typhos.plugins.HappiConnection(channel, address, protocol=None, parent=None)[source]
A PyDMConnection to the Happi Database.