public interface ScrewdriverContribution
This interface defines an API for adding functionality for screwdrivers to PolyScope.
Implementing this interface will "integrate" (hook) this screwdriving contribution into the builtin (native) PolyScope Screwdriving program node and Screwdriving installation screen. This will expose the screwdriving functionality supported by the screwdriver to the end user.
Note: Both the builtin (native) PolyScope Screwdriving program node and Screwdriver contributions are not supported on CB3 robots. If a URCap registers a Screwdriver contribution on a CB3 robot, the URCap will fail to be activated.
The Screwdriving program node allows the end user to program screwdriving operations. The configuration options
available to the end user are based on the properties and capabilities supported by the screwdriver. As a minimum,
all screwdrivers must support "default" screw (start screwdriver) and stop (stop screwdriver) operations. All other
capabilities are optional to support and can be registered when the method
configureScrewdriver(ScrewdriverConfiguration, ScrewdriverAPIProvider)
is called.
The integration in the Screwdriving installation screen allows the user to select the screwdriver for programming
screwing operations (using the Screwdriving program node). It also offers the possibility to define any custom inputs
from the end user that are required to setup the screwdriver, e.g. specifying an IP address. This functionality is
optional, since such configuration properties are specific for each screwdriver device. The corresponding generated
custom UI will be accessible in the screen when the screwdriver is selected (by the end user) and replace the default
Screwdriving installation UI. Access to create a custom configuration based on user inputs is provided when the method
configureInstallation(CustomUserInputConfiguration, SystemConfiguration, TCPConfiguration, ScrewdriverAPIProvider)
is called.
Modifier and Type | Method and Description |
---|---|
void |
configureContribution(ContributionConfiguration configuration)
When this method is called, optional PolyScope properties for this screwdriver contribution can be configured.
|
void |
configureInstallation(CustomUserInputConfiguration customConfiguration,
SystemConfiguration systemConfiguration,
TCPConfiguration tcpConfiguration,
ScrewdriverAPIProvider apiProvider)
When this method is called, required configuration related to the setup of the screwdriver can be defined/performed,
e.g.
|
void |
configureScrewdriver(ScrewdriverConfiguration screwdriverConfiguration,
ScrewdriverAPIProvider apiProvider)
When this method is called, use the configuration parameter to register or setup optional properties and capabilities
of the screwdriver.
|
void |
generatePreambleScript(ScriptWriter scriptWriter)
Generate script code that must be executed before any screwdriver operations can be performed (such as required
initialization) when this method is called.
|
void |
generateStartScrewdriverScript(ScriptWriter scriptWriter,
ScrewdriverParameters parameters)
When this method is called, the script code for driving the screw must be generated.
|
void |
generateStopScrewdriverScript(ScriptWriter scriptWriter,
ScrewdriverParameters parameters)
When this method is called, the script code for stopping the screw driver must be generated (i.e.
|
String |
getTitle(Locale locale)
This method must return the title of the screwdriver contribution.
|
String getTitle(Locale locale)
locale
- the current locale of PolyScope. Can be used for supporting titles in several languages.null
nor an empty string.void configureContribution(ContributionConfiguration configuration)
When this method is called, optional PolyScope properties for this screwdriver contribution can be configured. The method is called once after this screwdriver contribution is registered.
Modify the configuration parameter to configure your contribution. The configuration object will already have default values for its properties.
The values of the contribution configuration object will be read once immediately after this method call. Changing values at a later stage will have no effect, so do not store a reference to the configuration object.
If the default values are appropriate, leave the implementation of this method empty.configuration
- a modifiable configuration instance with default values that can be used for configuring
the PolyScope properties of this contributionvoid configureScrewdriver(ScrewdriverConfiguration screwdriverConfiguration, ScrewdriverAPIProvider apiProvider)
When this method is called, use the configuration parameter to register or setup optional properties and capabilities of the screwdriver.
The method is called in the Screwdriver Configuration phase after this contribution has been registered when a new installation is loaded or created.
Note: If the screwdriver only supports basic "default" screw (seegenerateStartScrewdriverScript(ScriptWriter, ScrewdriverParameters)
) and stop (see
generateStopScrewdriverScript(ScriptWriter, ScrewdriverParameters)
) operations, leave the implementation
of this method empty.screwdriverConfiguration
- a configuration instance that can be used for registering or setting up the
properties and capabilities of the screwdriver.apiProvider
- provides access to functionality and services available from within PolyScope which can be
relevant for setting up the screwdriver capabilities (e.g. the SystemAPI
interface
with functionality for querying information about the robot).void configureInstallation(CustomUserInputConfiguration customConfiguration, SystemConfiguration systemConfiguration, TCPConfiguration tcpConfiguration, ScrewdriverAPIProvider apiProvider)
When this method is called, required configuration related to the setup of the screwdriver can be defined/performed, e.g. defining custom user inputs, adding a TCP contribution for the screwdriver and configuring the settings of the Tool I/O Interface.
The method is called in the Installation Configuration phase after this contribution has been registered when a new installation is loaded or created.
If no configuration is needed, leave the implementation of this method empty.customConfiguration
- use this instance to register custom user inputs for setting up the screwdriver. The
corresponding generated UI will be accessible in the builtin (native) PolyScope
Screwdriving installation screen when this screwdriver is selected (by the end user).systemConfiguration
- use this instance to configure the robot system for this screwdriver, e.g. configure the
Tool I/O interface settingstcpConfiguration
- use this instance to add a TCP for this screwdriver to PolyScope as well as update the TCP's
offset and remove the TCP again. A screwdriver contribution can only contribute one TCP to PolyScope.apiProvider
- Provides access to functionality and services available from within PolyScope which can be
relevant for defining the installation of the screwdriver (e.g. the PoseFactory
interface which is needed for creating TCPs)void generatePreambleScript(ScriptWriter scriptWriter)
Generate script code that must be executed before any screwdriver operations can be performed (such as required initialization) when this method is called. The script code is added to the beginning (preamble) of the script code executed when a robot program is run.
Note: Generating preamble script code is optional. Leave the implementation of this method empty, if execution of initialization script code is not needed.scriptWriter
- use this script writer instance to generate the script code that must be executed before
screwdriver operations can be performedvoid generateStartScrewdriverScript(ScriptWriter scriptWriter, ScrewdriverParameters parameters)
When this method is called, the script code for driving the screw must be generated.
The relevant parameters for the registered optional screwdriver capabilities/requirements defined/configured by the end user are provided as input to the script code generation.scriptWriter
- use this script writer instance to generate the script code for driving the screwparameters
- the parameters for the screwdriving operation defined/configured by the end uservoid generateStopScrewdriverScript(ScriptWriter scriptWriter, ScrewdriverParameters parameters)
When this method is called, the script code for stopping the screw driver must be generated (i.e. the screwdriver must stop the current screwdriving operation).
The relevant parameters for the registered optional screwdriver capabilities/requirements defined/configured by the end user are provided as input to the script code generation.scriptWriter
- use this script writer instance to generate the script code for stopping the screwdriverparameters
- the parameters for the screwdriving operation defined/configured by the end userCopyright © 2021. All rights reserved.