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