Component Tree

From Flowcode Help
Revision as of 08:41, 30 August 2013 by BenR (talk | contribs)
Jump to navigationJump to search

<sidebar>Sidebar: Concepts</sidebar>

In Flowcode v6 each component is laid out like a branch on a tree with the root or trunk of the tree being the Flowcode panels.

File:TreeDiagram.jpg

The branches of the tree / children of the panel can be viewed by clicking the drop down selection at the top of the panel properties window.

File:PanelProps.jpg

Components have been designed with this tree structure in mind to allow complex components to be built up from basic components and to allow any of the existing components to be wrapped up into a user component.

Using the component debugger window you can look further inside the tree by enabling the item "Expose full component tree in property pane". This can be used to explore the component's child components and properties packaged up within the component.

The branches of the tree in our project now look like this.

File:PanelProps2.jpg

When generating a component the panel root is referred to as 'this' as a variable. The variable allows the component source to refer to the panel and once the component is exported the this will instead refer to the root of the specific component.

The component object variables can be seen by using the components tab of the project explorer window.

File:ProjExplorerComponents.jpg

When calling a simulation API command you maby need to refer to the 'this' node of the tree, the this can be typed in manually or is available from the component object portion of the variables manager within the calculation, component macro, simulation and macro flowchart icons.

File:ComponentObject.jpg

Having components in a tree structure helps to bring everything into a standardised format which can be parsed using the Tree portion of the simulation function API. This tree structure approach also applies for the microcontroller FCD files (Flowcode Definition File), the various configuration files and the Flowcode source file itself.