vacca.tree module

Classes

VaccaDevTree

class vacca.tree.VaccaDevTree(parent=None, designMode=False)[source]
getAllNodes()[source]

Returns a list with all node objects.

getModelMimeData()[source]

Returns a MimeData object containing the model data. The default implementation fills the TAURUS_MODEL_MIME_TYPE. If the widget’s Model class is Attribute or Device, it also fills TAURUS_ATTR_MIME_TYPE or TAURUS_DEV_MIME_TYPE, respectively

setNodeTree(parent, diction, alias=False)[source]

OVERRIDEN TO ADD try/except CATCHES It has parent as argument to allow itself to be recursive Initializes the node tree from a dictionary {‘Node0.0’:{‘Node1.0’:None,’Node1.1’:None}}

VaccaTree

class vacca.tree.VaccaTree(parent=None, designMode=False)[source]

It is a class that inherits from TaurusSearchTree. Allow show the devices and start/stop it with the right button ( expandable menu)

device_info(device=None)[source]

Show a the Device Info :param device: DeviceName :return:

static getDefaultIcon()[source]
Returns:The Default Icon Path.
start_server(device=None)[source]

Allow start Servers. :param device: DeviceName :return:

stop_server(device=None)[source]

Allow stop Servers :param device: DeviceName :return:


class vacca.tree.TaurusDevTree(parent=None, designMode=False)

Bases: taurus.qt.qtgui.tree.taurusdevicetree.TaurusTreeNodeContainer, PyQt4.QtGui.QTreeWidget, taurus.qt.qtgui.base.taurusbase.TaurusBaseWidget

This widget displays a list of servers, devices or instances. To set a new Model use either setModel(filters), addModels(list), setFilters(...) or loadTree(filters) setModel and loadTree are equivalent; adding a new branch to the tree addModels merges the tree with new models setFilters clears previous models and adds new one

Expander
Loader
TRACE_ALL = False
addAttrToDev(my_device, expert=False, allow_types=None)

This command returns the list of attributes of a given device applying display level and type filters. @argin expert If False only PyTango.DispLevel.OPERATOR attributes are displayed @argin allow_types Only those types included in the list will be displayed (e.g. may be restricted to numeric types only)

addAttrToNode(node=None, full=False)
addModels(modelNames)

Adds models to the existing ones: :param modelNames: (sequence<str>) the names of the models to be added .. seealso:: removeModels()

checkHeaderClicked(position)
clear()
collapseNode(ALL=False, filters='', fun=None)

Collapses the whole tree or from a given node. @argin ALL tells whether to collapse from current item or the whole tree @argin filters Allows to set a list of nodes to not be filtered

contextMenuEvent(event)

This function is called when right clicking on TaurusDevTree area.

static defaultAttrFilter()
defineStyle()
deviceClicked(item, column)
deviceSelected(device_name='')

QSIGNAL: this method is used to emit deviceSelected(QString) signal

dropEvent(event)

reimplemented to support dropping of modelnames in forms

expandAll(queue=True)
expandNode(node=None, expand=True)

Needed to do threaded expansion of the tree

findDialog()
findInTree(regexp, collapseAll=None, exclude=None, select=True, queue=True)
getAllNodes()

Returns a list with all node objects.

getAttrFilter()
getConfig(name)
getMatchingNodes(regexp, limit=0, all=False, exclude=None)

It returns all nodes matching the given expression.

getModel()
getModelClass()
getModelMimeData()

Returns a MimeData object containing the model data. The default implementation fills the TAURUS_MODEL_MIME_TYPE. If the widget’s Model class is Attribute or Device, it also fills TAURUS_ATTR_MIME_TYPE or TAURUS_DEV_MIME_TYPE, respectively

getNode(target=None)

Gets currrent node or node by name or by regexp

getNodeByName(key)
getNodeList()
classmethod getQtDesignerPluginInfo()
getSelectedNodes()
getTangoDict(filters)
initConfig()

Initializing the attributes that will be kept persitent as Qt settings. e.g. for Filters property, the following attributes are created:

  • self.filters
  • self._filters
  • self.setFilters
  • self.getFilters
  • self.resetFilters
loadTree(filters)
matchAttrFilter(target)
mimeTypes()
minimumSizeHint()
mouseMoveEvent(event)

copied from TaurusBaseWidget to provide drag events It had to be rewritten as QTreeWidget does not allow drag events

refreshTree()
setAttrFilter(other)
static setDefaultAttrFilter(other)
setIcons(dct={}, root_name=None, regexps=True)

This method change the icons depending of the status of the devices Dict is a dictionary with name of device and colors such as {name_device:color,name_device2:color2} An alternative may be an icon name!

setModel(model)
setModelCheck(model)
setNodeTree(parent, diction, alias=False)

It has parent as argument to allow itself to be recursive Initializes the node tree from a dictionary {‘Node0.0’:{‘Node1.0’:None,’Node1.1’:None}}

setStateIcon(child, color)
setTangoHost(tango_host=None)
setTree(diction, clear=False)

Initializes the tree from a dictionary {‘Node0.0’:{‘Node1.0’:None,’Node1.1’:None}}

showNodeContextMenu(node, event)

A pop up menu will be shown with the available options. Menus are managed using two tuple lists for each node: node.ContextMenu and node.ExpertMenu

sizeHint()
sortCustom(order)
trace(msg)
unpackChildren()

removes all nodes from the tree and returns them in a list, used for resorting

class vacca.tree.TaurusSearchTree(parent=None, designMode=False)

Bases: taurus.qt.qtgui.container.tauruswidget.TaurusWidget

This Class is a mere wrapper providing a TaurusDevTree connected with an options panel and some optional checkboxes.

addModels
defineStyle()
expandAll
findInTree
loadTree
static method_forwarder(*args, **kwargs)
static setDefaultAttrFilter(c)
static setDefaultPanelClass(c)
setModelCheck
setTangoHost
setTree
class vacca.tree.TaurusDevTreeOptions(parent=None, icon=None)

Bases: PyQt4.QtGui.QWidget

This class provides a search(QString) signal to be connected to TaurusDevTree.findInTree slot

connectWithTree(tree)
class vacca.tree.VaccaTree(parent=None, designMode=False)[source]

Bases: taurus.qt.qtgui.tree.taurusdevicetree.TaurusSearchTree

It is a class that inherits from TaurusSearchTree. Allow show the devices and start/stop it with the right button ( expandable menu)

addModels(*a, **k)[source]
defineStyle()[source]
device_info(device=None)[source]

Show a the Device Info :param device: DeviceName :return:

expandAll(*a, **k)[source]
static getDefaultIcon()[source]
Returns:The Default Icon Path.
loadTree(*a, **k)[source]
static setDefaultAttrFilter(*a, **k)[source]
static setDefaultPanelClass(*a, **k)[source]
classmethod setIconMap(klass, iconMap)[source]
setModel(*a, **k)[source]
setModelCheck(*a, **k)[source]
setTangoHost(*a, **k)[source]
setTree(*a, **k)[source]
start_server(device=None)[source]

Allow start Servers. :param device: DeviceName :return:

stop_server(device=None)[source]

Allow stop Servers :param device: DeviceName :return:

updateStates()[source]