|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.kuka.appframework.ApplicationBlock<E>
E - The generic type of the ApplicationBlock. The enumeration of the generic type can be defined inside a
concrete ApplicationBlock or outside, e.g. as a separate file. It can be used in one or multiple
ApplicationBlocks.public abstract class ApplicationBlock<E extends Enum<?>>
The ApplicationBlock is the code behind a Block in the BlockModel.
The user code is defined in its run method. The run method will return a value which represents an exit of the Block.
The user code is responsible for returning the right values.
To check preconditions before running the block, override checkPreconditions() method.
To add inputs create and annotate a setter method with an Input annotation.
To add outputs create and annotate a getter method with an Output annotation.
When annotated with CyclicPreconditionCheck failing preconditions will be rechecked until all pass.
Checking interval is configurable via CyclicPreconditionCheck parameter.
When CyclicPreconditionCheck is enabled, checks will be performed until all preconditions pass or user
chooses to ignore failing preconditions.
| Constructor Summary | |
|---|---|
ApplicationBlock()
|
|
| Method Summary | |
|---|---|
void |
checkPreconditions(IChecker checker)
This method is executed before run() method. |
abstract E |
run()
The run method. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ApplicationBlock()
| Method Detail |
|---|
public void checkPreconditions(IChecker checker)
throws Exception
run() method.
A precondition is defined using IChecker.check(boolean, String) method.
Example:
checker.check(isGripperOpen(), "Check if gripper is open")
checkPreconditions(IChecker) is a blocking operation and will be executed at least once
before run() method.
run() will only be executed if all preconditions pass or user chooses to ignore failed
preconditions.
NOTE: CyclicPreconditionCheck is disabled when user chooses to ignore preconditions.
checker - the checker that will handle the result of the precondition check
Exception - an exception that can occur while checking
public abstract E run()
throws Exception
Exception - Any exceptions that result while executing the user code.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||