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

Class NodeTreeModel

source code

         object --+                    
                  |                    
  sip.simplewrapper --+                
                      |                
            sip.wrapper --+            
                          |            
       PyQt4.QtCore.QObject --+        
                              |        
PyQt4.QtCore.QAbstractItemModel --+    
                                  |    
     PyQt4.QtGui.QStandardItemModel --+
                                      |
                                     NodeTreeModel

The model to show the nodes running in a ROS system or loaded by a launch configuration.

Instance Methods
 
__init__(self, host_address, masteruri, parent=None)
Initialize the model.
source code
 
flags(self, index) source code
HostItem
getHostItem(self, masteruri, address)
Searches for the host item in the model.
source code
 
updateModelData(self, nodes)
Updates the model data.
source code
 
set_std_capablilities(self, capabilities)
Sets the default capabilities description, which is assigned to each new host.
source code
 
addCapabilities(self, masteruri, host_address, cfg, capabilities)
Adds groups to the model
source code
 
appendConfigNodes(self, masteruri, host_address, nodes)
Adds nodes to the model.
source code
 
removeConfigNodes(self, cfg)
Removes nodes from the model.
source code
 
removeEmptyHosts(self) source code
 
isDuplicateNode(self, node_name) source code
[PySide.QtGui.QStandardItem]
getNode(self, node_name)
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
[str]
getRunningNodes(self)
Returns a list with all known running nodes.
source code
 
markNodesAsDuplicateOf(self, running_nodes, is_sync_running=False)
If there are a synchronization running, you have to avoid to running the node with the same name on different hosts.
source code
 
updateHostDescription(self, masteruri, host, descr_type, descr_name, descr)
Updates the description of a host.
source code

Inherited from PyQt4.QtGui.QStandardItemModel: appendColumn, appendRow, clear, columnCount, data, dropMimeData, findItems, hasChildren, headerData, horizontalHeaderItem, index, indexFromItem, insertColumn, insertColumns, insertRow, insertRows, invisibleRootItem, item, itemChanged, itemData, itemFromIndex, itemPrototype, mimeData, mimeTypes, parent, removeColumns, removeRows, rowCount, setColumnCount, setData, setHeaderData, setHorizontalHeaderItem, setHorizontalHeaderLabels, setItem, setItemData, setItemPrototype, setRowCount, setSortRole, setVerticalHeaderItem, setVerticalHeaderLabels, sort, sortRole, supportedDropActions, takeColumn, takeHorizontalHeaderItem, takeItem, takeRow, takeVerticalHeaderItem, verticalHeaderItem

Inherited from PyQt4.QtCore.QAbstractItemModel: beginInsertColumns, beginInsertRows, beginMoveColumns, beginMoveRows, beginRemoveColumns, beginRemoveRows, beginResetModel, buddy, canFetchMore, changePersistentIndex, changePersistentIndexList, columnsAboutToBeInserted, columnsAboutToBeMoved, columnsAboutToBeRemoved, columnsInserted, columnsMoved, columnsRemoved, createIndex, dataChanged, decodeData, encodeData, endInsertColumns, endInsertRows, endMoveColumns, endMoveRows, endRemoveColumns, endRemoveRows, endResetModel, fetchMore, hasIndex, headerDataChanged, layoutAboutToBeChanged, layoutChanged, match, modelAboutToBeReset, modelReset, persistentIndexList, removeColumn, removeRow, reset, resetInternalData, revert, roleNames, rowsAboutToBeInserted, rowsAboutToBeMoved, rowsAboutToBeRemoved, rowsInserted, rowsMoved, rowsRemoved, setRoleNames, setSupportedDragActions, sibling, span, submit, supportedDragActions

Inherited from PyQt4.QtCore.QObject: __getattr__, blockSignals, childEvent, children, connect, connectNotify, customEvent, deleteLater, destroyed, disconnect, disconnectNotify, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, emit, event, eventFilter, findChild, findChildren, inherits, installEventFilter, isWidgetType, killTimer, metaObject, moveToThread, objectName, property, pyqtConfigure, receivers, removeEventFilter, sender, senderSignalIndex, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread, timerEvent, tr, trUtf8

Inherited from sip.simplewrapper: __new__

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

Class Variables
  header = [('Name', 450), ('Cfgs', -1)]

Inherited from PyQt4.QtCore.QObject: staticMetaObject

Instance Variables
 
hostInserted(...)
the Qt signal, which is emitted, if a new host was inserted.
source code
Properties
  local_addr

Inherited from object: __class__

Method Details

__init__(self, host_address, masteruri, parent=None)
(Constructor)

source code 

Initialize the model.

Overrides: object.__init__

flags(self, index)

source code 
Overrides: PyQt4.QtCore.QAbstractItemModel.flags

getHostItem(self, masteruri, address)

source code 

Searches for the host item in the model. If no item is found a new one will created and inserted in sorted order.

Parameters:
  • masteruri (str) - ROS master URI
  • address (str) - the address of the host
Returns: HostItem
the item associated with the given master

updateModelData(self, nodes)

source code 

Updates the model data.

Parameters:
  • nodes (dict(str:NodeInfo, ...)) - a dictionary with name and info objects of the nodes.

set_std_capablilities(self, capabilities)

source code 

Sets the default capabilities description, which is assigned to each new host.

Parameters:
  • capabilities (dict(namespace: dict(group:dict('type' : str, 'description' : str, 'nodes' : [str])))) - the structure for capabilities

addCapabilities(self, masteruri, host_address, cfg, capabilities)

source code 

Adds groups to the model

Parameters:
  • masteruri (str) - ROS master URI
  • host_address (str) - the address the host
  • cfg (str or (str, str))) - the configuration name (launch file name or tupel for default configuration)
  • capabilities (dict(namespace: dict(group:dict('type' : str, 'description' : str, 'nodes' : [str])))) - the structure for capabilities

appendConfigNodes(self, masteruri, host_address, nodes)

source code 

Adds nodes to the model. If the node is already in the model, only his configuration list will be extended.

Parameters:
  • masteruri (str) - ROS master URI
  • host_address (str) - the address the host
  • nodes (dict(str : str)) - a dictionary with node names and their configurations

removeConfigNodes(self, cfg)

source code 

Removes nodes from the model. If node is running or containing in other launch or default configurations , only his configuration list will be reduced.

Parameters:
  • cfg (str) - the name of the confugration to close

getNode(self, node_name)

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
Returns: [PySide.QtGui.QStandardItem]
The list with node items.

markNodesAsDuplicateOf(self, running_nodes, is_sync_running=False)

source code 

If there are a synchronization running, you have to avoid to running the node with the same name on different hosts. This method helps to find the nodes with same name running on other hosts and loaded by a configuration. The nodes loaded by a configuration will be inform about a currently running nodes, so a warning can be displayed!

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.

updateHostDescription(self, masteruri, host, descr_type, descr_name, descr)

source code 

Updates the description of a host.

Parameters:

Instance Variable Details

hostInserted(...)

source code 
the Qt signal, which is emitted, if a new host was inserted. Parameter: QtCore.QModelIndex of the inserted host item

Property Details

local_addr

Get Method:
unreachable.local_addr(self)