Exemplo n.º 1
0
    def __get_local_childs(self, parent=None):
        """
        Returns all childs of the topic item at the given position in the gui.

        :param parent: the model parent at the given index (not global / logical parent)
        :type parent: NodeItem
        :param sub_activated: Defines if subscriber shall be shown too.
        :returns: the child at the position row
        :rtype: AbstractItem
        """
        childs = []
        if parent is not None:
            # a specific parent has been chosen - we have to use it to display the correct connection items
            # use the seuid to determine the node and compare this to the parts in the connections item (child of this
            # item.
            seuid = parent.get_seuid()

            seuid_helper = SEUID()
            seuid_helper.identifier = seuid
            seuid_helper.set_fields()
            node = seuid_helper.node
            for child in self.get_childs():
                child_seuid = child.get_seuid()
                seuid_helper.identifier = child_seuid
                seuid_helper.set_fields()
                node_comp = seuid_helper.publisher
                # do the check on the publisher
                if node == node_comp:
                    # match.
                    childs.append(child)
                    continue

            return childs
        else:
            return self._child_items
Exemplo n.º 2
0
    def __get_local_childs(self, parent=None):
        """
        Returns all childs of the topic item at the given position in the gui.

        :param parent: the model parent at the given index (not global / logical parent)
        :type parent: NodeItem
        :param sub_activated: Defines if subscriber shall be shown too.
        :returns: the child at the position row
        :rtype: AbstractItem
        """
        childs = []
        if parent is not None:
            # a specific parent has been chosen - we have to use it to display the correct connection items
            # use the seuid to determine the node and compare this to the parts in the connections item (child of this
            # item.
            seuid = parent.get_seuid()

            seuid_helper = SEUID()
            seuid_helper.identifier = seuid
            seuid_helper.set_fields()
            node = seuid_helper.node
            for child in self.get_childs():
                child_seuid = child.get_seuid()
                seuid_helper.identifier = child_seuid
                seuid_helper.set_fields()
                node_comp = seuid_helper.publisher
                # do the check on the publisher
                if node == node_comp:
                    # match.
                    childs.append(child)
                    continue

            return childs
        else:
            return self._child_items