Stateflow    

Establishing an Object's Parent (Container)

As discussed in the previous section, Creating Stateflow Objects, the Stateflow API constructor establishes the parent for a newly created object by taking a handle for the parent object as an argument to the constructor.

Graphical Object Parentage

When graphical objects (states, boxes, notes, functions, transitions, junctions) are created, they appear completely inside their containing parent object. In the diagram editor, graphical containment is a necessary and sufficient condition for establishing the containing parent.

Repositioning a graphical object through its Position property can change an object's parent or cause an undefined parent error condition. Parsing a chart in which the edges of one object overlap with another produces an undefined parent error condition that cannot be resolved by the Stateflow parser. You can check for this condition by examining the value of the BadIntersection property of a Chart object, which equals 1 if the edges of a graphical object overlap with other objects. You need to set the size and position of objects so that they are clearly positioned and separate from other objects.

Nongraphical Object Parentage

When nongraphical objects (data, events, and targets) are created, they appear in the Stateflow Explorer at the hierarchical level of their owning object. Containment for nongraphical objects is established through the Stateflow Explorer only. See the section The Stateflow Explorer Tool.


  Creating Stateflow Objects Destroying Stateflow Objects