Component Tree

From Flowcode Help
Jump to navigationJump to search

<sidebar>Sidebar: Flowcode Help Overview:Components</sidebar> In Flowcode each component is laid out like a branch on a tree with the root or trunk of the tree being the Flowcode panels.

Eg Tree Structure.jpg

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

Gen Panel Properties Object List 01.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 ‘Expose full component tree in property pane’ option. 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.

Gen Panel Properties Object List Tree 01.jpg

When generating a component, the panel root is referred to as a variable named “this”. The variable allows the component source to refer to the panel and once the component is exported the ‘this’ variable 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.

Gen Project Explorer Components 01.jpg

When calling a simulation API command you may need to refer to the 'this' node of the tree, the ‘this’ variable can be typed in manually or is available from the component object list featured within the Calculation, Component Macro, Simulation and Macro flowchart icons.

Gen Component Object List 01.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.