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