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.
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.
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.
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.
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.
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.