PyDMSymbol

class pydm.widgets.symbol.PyDMSymbol(parent=None, init_channel=None)[source]

PyDMSymbol will render an image (symbol) for each value of a channel.

Parameters
  • parent (QWidget) – The parent widget for the Label

  • init_channel (str, optional) – The channel to be used by the widget.

aspectRatioMode

Which aspect ratio mode to use.

Returns

Return type

Qt.AspectRatioMode

connection_changed(connected)[source]

Callback invoked when the connection state of the Channel is changed. This callback acts on the connection state to enable/disable the widget and also trigger the change on alarm severity to ALARM_DISCONNECTED.

Parameters

connected (int) – When this value is 0 the channel is disconnected, 1 otherwise.

imageFiles

JSON-formatted dictionary keyed on states (integers), with filenames of the image file to display for the state.

Returns

Return type

str

init_for_designer()[source]

Method called after the constructor to tweak configurations for when using the widget with the Qt Designer

minimumSizeHint()[source]

This property holds the recommended minimum size for the widget.

Returns

Return type

QSize

paintEvent(event)[source]

Paint events are sent to widgets that need to update themselves, for instance when part of a widget is exposed because a covering widget was moved.

At PyDMSymbol this method handles the alarm painting with parameters from the stylesheet and draws the proper image.

Parameters

event (QPaintEvent) –

set_current_key(current_key)[source]

Change the image being displayed for the one given by current_key.

Parameters

current_key (object) – The current_key parameter can be of any type as long as it matches the type used as key for the imageFiles dictionary.

sizeHint()[source]

This property holds the recommended size for the widget.

Returns

Return type

QSize

value_changed(new_val)[source]

Callback invoked when the Channel value is changed.

Parameters

new_val (int) – The new value from the channel.