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 * @ingroup InstallationApi
12 * \chinese
13 * TCP 贡献模型
14 * 此接口提供在 AuboScope 中添加、更新和删除 TCP 的功能。
15 *
16 * <b>注意:</b>此接口只能在安装贡献中使用。
17 * \endchinese
18 * \english
19 * TcpContributionModel
20 * This interface provides functionality for adding, updating and removing TCPs
21 * in AuboScope.
22 *
23 * <b>Note: </b> This interface must only be used in an installation
24 * contribution.
25 * \endenglish
26 */
28{
29public:
33
34 /**
35 * @ingroup TcpContributionModel
36 * @ref TCP
37 * \chinese
38 * 向当前AuboScope安装中添加一个TCP。添加后终端用户可选择该TCP,但不可修改。
39 *
40 * @param idKey 用于标识此TCP的键。该键仅对此AuboCap有效。
41 * @param suggested_name 建议的TCP名称。
42 * @param offset TCP相对于工具输出法兰的偏移量。
43 * @return 在AuboScope中创建并注册的TCP。
44 * @throws TCPAlreadyAddedException 如果已使用相同idKey添加过TCP。
45 * @throws IllegalTCPNameException 如果建议的名称不匹配所需正则表达式。
46 * @throws IllegalArgumentException 如果偏移量超出有效范围。
47 * \endchinese
48 * \english
49 * Add a TCP to the current AuboScope installation. This makes it selectable
50 * by the end user. The TCP is not modifiable by the end user.
51 *
52 * @param idKey The key to identify this TCP by.
53 * @param suggested_name Suggested name for the TCP.
54 * @param offset The offset of the TCP with respect to the tool output flange.
55 * @return The TCP created and registered in AuboScope.
56 * @throws TCPAlreadyAddedException If called twice using the same idKey.
57 * @throws IllegalTCPNameException If the suggested name does not match regex.
58 * @throws IllegalArgumentException If the offset is invalid.
59 * \endenglish
60 */
61 TCPPtr addTcp(const std::string &idKey, const std::string &suggested_name,
62 const std::vector<double> &offset);
63
64 /**
65 * @ingroup TcpContributionModel
66 * @ref TCP
67 * \chinese
68 * 返回此前由此AuboCap使用相同idKey添加的TCP。
69 * @param idKey TCP标识符键。
70 * @return 此前添加的TCP,如果不存在则返回<code>null</code>。
71 * \endchinese
72 * \english
73 * Returns the TCP previously added by this AuboCap using the same idKey.
74 * @param idKey The key to identify this TCP by.
75 * @return The TCP previously added by this AuboCap.
76 * \endenglish
77 */
78 TCPPtr getTcp(const std::string &idKey);
79
80 /**
81 * @ingroup TcpContributionModel
82 * \chinese
83 * 更新此AuboCap已添加TCP的偏移量。
84 * @param idKey TCP标识符键。
85 * @param newOffset TCP的新偏移量。
86 * @throws TCPNotFoundException 如果不存在对应idKey的TCP。
87 * @throws IllegalArgumentException 如果偏移量超出有效范围。
88 * \endchinese
89 * \english
90 * Update the offset of a TCP already added by this AuboCap.
91 * @param idKey The key to identify the TCP.
92 * @param newOffset The new offset to set for the TCP.
93 * @throws TCPNotFoundException If no TCP exists with the provided idKey.
94 * @throws IllegalArgumentException If the offset is invalid.
95 * \endenglish
96 */
97 void updateTcp(const std::string &idKey,
98 const std::vector<double> &newOffset);
99
100 /**
101 * @ingroup TcpContributionModel
102 * \chinese
103 * 从此AuboCap中移除已添加的TCP。使用该TCP的程序节点将变为未定义。
104 * @param idKey 添加TCP时使用的键。
105 * @throws TCPNotFoundException 如果不存在对应idKey的TCP。
106 * \endchinese
107 * \english
108 * Remove a TCP added by this AuboCap from AuboScope.
109 * @param idKey The key used to add the TCP with.
110 * @throws TCPNotFoundException If no TCP exists with the provided idKey.
111 * \endenglish
112 */
113 void removeTcp(const std::string &idKey);
114
115private:
116 friend class DataSwitch;
118 void *d_{ nullptr };
119};
120
121} // namespace aubo_scope
122} // namespace arcs
123
124#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...
\chinese TCP 贡献模型 此接口提供在 AuboScope 中添加、更新和删除 TCP 的功能。
TCPPtr getTcp(const std::string &idKey)
TCP \chinese 返回此前由此AuboCap使用相同idKey添加的TCP。
TcpContributionModel(TcpContributionModel &&f)
void removeTcp(const std::string &idKey)
\chinese 从此AuboCap中移除已添加的TCP。使用该TCP的程序节点将变为未定义。
TcpContributionModel(TcpContributionModel &f)
TCPPtr addTcp(const std::string &idKey, const std::string &suggested_name, const std::vector< double > &offset)
TCP \chinese 向当前AuboScope安装中添加一个TCP。添加后终端用户可选择该TCP,但不可修改。
void updateTcp(const std::string &idKey, const std::vector< double > &newOffset)
\chinese 更新此AuboCap已添加TCP的偏移量。