AuboCaps  0.6.1
program_node_factory.h
Go to the documentation of this file.
1 #ifndef AUBO_SCOPE_PROGRAM_NODE_FACTORY_H
2 #define AUBO_SCOPE_PROGRAM_NODE_FACTORY_H
3 
39 
40 namespace arcs {
41 namespace aubo_scope {
42 ARCS_CLASS_FORWARD(ProgramNodeFactory);
43 ARCS_CLASS_FORWARD(ProgramNodeService);
44 
45 /**
46  * <p>
47  * This interfaces supplies methods to create different types of program nodes.
48  * </p>
49  *
50  * <p>
51  * Both built-in program nodes (provided by Universal Robots) and AuboCap
52  * program nodes can be created. Most methods will create a node with the same
53  * default configuration as if the end user added the node manually.
54  * </p>
55  *
56  * <p>
57  * Note that this default configuration may change between AuboScope versions.
58  * </p>
59  */
61 {
62 public:
65  virtual ~ProgramNodeFactory();
66 
67  /**
68  * This method creates a AuboCap program node which is an instance of a
69  * {@link contribution/ProgramNodeContribution}.
70  *
71  * @param typeid_service is the service creating the program node
72  * contribution/
73  *
74  * @return the {@link ProgramNode} which represents the {@link
75  * contribution/ProgramNodeContribution} created by {@link
76  * ProgramNodeService}. Returns <code>null</code> if AuboCap providing
77  * ProgramNodeService is not installed.
78  *
79  * @throws IllegalArgumentException if the argument ProgramNodeService
80  * is <code>null</code>or ProgramNodeService does not implement {@link
81  * ProgramNodeService}.
82  */
83  ProgramNodePtr createUserProgramNode(const char *typeid_service);
84 
85  /**
86  * Creates a default Move node with one default Waypoint node under it.
87  *
88  * @return new Move Node.
89  */
90  MoveNodePtr createMoveNode();
91 
92  /**
93  * <p>
94  * Creates a default Move node without a Waypoint node under it (e.g. to be
95  * used for inserting named waypoints).
96  * </p>
97  *
98  * Note that at least one Waypoint node must be under it for a Move node to
99  * be valid.
100  *
101  * @return new Move Node.
102  */
103  MoveNodePtr createMoveNodeNoTemplate();
104 
105  /**
106  * Creates a Waypoint node with default waypoint name (corresponds to the
107  * name generated if the end user added a new node manually).
108  *
109  * @return new Waypoint Node.
110  */
111  WaypointNodePtr createWaypointNode();
112 
113  /**
114  * <p>
115  * Creates a Waypoint node with a suggested name.
116  * </p>
117  *
118  * <p>
119  * The final name can be different if the suggested name is already
120  * registered. The waypoint name is registered when it is inserted into the
121  * program tree.
122  * </p>
123  *
124  * Variable waypoints will use the name of the variable instead of the
125  * suggested name.
126  *
127  * @param suggested_name the suggested name of the waypoint. Valid names
128  * must match regex [a-zA-Z][a-zA-Z0-9_]{0,14} for a total of 15 characters.
129  * @return new Waypoint Node.
130  * @throws IllegalWaypointNameException In case of an illegal name.
131  */
132  WaypointNodePtr createWaypointNode(const std::string &suggested_name);
133 
134  /**
135  * Creates an Until Node with no until type specified.
136  *
137  * @return a new Until Node.
138  */
139  UntilNodePtr createUntilNode();
140  DirectionNodePtr createDirectionNode();
141  WaitNodePtr createWaitNode();
142  SetNodePtr createSetNode();
143  SetPayloadNodePtr createSetPayloadNode();
144  PopupNodePtr createPopupNode();
145  HaltNodePtr createHaltNode();
146  CommentNodePtr createCommentNode();
147  FolderNodePtr createFolderNode();
148  LoopNodePtr createLoopNode();
149  AssignmentNodePtr createAssignmentNode();
150  IfNodePtr createIfNode();
151  ElseIfNodePtr createElseIfNode();
152  ElseNodePtr createElseNode();
153  CircleMoveNodePtr createCircleMoveNode();
154  PalletNodePtr createPalletNode();
155  SeekNodePtr createSeekNode();
156  ForceNodePtr createForceNode();
157  AssemblyNodePtr createAssemblyNode();
158  ScrewdrivingNodePtr createScrewdrivingNode();
159  ScriptNodePtr createScriptNode();
160  TimerNodePtr createTimerNode();
161  SwitchNodePtr createSwitchNode();
162  CaseNodePtr createCaseNode();
163  DefaultCaseNodePtr createDefaultCaseNode();
164  BreakNodePtr createBreakNode();
165  SubProgNodePtr createSubProgNode();
166  CallNodePtr createCallNode();
167  OfflineTrackNodePtr createOfflineTrackNode();
168  RecordTrackNodePtr createRecordTrackNode();
169  ThreadNodePtr createThreadNode();
170  ProgramHomeNodePtr createProgramHomeNode();
171 
172  /**
173  * <p>
174  * This method creates a new Gripper program node. This node type can be
175  * used for programming grip and release actions with a selected gripper
176  * device.
177  * </p>
178  *
179  * The program node will be created with the same default configuration as
180  * if the end user added the node manually in AuboScope, i.e. an undefined
181  * configuration where the gripper action is unselected.
182  *
183  * @param gripperDevice the gripper device to create a Gripper node for, not
184  * <code>null</code>. The created Gripper node will program gripper actions
185  * for this device.
186  * @return a new Gripper program node (which can be inserted into the
187  * program tree using the {@link TreeNode} interface).
188  * @throws UnresolvedDeviceException when the specified
189  * <code>gripperDevice</code> device is unresolved. See
190  * {@link GripperDevice#isResolvable()}.
191  */
192  GripperNodePtr createGripperNode(GripperDevicePtr gripperDevice);
193 
194 private:
195  friend class DataSwitch;
197  void *d_{ nullptr };
198 };
199 
200 } // namespace aubo_scope
201 } // namespace arcs
202 
203 #endif
ARCS_CLASS_FORWARD(GripForceCapability)
#define ARCS_ABI_EXPORT
Definition: class_forward.h:16