TabDockDiagramButton

A dock button with a standard beamline device symbol rendered

../../../_images/tab_dock_diagram_button.png
class pcdswidgets.common.dock.tab_dock_diagram_button.TabDockDiagramButton(parent: QWidget | None = None)[source]

Behaves identically to TabDockButton, but renders a standard symbol and lightpath info.

class DiagramOption(*values)

Options for which diagram to show on the widget.

If you want to add a new option:

  • Add an entry here, note that order/count don’t affect anything and won’t break old screens. (Old screens need the old enum name to exist and nothing more)

  • Copy the new entry into the enums specified at the top of the class body below (This makes the enums work up properly in designer)

  • Add a new svg to pcdswidgets/icons/diagram whose name matches the entry (If the new enum is “NAME”, the file should be “name.svg”)

get_image_path() → Path

Return a Path object pointing to the image we should use.

get_pixmap() → QPixmap

Return the pixmap to display for this enum.

closeEvent(a0: QCloseEvent) → None[source]

On close, clean up the pydm channel.

draw_image(painter: QPainter)[source]

Render the selected diagram widget.

This will be a QPixmap at the bottom-center of the widget bounds, and it will also include the widget background-color rendered behind the “square” portion of the diagram.

draw_lightpath_indicator(painter: QPainter)[source]

Render the lightpath state.

This will be an ellipse at the top-left of the widget bounds, filled with cyan if the lightpath channel is “true”.

new_lightpath_state(value: bool)[source]

Callback to update the visuals of the lightpath indicator when the channel value changes.

paintEvent(a0: QPaintEvent) → None[source]

Render the image and the lightpath indicator when it’s time to paint this widget.

readDiagram() → DiagramOption[source]

Returns the enum of the diagram that is currently in-use.

readLightpathChannel() → str[source]

Returns the channel used to determine if beam is reaching this widget.

setDiagram(diagram: DiagramOption) → None[source]

Sets the enum of the diagram to use.

setFlat(a0: bool) → None[source]

Prevent flat = False which interferes with our rendering.

setLightpathChannel(ch: str) → None[source]

Selects the channel used to determine if beam is reaching this widget.