Package node_manager_fkie :: Module topic_list_model :: Class TopicGroupItem
[frames] | no frames]

Class TopicGroupItem

source code

python_qt_binding.QtGui.QStandardItem --+
                                        |
                                       TopicGroupItem

The TopicGroupItem stores the information about a group of nodes.

Instance Methods
 
__init__(self, name, parent=None, is_group=False)
Initialize the TopicGroupItem object with given values.
source code
 
name(self, new_name)
Set the new name of this group and updates the displayed name of the item.
source code
 
is_group(self) source code
 
get_namespace(self) source code
 
count_topics(self)
:retrun: Returns count of nodes inside this group.
source code
 
get_topic_items_by_name(self, topic_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
 
get_topic_items(self, recursive=True)
Returns all nodes in this group and subgroups.
source code
 
get_group_item(self, group_name, is_group=True, nocreate=False)
Returns a TopicGroupItem with given name.
source code
 
add_node(self, topic)
Adds a new topic with given name.
source code
 
clearup(self, fixed_node_names=None)
Removes not running and not configured nodes.
source code
 
remove_node(self, name) source code
 
update_topic_view(self, updated_topics, topics) source code
 
index_from_names(self, publisher, subscriber)
Returns for given topics the list of QModelIndex in this model.
source code
 
type(self) source code
 
__eq__(self, item)
Compares the name of the group.
source code
 
__ne__(self, item) source code
 
__gt__(self, item)
Compares the name of the group.
source code
Class Methods
 
create_item_list(self, name, parent, is_group)
Creates the list of the items for this group.
source code
Class Variables
  ITEM_TYPE = Qt.UserRole+ 35
Method Details

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

source code 

Initialize the TopicGroupItem object with given values.

:param str name: the name of the group :param parent: the parent item. In most cases this is the HostItem. The variable is used to determine the different columns of the NodeItem. :type parent: :class:`QtGui.QStandardItem` <https://srinikom.github.io/pyside-docs/PySide/QtGui/QStandardItem.html> :param bool is_group: True if this is a capability group. In other case it is a namespace group.

name(self, new_name)

source code 

Set the new name of this group and updates the displayed name of the item.

:param str new_name: The new name of the group. Used also to identify the group.

Decorators:
  • @name.setter

is_group(self)

source code 
Decorators:
  • @property

count_topics(self)

source code 

:retrun: Returns count of nodes inside this group. :rtype: int

get_topic_items_by_name(self, topic_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.

:param str topic_name: The name of the topic :param bool recursive: Searches in (sub) groups :return: The list with node items. :rtype: list(:class:`QtGui.QStandardItem` <https://srinikom.github.io/pyside-docs/PySide/QtGui/QStandardItem.html>)

get_topic_items(self, recursive=True)

source code 

Returns all nodes in this group and subgroups.

:param bool recursive: returns the nodes of the subgroups :return: The list with node items. :rtype: list(:class:`QtGui.QStandardItem` <https://srinikom.github.io/pyside-docs/PySide/QtGui/QStandardItem.html>)

create_item_list(self, name, parent, is_group)
Class Method

source code 

Creates the list of the items for this group. This list is used for the visualization of group data as a table row.

:param str name: the group name :return: the list for the representation as a row :rtype: [TopicGroupItem or QStandardItem, ...]

get_group_item(self, group_name, is_group=True, nocreate=False)

source code 

Returns a TopicGroupItem with given name. If no group with this name exists, a new one will be created. The given name will be split by slashes if exists and subgroups are created.

:param str group_name: the name of the group :param bool is_group: True if it is a capability group. False if a namespace group. (Default: True) :param bool nocreate: avoid creation of new group if not exists. (Default: False) :return: The group with given name of None if `nocreate` is True and group not exists. :rtype: :class:`TopicGroupItem`

add_node(self, topic)

source code 

Adds a new topic with given name.

:param topic: the TopicInfo of the node to create :type topic: :class:`TopicInfo`

clearup(self, fixed_node_names=None)

source code 

Removes not running and not configured nodes.

:param list(str) fixed_node_names: If the list is not None, the node not in the list are set to not running!

index_from_names(self, publisher, subscriber)

source code 

Returns for given topics the list of QModelIndex in this model.

:param [str] publisher: the list of publisher topics :param [str] subscriber: the list of subscriber topics :return: the list of QModelIndex :rtype: [QtCore.QModelIndex]