Channel

class channel.PyDMChannel(address=None, connection_slot=None, value_slot=None, severity_slot=None, write_access_slot=None, enum_strings_slot=None, unit_slot=None, prec_slot=None, upper_ctrl_limit_slot=None, lower_ctrl_limit_slot=None, upper_alarm_limit_slot=None, lower_alarm_limit_slot=None, upper_warning_limit_slot=None, lower_warning_limit_slot=None, value_signal=None, timestamp_slot=None)[source]

Object to hold signals and slots for a PyDM Widget interface to an external plugin

The purpose of this class is to create a templated slot and signals list that can be sent to an external plugin. The type of plugin is determined by the PyDMApplication based on the identifier placed at the beginning of the address attribute. This allows a generic way to connect slots and signals to functionality within your PyDM Widget. Slots should be connected to functions on your created widget that perform actions upon changes. For instance, the value_slot will be automatically called every time a new value is found by the plugin. This should probably linked to a function that updates the display to report the new value. Signals perform the reverse operation. These should be used to send new values back to the plugin to update the source.

Using this structure to interface with plugins allows your created PyDM Widget a greater flexibility in choosing its underlying source. For instance, returning to the example of the value_slot, getting a value to display from channel access or from the EPICS Archiver are very different operations. However, actually displaying the value should be identical. By simply attaching your PyDM Widget’s display functionality to the value_slot you have created a Widget that can do either interchangeably, all the user has to do is specify the correct address signature and the rest of the work is done by the underlying plugins.

Parameters:
  • address (str, optional) – The name of the address to be used by the plugin. This should usually be a user inputted field when a specific PyDM widget is initialized

  • connection_slot (Slot, optional) – A function to be run when the connection state changes

  • value_slot (Slot, optional) – A function to be run when the value updates

  • severity_slot (Slot, optional) – A function to be run when the severity changes

  • write_access_slot (Slot, optional) – A function to be run when the write access changes

  • enum_strings_slot (Slot, optional) – A function to be run when the enum_strings change

  • unit_slot (Slot, optional) – A function to be run when the unit changes

  • prec_slot (Slot, optional) – A function to be run when the precision value changes

  • upper_alarm_limit_slot (Slot, optional) – A function to be run when the upper alarm limit changes

  • lower_alarm_limit_slot (Slot, optional) – A function to be run when the lower alarm limit changes

  • upper_warning_limit_slot (Slot, optional) – A function to be run when the upper warning limit changes

  • lower_warning_limit_slot (Slot, optional) – A function to be run when the lower warning limit changes

  • value_signal (Signal, optional) – Attach a signal here that emits a desired value to be sent through the plugin

  • timestamp_slot (Slot, optional) – A function to be run when the timestamp updates

connect()[source]

Connect a PyDMChannel to the proper PyDMPlugin

disconnect(destroying=False)[source]

Disconnect a PyDMChannel