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