public interface ScrewdriverFeedbackCapabilities
Register the feedback capabilities of the screwdriver using this interface. A feedback capability is a type of status the screwdriver is capable of informing PolyScope about.
PolyScope will execute the script code associated with a feedback capability at appropriate times in the given context. Script code generated must be idempotent (meaning it has no side effects when called multiple times if all other state has not changed in between calls). The script code generated must also execute fast, since the feedback could be checked often.Modifier and Type | Method and Description |
---|---|
void |
registerDriveScrewNotOKCapability(ScriptCodeGenerator<DriveScrewNotOKParameters> scriptCodeGenerator)
Register a feedback capability for a screwdriver that is capable of providing information about whether
or not an ongoing screwdriving operation (driving the screw) failed, i.e.
|
void |
registerDriveScrewOKCapability(ScriptCodeGenerator<DriveScrewOKParameters> scriptCodeGenerator)
Register a feedback capability for a screwdriver that is capable of providing information about whether
or not an ongoing screwdriving operation (driving the screw) ended successfully (ended in OK-state).
|
void |
registerScrewdriverReadyCapability(ScriptCodeGenerator<ScrewdriverReadyParameters> scriptCodeGenerator)
Register a feedback capability for a screwdriver that is capable of providing information about whether
or not the screwdriver device is ready to operate (receive commands).
|
void registerDriveScrewOKCapability(ScriptCodeGenerator<DriveScrewOKParameters> scriptCodeGenerator)
Register a feedback capability for a screwdriver that is capable of providing information about whether or not an ongoing screwdriving operation (driving the screw) ended successfully (ended in OK-state).
Note: This capability must only be used to provide feedback about the success of the screwing operation.
It should not be used to provide feedback about failures. To support feedback about when the operation fails,
register the Drive Screw Not Ok feedback capability the using the
registerDriveScrewNotOKCapability(ScriptCodeGenerator)
method.
The provided implementation of the ScriptCodeGenerator
interface must generate the script code for
determining if the screwing operation succeeded. The return value of the script code must be a boolean, i.e.
'True' or 'False'. 'True' must be returned if the screwing operation was successful, otherwise 'False' must be
returned.
Note: A return value of 'False' must not be used to indicate that the operation failed, but simply that a success was not (yet) detected. If the screwdriver can provide feedback on whether or not the screwing operation failed, the Drive Screw Not Ok feedback capability must be used.
Example:return get_tool_digital_in(0)So the implementation of
ScriptCodeGenerator.generateScript(ScriptWriter, Object)
could be:
scriptWriter.appendLine("return get_tool_digital_in(0)");
scriptCodeGenerator
- script code generator responsible for generating the script code for determining if
the screwing operation succeeded. When the script code needs to be generated, the
ScriptCodeGenerator.generateScript(ScriptWriter, Object)
method will be
called (by PolyScope). Return value for the generated script code must be a boolean,
i.e. 'True' or 'False'.CapabilityAlreadyRegistered
- if this capability has already been registeredCalledOutsideScrewdriverConfigurationPhase
- if this method is called at the wrong time, i.e. outside the scope
of the ScrewdriverContribution.configureScrewdriver(ScrewdriverConfiguration, ScrewdriverAPIProvider)
method.void registerDriveScrewNotOKCapability(ScriptCodeGenerator<DriveScrewNotOKParameters> scriptCodeGenerator)
Register a feedback capability for a screwdriver that is capable of providing information about whether or not an ongoing screwdriving operation (driving the screw) failed, i.e. ended in Not Ok (NOK) state.
Note: This capability must only be used to provide feedback about the failure of the screwing operation.
It should not be used to provide feedback about successes. To support feedback about when the operation succeeds,
register the Drive Screw Ok feedback capability the using the registerDriveScrewOKCapability(ScriptCodeGenerator)
method.
The provided implementation of the ScriptCodeGenerator
interface must generate the script code for
determining if the screwing operation ended in failure. The return value of the script code must be a boolean,
i.e. 'True' or 'False'. 'True' must be returned if the screwing operation failed, otherwise 'False' must be
returned.
Note: A return value of 'False' must not be used to indicate that the operation succeeded, but simply that a failure was not (yet) detected. If the screwdriver can provide feedback on whether or not the screwing operation succeeded, the Drive Screw Ok feedback capability should be used.
Example:return get_tool_digital_in(1)So the implementation of
ScriptCodeGenerator.generateScript(ScriptWriter, Object)
could be:
scriptWriter.appendLine("return get_tool_digital_in(1)");
scriptCodeGenerator
- script code generator responsible for generating the script code for determining if
the screwing operation failed. When the script code needs to be generated,
the ScriptCodeGenerator.generateScript(ScriptWriter, Object)
method will be
called (by PolyScope). Return value for the generated script code must be a boolean,
i.e. 'True' or 'False'.CapabilityAlreadyRegistered
- if this capability has already been registeredCalledOutsideScrewdriverConfigurationPhase
- if this method is called at the wrong time, i.e. outside the scope
of the ScrewdriverContribution.configureScrewdriver(ScrewdriverConfiguration, ScrewdriverAPIProvider)
method.void registerScrewdriverReadyCapability(ScriptCodeGenerator<ScrewdriverReadyParameters> scriptCodeGenerator)
Register a feedback capability for a screwdriver that is capable of providing information about whether or not the screwdriver device is ready to operate (receive commands). This capability is used (by PolyScope) in a program to ensure that the screwdriver is ready before sending commands to it.
The provided implementation of the ScriptCodeGenerator
interface must generate the script code for
determining if the screwdriver is ready. The return value of the script code must be a boolean, i.e. 'True' or
'False'. 'True' must be returned if the screwdriver is ready, otherwise 'False' must be returned.
scriptCodeGenerator
- script code generator responsible for generating the script code for determining if
the screwdriver is ready. When the script code needs to be generated, the
ScriptCodeGenerator.generateScript(ScriptWriter, Object)
method will be
called (by PolyScope). Return value for the generated script code must be a boolean,
i.e. 'True' or 'False'.CapabilityAlreadyRegistered
- if this capability has already been registeredCalledOutsideScrewdriverConfigurationPhase
- if this method is called at the wrong time, i.e. outside the scope
of the ScrewdriverContribution.configureScrewdriver(ScrewdriverConfiguration, ScrewdriverAPIProvider)
method.Copyright © 2021. All rights reserved.