Universal Robots+

Difference between TreeNode and ProgramNode

what’s the difference between TreeNode and ProgramNode

1 Like

From the documentation on https://plus.universal-robots.com/api-reference/

Interface TreeNode

  • @ProviderType public interface TreeNode

This interface represents a node in the program tree that can be used to construct a sub-tree rooted in a URCap program node.

Using the ProgramModel.getRootTreeNode(ProgramNodeContribution) to obtain a root for the sub-tree, it is possible to add children. For each call to addChild(ProgramNode) , a new TreeNode is returned, that can, in turn, act as a root for yet another sub-tree.

Interface ProgramNode

  • All Known Subinterfaces:

AssignmentNode, CircleMoveNode, CommentNode, DirectionNode, ElseIfNode, ElseNode, FolderNode, ForceNode, GripperNode, HaltNode, IfNode, LoopNode, MoveNode, PalletNode, PopupNode, ScrewdrivingNode, SeekNode, SetNode, UntilNode, URCapProgramNode, WaitNode, WaypointNode

public interface ProgramNode

This interface represents PolyScope program nodes.

The program nodes can be created using ProgramNodeFactory .

So the TreeNode interface can be used to insert ProgramNodes instances to the program tree. You can take a look at the many samples that is adding child nodes.

1 Like