TaurusJDrawSynopticsView

Inheritance diagram of TaurusJDrawSynopticsView
class TaurusJDrawSynopticsView(parent=None, designMode=False, updateMode=None, alias=None, resizable=True, panelClass=None)[source]

Taurus Class that visualizes Synoptics drawn with the JDraw tool (by ESRF). It is equivalent to ATK Synoptic Player (Java).

After initialization call setModel(‘/your/file.jdw’) to parse the synoptic file and connect to controlled objects.

Arguments to TaurusJDrawSynopticsView() creator are:

  • designMode; used by Qt Designer

  • updateMode; controls Qt Viewport refresh (disabled by default)

  • alias; a dictionary of name replacements to be applied on graphical objects

  • resizable: whether to allow resizing or not

  • panelClass: class object, class name or shell command to be shown when an object is clicked (None will show default panel, ‘’ or ‘noPanel’ will disable it)

TaurusJDrawSynopticsView and TaurusGraphicsScene signals/slots

External events:

Slot selectGraphicItem(const QString &) displays a selection
mark around the TaurusGraphicsItem that matches the argument passed.

Mouse Left-button events:

Signal graphicItemSelected(QString) is triggered, passing the
selected TaurusGraphicsItem.name() as argument.

Mouse Right-button events:

TaurusGraphicsItem.setContextMenu([(ActionName,ActionMethod(device_name))]
allows to configure custom context menus for graphic items using a list
of tuples. Empty tuples will insert separators in the menu.

Import from taurus.qt.qtgui.graphic as:

from taurus.qt.qtgui.graphic import TaurusJDrawSynopticsView
closeEvent(self, QCloseEvent)[source]
classmethod defaultPanelClass()[source]

This method assigns the Class used to open new object panels on double-click (TaurusDevicePanel by default) If an string is used it can be either a Taurus class or an OS launcher

defineStyle()[source]
emitColors()[source]

emit signal which is used to refresh the tree and colors of icons depend of the current status in jdrawSynoptic

fitting(ADJUST_FRAME=False)[source]

Parent size is the size of the bigger panel (desn’t keep ratio) Rect size never changes (fixed by the graphics objects) Size and SizeHint move one around the other

the method works well until an object is clicked, then the whole reference changes and doesn’t work again.

getFramed()[source]
getGraphicsFactory(delayed=False)[source]
getModel(**kwargs)[source]

Returns the model name for this component.

Parameters

key (object) – the model key. Defaults to first element of .modelKeys

Returns

the model name.

Return type

str

getModelMimeData()[source]

Used for drag events

classmethod getQtDesignerPluginInfo()[source]

Returns pertinent information in order to be able to build a valid QtDesigner widget plugin.

The dictionary returned by this method should contain at least the following keys and values:

  • ‘module’ : a string representing the full python module name (ex.: ‘taurus.qt.qtgui.base’)

  • ‘icon’ : a string representing valid resource icon (ex.: ‘designer:combobox.png’)

  • ‘container’a bool telling if this widget is a container widget or

    not.

This default implementation returns the following dictionary:

{ 'group'     : 'Taurus [Unclassified]',
  'icon'      : 'logos:taurus.png',
  'container' : False }
Returns

a map with pertinent designer information

Return type

dict

getSelectionStyle()[source]
getSelectionStyleName()[source]
get_device_list()[source]
get_item_colors(emit=False)[source]
get_item_list()[source]
get_sizes()[source]
graphicItemSelected
graphicSceneClicked
isReadOnly()[source]

Determines if this component is read-only or not in the sense that the user can interact with it. Default implementation returns True.

Override when necessary.

Returns

whether or not this component is read-only

Return type

bool

itemsChanged
model
modelsChanged
mousePressEvent(event)[source]

Records last event position to use it for DragEvents

openJDraw()[source]
panelClass()[source]
refreshModel()[source]
repaint(self)[source]
TaurusJDrawSynopticsView.repaint(self, int, int, int, int) -> None
repaint(self, QRect) None
repaint(self, QRegion) None
resetSelectionStyle()[source]
resizable()[source]
resizeEvent(event)[source]

It has been needed to reimplent size policies

selectGraphicItem(item_name)[source]
selectionStyle
setAlias(alias)[source]

Assigning a dictionary like {‘Tag’:’Value’} with tags to be replaced in object names while parsing.

classmethod setDefaultPanelClass(other)[source]

This method returns the Class used to open new object panels on double-click (TaurusDevicePanel by default)

setModel(model, alias=None, delayed=False, trace=False, **kwargs)[source]

Sets/unsets the model name for the given key. If key is MLIST, a model is set for each name in the model sequence, new model keys are automatically added to the object’s modelList attribute and the corresponding models are attached using those keys. The new keys are of the form (MLIST, i) where i is the index of the corresponding model name in the model sequence.

Parameters
  • model (str (or sequence of str if key is MLIST)) – the new model name. If key is MLIST, model is expected to be a sequence of model names.

  • key (object) – the model key. Defaults to first element of .modelKeys

setModels()[source]

This method triggers item.setModel(item._name) in all internal items.

setPanelClass(widget)[source]
setResizable(resizable)[source]
setSelectionStyle(selectionStyle)[source]
update(self)[source]
update(self, QRect) None
update(self, QRegion) None
TaurusJDrawSynopticsView.update(self, int, int, int, int) -> None
updateStyle()[source]

Updates the widget style. Default implementation just calls QWidget.update()

Override when necessary.