|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.roboticsAPI.applicationModel.tasks.RoboticsAPITask
public abstract class RoboticsAPITask
Base class for RoboticsAPI tasks.
Available types for Dependency Injection| Constructor Summary | |
|---|---|
protected |
RoboticsAPITask()
This constructor is meant to be used with dependency injection. |
protected |
RoboticsAPITask(RoboticsAPIContext context,
com.kuka.task.ITaskLogger logger,
com.kuka.task.ITaskManager taskManager,
boolean createAppControl)
Creates a new instance of the class with specified context. |
| Method Summary | ||
|---|---|---|
void |
dispose()
Disposes this task. |
|
IApplicationData |
getApplicationData()
Gets the application data interface. |
|
protected ITaskUI |
getApplicationUI()
Gets the application UI interface for the application or background task. |
|
RoboticsAPIContext |
getContext()
Gets the context of this task. |
|
Controller |
getController(String controllerName)
Gets the controller instance of the given controller name. |
|
Device |
getDevice(Controller controller,
String deviceName)
Gets the device with the given name on the given controller. |
|
Device |
getDevice(String controllerName,
String deviceName)
Gets the device with the given name on the given controller. |
|
com.kuka.task.ITaskLogger |
getLogger()
Gets the logger of this task. |
|
ObserverManager |
getObserverManager()
Gets the observer manager of this task. |
|
protected IRecovery |
getRecovery()
Gets the application recovery interface for the application or background task. |
|
Robot |
getRobot(Controller controller,
String robotName)
Gets the robot with the given name from the given controller instance. |
|
Robot |
getRobot(String controllerName,
String robotName)
Returns a robot with the specified name from the controller with the specified name. |
|
|
getTaskFunction(Class<T> functionClass)
Returns an instance of the type represented by the given task function class that allows access to the task function provided by an instance of one of the registered tasks. |
|
com.kuka.task.ITaskManager |
getTaskManager()
Gets the task manager. |
|
void |
initialize()
Initializes this task. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.kuka.task.IRoboticsAPITask |
|---|
run |
| Constructor Detail |
|---|
protected RoboticsAPITask()
protected RoboticsAPITask(RoboticsAPIContext context,
com.kuka.task.ITaskLogger logger,
com.kuka.task.ITaskManager taskManager,
boolean createAppControl)
context - context of the task. It will be disposed when this task is disposed.logger - the logger that will be returned by getLogger()taskManager - the task manager that will be returned by getTaskManager() and is used by
getTaskFunction(Class)createAppControl - if set to true - IApplicationControl will be created for this task| Method Detail |
|---|
public RoboticsAPIContext getContext()
getContext in interface ILegacyRoboticsAPITaskIllegalStateException - if the context is not available because the task was not properly initializedpublic final com.kuka.task.ITaskLogger getLogger()
May be used to log information for diagnostics and visualization purposes.
getLogger in interface ILegacyRoboticsAPITaskIllegalStateException - if the logger is not available because the task was not properly initializedpublic void initialize()
initialize in interface com.kuka.task.IRoboticsAPITaskpublic void dispose()
Basic implementation calls getContext().dispose().
It is imperative that you call super.dispose() when you override this method like this:
@Override
public void dispose()
{
try
{
// ... your code ...
}
finally
{
super.dispose();
}
}
dispose in interface com.kuka.task.IRoboticsAPITask
public final Robot getRobot(String controllerName,
String robotName)
controllerName - The name of the controller.robotName - The name of the robot.
IllegalStateException - if the context is not available because the application was not properly initialized
public final Robot getRobot(Controller controller,
String robotName)
controller - The controller instance.robotName - The name of the robot.
public final Device getDevice(String controllerName,
String deviceName)
controllerName - The controller name.deviceName - The name of the device.
IllegalStateException - if the context is not available because the task was not properly initialized
public final Device getDevice(Controller controller,
String deviceName)
controller - The controller.deviceName - The name of the device.
public final Controller getController(String controllerName)
controllerName - The name of the controller.
IllegalStateException - if the context is not available because the task was not properly initializedpublic IApplicationData getApplicationData()
IllegalStateException - if the context is not available because the task was not properly initializedpublic ObserverManager getObserverManager()
IllegalStateException - if the context is not available because the task was not properly initializedprotected ITaskUI getApplicationUI()
IllegalArgumentException - if UI engine is not configured for the application.
IllegalStateException - if the context is not available because the task was not properly initializedpublic <T> T getTaskFunction(Class<T> functionClass)
This proxy allows the methods of the task function to be called only when the providing task instance is running.
If you access the task function methods while the providing instance is not running yet or has stopped running,
an InstanceNotRunningException will be thrown from the method. If you need to wait for the availability
of the task function, you can create a TaskFunctionMonitor.
This function can only be called if the task declaring it does not allow multiple task instances to be started simultaneously.
T - The type of the task function.functionClass - The task function class.
com.kuka.task.FunctionNotAvailableException - if no registered task declares task functions of the given type
com.kuka.task.AmbiguousInstanceException - if the task providing the task function exists but allows multiple instances to be started
simultaneouslypublic final com.kuka.task.ITaskManager getTaskManager()
IllegalStateException - if the task manager is not available because the task was not properly initializedprotected IRecovery getRecovery()
IllegalStateException - if the context is not available because the task was not properly initialized
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||