Package node_manager_fkie :: Module node_tree_model :: Class GroupItem
[frames] | no frames]

Class GroupItem

source code

       object --+            
                |            
sip.simplewrapper --+        
                    |        
          sip.wrapper --+    
                        |    
PyQt4.QtGui.QStandardItem --+
                            |
                           GroupItem
Known Subclasses:

The GroupItem stores the information about a group of nodes.

Nested Classes

Inherited from PyQt4.QtGui.QStandardItem: ItemType

Instance Methods
 
__init__(self, name, parent=None)
Initialize the GroupItem object with given values.
source code
bool
is_in_cap_group(self, nodename, config, ns, groupname)
Returns `True` if the group contains the node.
source code
 
addCapabilities(self, config, capabilities, masteruri)
Add new capabilities.
source code
 
remCapablities(self, config)
Removes internal entry of the capability, so the new nodes are not grouped.
source code
dict(config : [str])
getCapabilityGroups(self, node_name)
Returns the names of groups, which contains the given node.
source code
[PySide.QtGui.QStandardItem]
getNodeItemsByName(self, node_name, recursive=True)
Since the same node can be included by different groups, this method searches for all nodes with given name and returns these items.
source code
[PySide.QtGui.QStandardItem]
getNodeItems(self, recursive=True)
Returns all nodes in this group and subgroups.
source code
[GroupItem]
getGroupItems(self)
Returns all group items this group
source code
GroupItem
getGroupItem(self, group_name)
Returns a GroupItem with given name.
source code
 
addNode(self, node, cfg='')
Adds a new node with given name.
source code
 
clearUp(self, fixed_node_names=None)
Removes not running and not configured nodes.
source code
 
updateRunningNodeState(self, nodes)
Updates the running state of the nodes given in a dictionary.
source code
[str]
getRunningNodes(self)
Returns the names of all running nodes.
source code
 
markNodesAsDuplicateOf(self, running_nodes, is_sync_running=False)
While a synchronization same node on different hosts have the same name, the nodes with the same on other host are marked.
source code
 
updateIcon(self) source code
str
updateTooltip(self)
Creates a tooltip description based on text set by updateDescription() and all childs of this host with valid sensor description.
source code
 
generateDescription(self, extended=True) source code
 
updateDescription(self, descr_type, descr_name, descr)
Sets the description of the robot.
source code
 
updateDisplayedConfig(self)
Updates the configuration representation in other column.
source code
 
type(self) source code
 
__eq__(self, item)
Compares the name of the group.
source code
 
__gt__(self, item)
Compares the name of the group.
source code

Inherited from PyQt4.QtGui.QStandardItem: __ge__, __le__, __lt__, __ne__, accessibleDescription, accessibleText, appendColumn, appendRow, appendRows, background, checkState, child, clone, column, columnCount, data, emitDataChanged, flags, font, foreground, hasChildren, icon, index, insertColumn, insertColumns, insertRow, insertRows, isCheckable, isDragEnabled, isDropEnabled, isEditable, isEnabled, isSelectable, isTristate, model, parent, read, removeColumn, removeColumns, removeRow, removeRows, row, rowCount, setAccessibleDescription, setAccessibleText, setBackground, setCheckState, setCheckable, setChild, setColumnCount, setData, setDragEnabled, setDropEnabled, setEditable, setEnabled, setFlags, setFont, setForeground, setIcon, setRowCount, setSelectable, setSizeHint, setStatusTip, setText, setTextAlignment, setToolTip, setTristate, setWhatsThis, sizeHint, sortChildren, statusTip, takeChild, takeColumn, takeRow, text, textAlignment, toolTip, whatsThis, write

Inherited from sip.simplewrapper: __new__

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  ITEM_TYPE = 57

Inherited from PyQt4.QtGui.QStandardItem: Type, UserType

Properties
str name
The name of this group.

Inherited from object: __class__

Method Details

__init__(self, name, parent=None)
(Constructor)

source code 

Initialize the GroupItem object with given values.

Parameters:
  • name (str) - the name of the group
  • parent (PySide.QtGui.QStandardItem) - the parent item. In most cases this is the HostItem. The variable is used to determine the different columns of the NodeItem.
Overrides: object.__init__

is_in_cap_group(self, nodename, config, ns, groupname)

source code 

Returns `True` if the group contains the node.

Parameters:
  • nodename (str) - the name of the node to test
  • config (str) - the configuration name
  • ns (str) - namespace
  • groupname (str) - the group name
Returns: bool
`True`, if the nodename is in the group

addCapabilities(self, config, capabilities, masteruri)

source code 

Add new capabilities. Based on this capabilities the node are grouped. The view will be updated.

Parameters:
  • config (str) - The name of the configuration containing this new capabilities.
  • masteruri (str) - The masteruri is used only used, if new nodes are created.
  • capabilities (dict(namespace: dict(group:dict('type' : str, 'images' : [str], 'description' : str, 'nodes' : [str])))) - The capabilities, which defines groups and containing nodes.

remCapablities(self, config)

source code 

Removes internal entry of the capability, so the new nodes are not grouped. To update view NodeTreeModel.removeConfigNodes() and GroupItem.clearUp() must be called.

Parameters:
  • config (str) - The name of the configuration containing this new capabilities.

getCapabilityGroups(self, node_name)

source code 

Returns the names of groups, which contains the given node.

Parameters:
  • node_name (str) - The name of the node
  • config (str) - The name of configuration, which describes the node.
Returns: dict(config : [str])
The name of the configuration containing this new capabilities.

getNodeItemsByName(self, node_name, recursive=True)

source code 

Since the same node can be included by different groups, this method searches for all nodes with given name and returns these items.

Parameters:
  • node_name (str) - The name of the node
  • recursive (bool) - Searches in (sub) groups
Returns: [PySide.QtGui.QStandardItem]
The list with node items.

getNodeItems(self, recursive=True)

source code 

Returns all nodes in this group and subgroups.

Parameters:
  • recursive (bool) - returns the nodes of the subgroups
Returns: [PySide.QtGui.QStandardItem]
The list with node items.

getGroupItems(self)

source code 

Returns all group items this group

Returns: [GroupItem]
The list with group items.

getGroupItem(self, group_name)

source code 

Returns a GroupItem with given name. If no group with this name exists, a new one will be created. Assumption: No groups in group!!

Parameters:
  • group_name (str) - the name of the group
Returns: GroupItem
The group with given name

addNode(self, node, cfg='')

source code 

Adds a new node with given name.

Parameters:
  • node (NodeInfo) - the NodeInfo of the node to create
  • cfg (str) - The configuration, which describes the node

clearUp(self, fixed_node_names=None)

source code 

Removes not running and not configured nodes.

Parameters:
  • fixed_node_names ([str]) - If the list is not None, the node not in the list are set to not running!

updateRunningNodeState(self, nodes)

source code 

Updates the running state of the nodes given in a dictionary.

Parameters:
  • nodes (dict(str: master_discovery_fkie.NodeInfo)) - A dictionary with node names and their running state described by NodeInfo.

getRunningNodes(self)

source code 

Returns the names of all running nodes. A running node is defined by his PID.

Returns: [str]
A list with node names

See Also: master_dicovery_fkie.NodeInfo

markNodesAsDuplicateOf(self, running_nodes, is_sync_running=False)

source code 

While a synchronization same node on different hosts have the same name, the nodes with the same on other host are marked.

Parameters:
  • running_nodes (dict(str:str)) - The dictionary with names of running nodes and their masteruri
  • is_sync_running (bool) - If the master_sync is running, the nodes are marked as ghost nodes. So they are handled as running nodes, but has not run informations. This nodes are running on remote host, but are not syncronized because of filter or errrors.

updateTooltip(self)

source code 

Creates a tooltip description based on text set by updateDescription() and all childs of this host with valid sensor description. The result is returned as a HTML part.

Returns: str
the tooltip description coded as a HTML part

updateDescription(self, descr_type, descr_name, descr)

source code 

Sets the description of the robot. To update the tooltip of the host item use updateTooltip().

Parameters:

type(self)

source code 
Overrides: PyQt4.QtGui.QStandardItem.type

__eq__(self, item)
(Equality operator)

source code 

Compares the name of the group.

Overrides: PyQt4.QtGui.QStandardItem.__eq__

__gt__(self, item)
(Greater-than operator)

source code 

Compares the name of the group.

Overrides: PyQt4.QtGui.QStandardItem.__gt__

Property Details

name

The name of this group.

Get Method:
unreachable.name(self) - The name of this group.
Set Method:
unreachable.name(self, new_name) - Set the new name of this group and updates the displayed name of the item.
Type:
str