AuboStudio SDK  0.6.3
tcp_contribution_model.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_TCP_CONTRIBUTION_MODEL_H
2#define AUBO_SCOPE_TCP_CONTRIBUTION_MODEL_H
3
5
6namespace arcs {
7namespace aubo_scope {
9
10/**
11 * <p>
12 * This interface provides functionality for adding, updating and removing TCPs
13 * in AuboScope.
14 * </p>
15 *
16 * <b>Note: </b> This interface must only be used in an installation
17 * contribution/
18 */
20{
21public:
25
26 /**
27 * Add a TCP to the current AuboScope installation. This makes it selectable
28 * by the end user. The TCP is not modifiable by the end user.
29 *
30 * @param idKey The key to identify this TCP by. The key is for this AuboCap
31 * only, i.e. it only has to be unique for this AuboCap and not "globally"
32 * for other aubo_studio plugins.
33 * @param suggested_name Suggested name for the tcp/ Valid names must match
34 * regex [a-zA-Z][a-zA-Z0-9_]{0,14} for a total of 15 characters. The final
35 * name can be retrieved from the returned TCP instance.
36 * @param offset The offset of the TCP with respect to the tool output
37 * flange
38 * @return The TCP created and registered in AuboScope.
39 * @throws TCPAlreadyAddedException If called twice using the same
40 * <code>idKey</code>. Use {@link #getTCP(std::string)} to check if the TCP
41 * has already been added to the current installation. Use {@link
42 * #updateTCP(std::string, Pose)} to update the TCP if the offset of the TCP
43 * has changed.
44 * @throws IllegalTCPNameException If the suggested name does not match
45 * required regex.
46 * @throws IllegalArgumentException If the pose specified for the offset is
47 * not inside the valid range of a TCP offset as defined by AuboScope.
48 */
49 TCPPtr addTcp(const std::string &idKey, const std::string &suggested_name,
50 const std::vector<double> &offset);
51
52 /**
53 * Returns the TCP previously added by this AuboCap using the same
54 * <code>idKey</code>. Use this to verify if the TCP is present in the
55 * current installation.
56 *
57 * @param idKey The key to identify this TCP by.
58 * @return The TCP previously added by this AuboCap.
59 * Returns <code>null</code> if no TCP exists in current
60 * installation.
61 */
62 TCPPtr getTcp(const std::string &idKey);
63
64 /**
65 * Update the offset of a TCP already added by this AuboCap.
66 *
67 * @param idKey The key to identify the tcp/ A TCP must have been added
68 * prior to this method call using the same key.
69 * @param newOffset The new offset to set for the TCP with respect to the
70 * tool output flange.
71 * @throws TCPNotFoundException If no TCP exists with the provided
72 * <code>idKey</code>.
73 * @throws IllegalArgumentException If the pose specified for the offset is
74 * not inside the valid range of a TCP offset as defined by AuboScope.
75 */
76 void updateTcp(const std::string &idKey,
77 const std::vector<double> &newOffset);
78
79 /**
80 * Remove a TCP added by this AuboCap from AuboScope. Program nodes using
81 * the TCP will be become undefined because the TCP is no longer resolvable.
82 *
83 * @param idKey The key used to add the TCP with.
84 * @throws TCPNotFoundException If no TCP exists with the provided
85 * <code>idKey</code>.
86 */
87 void removeTcp(const std::string &idKey);
88
89private:
90 friend class DataSwitch;
92 void *d_{ nullptr };
93};
94
95} // namespace aubo_scope
96} // namespace arcs
97
98#endif // TCPCONTRIBUTIONMODEL_H
#define ARCS_ABI_EXPORT
#define ARCS_CLASS_FORWARD(C)
Macro that forward declares a class and defines the respective smartpointers through ARCS_DECLARE_PTR...
TCPPtr getTcp(const std::string &idKey)
Returns the TCP previously added by this AuboCap using the same idKey.
TcpContributionModel(TcpContributionModel &&f)
void removeTcp(const std::string &idKey)
Remove a TCP added by this AuboCap from AuboScope.
TcpContributionModel(TcpContributionModel &f)
TCPPtr addTcp(const std::string &idKey, const std::string &suggested_name, const std::vector< double > &offset)
Add a TCP to the current AuboScope installation.
void updateTcp(const std::string &idKey, const std::vector< double > &newOffset)
Update the offset of a TCP already added by this AuboCap.