AuboStudio SDK  0.6.3
screw_driver_contribution.h
浏览该文件的文档.
1#ifndef AUBO_SCOPE_SCREW_DIRVER_CONTRIBUTION_H
2#define AUBO_SCOPE_SCREW_DIRVER_CONTRIBUTION_H
3
9
10namespace arcs {
11namespace aubo_scope {
13
14/**
15 * \chinese
16 * 螺丝刀贡献
17 * 此接口定义了向 AuboScope 添加螺丝刀功能的 API。
18 *
19 * 实现此接口将把螺丝刀贡献"集成"(挂钩)到内置(原生)AuboScope 螺丝刀程序节点
20 * 和螺丝刀安装画面中。这将向终端用户暴露螺丝刀支持的螺丝驱动功能。
21 *
22 * <b>注意:</b>内置(原生)AuboScope 螺丝刀程序节点和螺丝刀贡献在 CB3 机器人上
23 * 均不受支持。如果 AuboCap 在 CB3 机器人上注册了螺丝刀贡献,AuboCap 将无法激活。
24 *
25 * 螺丝刀程序节点允许终端用户编程螺丝驱动操作。终端用户可用的参数基于螺丝刀支持的
26 * 属性和功能。至少,所有螺丝刀必须支持"默认"拧紧(启动螺丝刀)和停止(停止螺丝刀)
27 * 操作。所有其他功能是可选的,可以在调用
28 * {@link ScrewdriverContribution#configureScrewdriver(ScrewdriverConfiguration,
29 * ScrewdriverApiProvider)} 方法时注册。
30 *
31 * 螺丝刀安装画面中的集成允许用户选择螺丝刀来进行拧紧操作编程(使用螺丝刀程序节点)。
32 * 它还提供了定义终端用户所需的任何自定义输入来设置螺丝刀的可能性,例如指定 IP 地址。
33 * 此功能是可选的,因为此类配置属性是特定于每个螺丝刀设备的。相应的生成自定义 UI 将在
34 * 用户选择螺丝刀时在画面中可访问,并替换默认的螺丝刀安装 UI。当调用
35 * {@link ScrewdriverContribution#configureInstallation(CustomUserInputConfiguration,
36 * SystemConfiguration, TCPConfiguration, ScrewdriverApiProvider)} 方法时,提供创建
37 * 基于用户输入的自定义配置的访问权限。
38 * \endchinese
39 * \english
40 * ScrewdriverContribution
41 * This interface defines an API for adding functionality for screwdrivers to
42 * AuboScope.
43 *
44 * Implementing this interface will "integrate" (hook) this screwdriving
45 * contribution into the builtin (native) AuboScope Screwdriving program node
46 * and Screwdriving installation screen. This will expose the screwdriving
47 * functionality supported by the screwdriver to the end user.
48 *
49 * <b>Note:</b> Both the builtin (native) AuboScope Screwdriving program node
50 * and Screwdriver contributions are not supported on CB3 robots. If a AuboCap
51 * registers a Screwdriver contribution on a CB3 robot, the AuboCap will fail to
52 * be activated.
53 *
54 * The Screwdriving program node allows the end user to program screwdriving
55 * operations. The configuration options available to the end user are based on
56 * the properties and capabilities supported by the screwdriver. As a minimum,
57 * all screwdrivers must support "default" screw (start screwdriver) and stop
58 * (stop screwdriver) operations. All other capabilities are optional to support
59 * and can be registered when the method
60 * {@link ScrewdriverContribution#configureScrewdriver(ScrewdriverConfiguration,
61 * ScrewdriverApiProvider)} is called.
62 *
63 * The integration in the Screwdriving installation screen allows the user to
64 * select the screwdriver for programming screwing operations (using the
65 * Screwdriving program node). It also offers the possibility to define any
66 * custom inputs from the end user that are required to setup the screwdriver,
67 * e.g. specifying an IP address. This functionality is optional, since such
68 * configuration properties are specific for each screwdriver device. The
69 * corresponding generated custom UI will be accessible in the screen when the
70 * screwdriver is selected (by the end user) and replace the default
71 * Screwdriving installation UI. Access to create a custom configuration based
72 * on user inputs is provided when the method
73 * {@link
74 * ScrewdriverContribution#configureInstallation(CustomUserInputConfiguration,
75 * SystemConfiguration, TCPConfiguration, ScrewdriverApiProvider)} is called.
76 * \endenglish
77 */
79{
80public:
81 virtual ~ScrewdriverContribution() = default;
82
83 /**
84 * \chinese
85 * 此方法必须返回螺丝刀贡献的标题。标题显示在以下位置:
86 * <ul>
87 * <li>内置 AuboScope 螺丝驱动安装画面顶部选择螺丝刀的位置</li>
88 * <li>内置 AuboScope 螺丝驱动程序节点的画面(如果已在螺丝驱动安装画面中选择了
89 * 此螺丝刀)</li>
90 * </ul>
91 * 此方法在启动时调用一次。
92 *
93 * @param locale AuboScope 的当前语言环境,可用于支持多种语言的标题
94 * @return 此螺丝刀贡献的标题,不能为 <code>null</code> 也不能为空字符串
95 * \endchinese
96 * \english
97 * This method must return the title of the screwdriver contribution. The
98 * title is displayed in: <ul> <li>The builtin (native) AuboScope
99 * Screwdriving installation screen at the top where the screwdriver is
100 * selected
101 * </li>
102 * <li>The screen for the builtin (native) AuboScope Screwdriving
103 * program node (if this screwdriver has been selected in the Screwdriving
104 * installation screen)
105 * </li>
106 * </ul>
107 *
108 * This method is called once upon startup.
109 *
110 * @param locale the current locale of AuboScope. Can be used for supporting
111 * titles in several languages.
112 * @return the title of this screw driver contribution, not
113 * <code>null</code> nor an empty string.
114 * \endenglish
115 */
116 virtual std::string getTitle(/*Locale locale*/) = 0;
117
118 /**
119 * \chinese
120 * <p>当调用此方法时,使用 configuration 参数注册或设置螺丝刀的可选属性和功能。</p>
121 * <p>此方法在螺丝刀配置阶段调用,在贡献注册后、新安装被加载或创建时调用。</p>
122 * <b>注意:</b>如果螺丝刀仅支持基本的"默认"拧紧和停止操作,请将此方法的实现留空。
123 *
124 * @param screwdriverConfiguration 可用于注册或设置螺丝刀属性和功能的配置实例
125 * @param apiProvider 提供对 AuboScope 中可用于设置螺丝刀功能的相关功能和服务访问
126 * \endchinese
127 * \english
128 * <p>
129 * When this method is called, use the configuration parameter to register
130 * or setup optional properties and capabilities of the screwdriver.
131 * </p>
132 * ...
133 * @param screwdriverConfiguration a configuration instance that can be used
134 * for registering or setting up the properties and capabilities of the
135 * screwdriver.
136 * @param apiProvider provides access to functionality and services
137 * available from within AuboScope which can be relevant for setting up the
138 * screwdriver capabilities (e.g. the {@link SystemAPI} interface with
139 * functionality for querying information about the robot).
140 * \endenglish
141 */
143 ScrewdriverConfiguration screwdriverConfiguration,
144 ScrewdriverAPIProviderPtr apiProvider);
145
146 /**
147 * \chinese
148 * <p>当调用此方法时,必须生成驱动螺丝的脚本代码。</p>
149 * 终端用户定义/配置的已注册可选螺丝刀功能/要求的参数将作为脚本代码生成的输入。
150 *
151 * @param scriptWriter 使用此脚本编写器实例生成驱动螺丝的脚本代码
152 * @param parameters 终端用户定义/配置的螺丝驱动操作参数
153 * \endchinese
154 * \english
155 * <p>
156 * When this method is called, the script code for driving the screw must be
157 * generated.
158 * </p>
159 * The relevant parameters for the registered optional screwdriver
160 * capabilities/requirements defined/configured by the end user are provided
161 * as input to the script code generation.
162 *
163 * @param scriptWriter use this script writer instance to generate the
164 * script code for driving the screw
165 * @param parameters the parameters for the screwdriving operation
166 * defined/configured by the end user
167 * \endenglish
168 */
170 ScriptWriterPtr scriptWriter, ScrewdriverParametersPtr parameters) = 0;
171
172 /**
173 * \chinese
174 * <p>当调用此方法时,必须生成停止螺丝刀的脚本代码(即螺丝刀必须停止当前的
175 * 螺丝驱动操作)。</p>
176 * 终端用户定义/配置的已注册可选螺丝刀功能/要求的参数将作为脚本代码生成的输入。
177 *
178 * @param scriptWriter 使用此脚本编写器实例生成停止螺丝刀的脚本代码
179 * @param parameters 终端用户定义/配置的螺丝驱动操作参数
180 * \endchinese
181 * \english
182 * <p>
183 * When this method is called, the script code for stopping the screw driver
184 * must be generated (i.e. the screwdriver must stop the current
185 * screwdriving operation).
186 * </p>
187 * The relevant parameters for the registered optional screwdriver
188 * capabilities/requirements defined/configured by the end user are provided
189 * as input to the script code generation.
190 *
191 * @param scriptWriter use this script writer instance to generate the
192 * script code for stopping the screwdriver
193 * @param parameters the parameters for the screwdriving operation
194 * defined/configured by the end user
195 * \endenglish
196 */
198 ScriptWriterPtr scriptWriter, ScrewdriverParametersPtr parameters) = 0;
199 ;
200};
201} // namespace aubo_scope
202} // namespace arcs
203
204#endif
#define ARCS_CLASS_FORWARD(C)
Macro that forward declares a class and defines the respective smartpointers through ARCS_DECLARE_PTR...
This interface provides access to register or setup various properties and capabilities of a screwdri...
\chinese 螺丝刀贡献 此接口定义了向 AuboScope 添加螺丝刀功能的 API。
virtual void generateStartScrewdriverScript(ScriptWriterPtr scriptWriter, ScrewdriverParametersPtr parameters)=0
\chinese
virtual void configureScrewdriver(ScrewdriverConfiguration screwdriverConfiguration, ScrewdriverAPIProviderPtr apiProvider)
\chinese
virtual std::string getTitle()=0
\chinese 此方法必须返回螺丝刀贡献的标题。标题显示在以下位置:
virtual void generateStopScrewdriverScript(ScriptWriterPtr scriptWriter, ScrewdriverParametersPtr parameters)=0
\chinese