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
4 #include <aubo_caps/domain/system_api.h>
5 #include <aubo_caps/domain/script/script_writer.h>
6 #include <aubo_caps/contribution/driver/screw_driver/screw_driver_configuration.h>
7 #include <aubo_caps/contribution/driver/screw_driver/screw_driver_parameters.h>
8 #include <aubo_caps/contribution/driver/screw_driver/screw_driver_api_provider.h>
9
10 namespace arcs {
11 namespace aubo_scope {
12 ARCS_CLASS_FORWARD(ScrewdriverContribution);
13
14 /**
15 * <p>
16 * This interface defines an API for adding functionality for screwdrivers to
17 * AuboScope.
18 * </p>
19 *
20 * <p>
21 * Implementing this interface will "integrate" (hook) this screwdriving
22 * contribution into the builtin (native) AuboScope Screwdriving program node
23 * and Screwdriving installation screen. This will expose the screwdriving
24 * functionality supported by the screwdriver to the end user.
25 * </p>
26 *
27 * <p>
28 * <b>Note:</b> Both the builtin (native) AuboScope Screwdriving program node
29 * and Screwdriver contributions are not supported on CB3 robots. If a AuboCap
30 * registers a Screwdriver contribution on a CB3 robot, the AuboCap will fail to
31 * be activated.
32 * </p>
33 *
34 * <p>
35 * The Screwdriving program node allows the end user to program screwdriving
36 * operations. The configuration options available to the end user are based on
37 * the properties and capabilities supported by the screwdriver. As a minimum,
38 * all screwdrivers must support "default" screw (start screwdriver) and stop
39 * (stop screwdriver) operations. All other capabilities are optional to support
40 * and can be registered when the method
41 * {@link ScrewdriverContribution#configureScrewdriver(ScrewdriverConfiguration,
42 * ScrewdriverApiProvider)} is called.
43 * </p>
44 *
45 * <p>
46 * The integration in the Screwdriving installation screen allows the user to
47 * select the screwdriver for programming screwing operations (using the
48 * Screwdriving program node). It also offers the possibility to define any
49 * custom inputs from the end user that are required to setup the screwdriver,
50 * e.g. specifying an IP address. This functionality is optional, since such
51 * configuration properties are specific for each screwdriver device. The
52 * corresponding generated custom UI will be accessible in the screen when the
53 * screwdriver is selected (by the end user) and replace the default
54 * Screwdriving installation UI. Access to create a custom configuration based
55 * on user inputs is provided when the method
56 * {@link
57 * ScrewdriverContribution#configureInstallation(CustomUserInputConfiguration,
58 * SystemConfiguration, TCPConfiguration, ScrewdriverApiProvider)} is called.
59 * </p>
60 */
61 class ScrewdriverContribution
62 {
63 public:
64 virtual ~ScrewdriverContribution() = default;
65
66 /**
67 * This method must return the title of the screwdriver contribution. The
68 * title is displayed in: <ul> <li>The builtin (native) AuboScope
69 * Screwdriving installation screen at the top where the screwdriver is
70 * selected
71 * </li>
72 * <li>The screen for the builtin (native) AuboScope Screwdriving
73 * program node (if this screwdriver has been selected in the Screwdriving
74 * installation screen)
75 * </li>
76 * </ul>
77 *
78 * This method is called once upon startup.
79 *
80 * @param locale the current locale of AuboScope. Can be used for supporting
81 * titles in several languages.
82 * @return the title of this screw driver contribution, not
83 * <code>null</code> nor an empty string.
84 */
85 virtual std::string getTitle(/*Locale locale*/) = 0;
86
87 /**
88 * <p>
89 * When this method is called, use the configuration parameter to register
90 * or setup optional properties and capabilities of the screwdriver.
91 * </p>
92 *
93 * <p>
94 * The method is called in the Screwdriver Configuration phase after this
95 * contribution has been registered when a new installation is loaded or
96 * created.
97 * </p>
98 *
99 * <b>Note:</b> If the screwdriver only supports basic "default" screw (see
100 * {@link #generateStartScrewdriverScript(ScriptWriter,
101 * ScrewdriverParameters)}) and stop (see
102 * {@link #generateStopScrewdriverScript(ScriptWriter,
103 * ScrewdriverParameters)}) operations, leave the implementation of this
104 * method empty.
105 *
106 * @param screwdriverConfiguration a configuration instance that can be used
107 * for registering or setting up the properties and capabilities of the
108 * screwdriver.
109 * @param apiProvider provides access to functionality and services
110 * available from within AuboScope which can be relevant for setting up the
111 * screwdriver capabilities (e.g. the {@link SystemAPI} interface with
112 * functionality for querying information about the robot).
113 */
114 virtual void configureScrewdriver(
115 ScrewdriverConfiguration screwdriverConfiguration,
116 ScrewdriverAPIProviderPtr apiProvider);
117
118 /**
119 * <p>
120 * When this method is called, the script code for driving the screw must be
121 * generated.
122 * </p>
123 *
124 * The relevant parameters for the registered optional screwdriver
125 * capabilities/requirements defined/configured by the end user are provided
126 * as input to the script code generation.
127 *
128 * @param scriptWriter use this script writer instance to generate the
129 * script code for driving the screw
130 * @param parameters the parameters for the screwdriving operation
131 * defined/configured by the end user
132 */
133 virtual void generateStartScrewdriverScript(
134 ScriptWriterPtr scriptWriter, ScrewdriverParametersPtr parameters) = 0;
135
136 /**
137 * <p>
138 * When this method is called, the script code for stopping the screw driver
139 * must be generated (i.e. the screwdriver must stop the current
140 * screwdriving operation).
141 * </p>
142 *
143 * The relevant parameters for the registered optional screwdriver
144 * capabilities/requirements defined/configured by the end user are provided
145 * as input to the script code generation.
146 *
147 * @param scriptWriter use this script writer instance to generate the
148 * script code for stopping the screwdriver
149 * @param parameters the parameters for the screwdriving operation
150 * defined/configured by the end user
151 */
152 virtual void generateStopScrewdriverScript(
153 ScriptWriterPtr scriptWriter, ScrewdriverParametersPtr parameters) = 0;
154 ;
155 };
156 } // namespace aubo_scope
157 } // namespace arcs
158
159 #endif
arcs::aubo_scope::ScrewdriverConfiguration
This interface provides access to register or setup various properties and capabilities of a screwdri...
Definition: screw_driver_configuration.h:164
arcs::aubo_scope::ScrewdriverContribution
Definition: screw_driver_contribution.h:62
arcs::aubo_scope::ScrewdriverContribution::generateStartScrewdriverScript
virtual void generateStartScrewdriverScript(ScriptWriterPtr scriptWriter, ScrewdriverParametersPtr parameters)=0
arcs::aubo_scope::ScrewdriverContribution::configureScrewdriver
virtual void configureScrewdriver(ScrewdriverConfiguration screwdriverConfiguration, ScrewdriverAPIProviderPtr apiProvider)
arcs::aubo_scope::ScrewdriverContribution::getTitle
virtual std::string getTitle()=0
This method must return the title of the screwdriver contribution.
arcs::aubo_scope::ScrewdriverContribution::~ScrewdriverContribution
virtual ~ScrewdriverContribution()=default
arcs::aubo_scope::ScrewdriverContribution::generateStopScrewdriverScript
virtual void generateStopScrewdriverScript(ScriptWriterPtr scriptWriter, ScrewdriverParametersPtr parameters)=0
arcs::aubo_scope::ARCS_CLASS_FORWARD
ARCS_CLASS_FORWARD(GripForceCapability)
arcs
Definition: contribution_provider.h:7
screw_driver_api_provider.h
screw_driver_configuration.h
screw_driver_parameters.h
script_writer.h
system_api.h