Typhos Data Plugins for PyDM¶
SignalPlugin¶
-
typhos.plugins.
register_signal
(signal)[source]¶ Add a new Signal to the registry.
The Signal object is kept within
signal_registry
for reference by name in theSignalConnection
. Signals can be added multiple times and overwritten but a warning will be emitted.
-
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.
-
signal
¶ Stored signal object.
- Type
ophyd.Signal
-
add_listener
(channel)[source]¶ 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
(value)[source]¶ Cast a value to the correct Python type based on
signal_type
.If
signal_type
is not set, the result ofophyd.Signal.describe
is 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.
-
put_value
(new_val)[source]¶ 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
np.ndarray
.
-
HappiPlugin¶
These functions will not be imported if happi
is not installed in the
current Python environment
-
typhos.plugins.
register_client
(client)[source]¶ 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.