test_tools
Public Member Functions | Private Attributes | List of all members
test_tools.headless_smach_viewer.ContainerNode Class Reference

Public Member Functions

def __init__ (self, server_name, msg)
 
def get_dotcode (self, selected_paths, closed_paths, depth, max_depth, containers, show_all, label_wrapper, attrs={})
 
def set_styles (self, selected_paths, depth, max_depth, items, subgraph_shapes, containers)
 
def update_status (self, msg)
 
def update_structure (self, msg)
 

Private Attributes

 _active_states
 
 _children
 
 _container_outcomes
 
 _dir
 
 _info
 
 _initial_states
 
 _internal_outcomes
 
 _label
 
 _last_active_states
 
 _local_data
 
 _outcomes_from
 
 _outcomes_to
 
 _path
 
 _server_name
 
 _structure_changed
 

Detailed Description

This class represents a given container in a running SMACH system.

Its primary use is to generate dotcode for a SMACH container. It has
methods for responding to structure and status messages from a SMACH
introspection server, as well as methods for updating the styles of a
graph once it's been drawn.

Definition at line 82 of file headless_smach_viewer.py.

Constructor & Destructor Documentation

◆ __init__()

def test_tools.headless_smach_viewer.ContainerNode.__init__ (   self,
  server_name,
  msg 
)

Definition at line 91 of file headless_smach_viewer.py.

Member Function Documentation

◆ get_dotcode()

def test_tools.headless_smach_viewer.ContainerNode.get_dotcode (   self,
  selected_paths,
  closed_paths,
  depth,
  max_depth,
  containers,
  show_all,
  label_wrapper,
  attrs = {} 
)
Generate the dotcode representing this container.

@param selected_paths: The paths to nodes that are selected
@closed paths: The paths that shouldn't be expanded
@param depth: The depth to start traversing the tree
@param max_depth: The depth to which we should traverse the tree
@param containers: A dict of containers keyed by their paths
@param show_all: True if implicit transitions should be shown
@param label_wrapper: A text wrapper for wrapping element names
@param attrs: A dict of dotcode attributes for this cluster

Definition at line 169 of file headless_smach_viewer.py.

◆ set_styles()

def test_tools.headless_smach_viewer.ContainerNode.set_styles (   self,
  selected_paths,
  depth,
  max_depth,
  items,
  subgraph_shapes,
  containers 
)
Update the styles for a list of containers without regenerating the dotcode.

This function is called recursively to update an entire tree.

@param selected_paths: A list of paths to nodes that are currently selected.
@param depth: The depth to start traversing the tree
@param max_depth: The depth to traverse into the tree
@param items: A dict of all the graph items, keyed by url
@param subgraph_shapes: A dictionary of shapes from the rendering engine
@param containers: A dict of all the containers
if depth == 0:
    container_shapes = subgraph_shapes['cluster_'+self._path]
    container_color = (0,0,0,0)
    container_fillcolor = (0,0,0,0)

    for shape in container_shapes:
shape.pen.color = container_color
shape.pen.fillcolor = container_fillcolor

Definition at line 325 of file headless_smach_viewer.py.

◆ update_status()

def test_tools.headless_smach_viewer.ContainerNode.update_status (   self,
  msg 
)
Update the known userdata and active state set and return True if the graph needs to be redrawn.

Definition at line 134 of file headless_smach_viewer.py.

◆ update_structure()

def test_tools.headless_smach_viewer.ContainerNode.update_structure (   self,
  msg 
)
Update the structure of this container from a given message. Return True if anything changes.

Definition at line 113 of file headless_smach_viewer.py.

Member Data Documentation

◆ _active_states

test_tools.headless_smach_viewer.ContainerNode._active_states
private

Definition at line 108 of file headless_smach_viewer.py.

◆ _children

test_tools.headless_smach_viewer.ContainerNode._children
private

Definition at line 99 of file headless_smach_viewer.py.

◆ _container_outcomes

test_tools.headless_smach_viewer.ContainerNode._container_outcomes
private

Definition at line 104 of file headless_smach_viewer.py.

◆ _dir

test_tools.headless_smach_viewer.ContainerNode._dir
private

Definition at line 97 of file headless_smach_viewer.py.

◆ _info

test_tools.headless_smach_viewer.ContainerNode._info
private

Definition at line 111 of file headless_smach_viewer.py.

◆ _initial_states

test_tools.headless_smach_viewer.ContainerNode._initial_states
private

Definition at line 107 of file headless_smach_viewer.py.

◆ _internal_outcomes

test_tools.headless_smach_viewer.ContainerNode._internal_outcomes
private

Definition at line 100 of file headless_smach_viewer.py.

◆ _label

test_tools.headless_smach_viewer.ContainerNode._label
private

Definition at line 96 of file headless_smach_viewer.py.

◆ _last_active_states

test_tools.headless_smach_viewer.ContainerNode._last_active_states
private

Definition at line 109 of file headless_smach_viewer.py.

◆ _local_data

test_tools.headless_smach_viewer.ContainerNode._local_data
private

Definition at line 110 of file headless_smach_viewer.py.

◆ _outcomes_from

test_tools.headless_smach_viewer.ContainerNode._outcomes_from
private

Definition at line 101 of file headless_smach_viewer.py.

◆ _outcomes_to

test_tools.headless_smach_viewer.ContainerNode._outcomes_to
private

Definition at line 102 of file headless_smach_viewer.py.

◆ _path

test_tools.headless_smach_viewer.ContainerNode._path
private

Definition at line 94 of file headless_smach_viewer.py.

◆ _server_name

test_tools.headless_smach_viewer.ContainerNode._server_name
private

Definition at line 93 of file headless_smach_viewer.py.

◆ _structure_changed

test_tools.headless_smach_viewer.ContainerNode._structure_changed
private

Definition at line 142 of file headless_smach_viewer.py.


The documentation for this class was generated from the following file: