com.kuka.roboticsAPI.applicationModel
Class RoboticsAPIApplication

java.lang.Object
  extended by com.kuka.roboticsAPI.applicationModel.tasks.RoboticsAPITask
      extended by com.kuka.roboticsAPI.applicationModel.RoboticsAPIApplication
All Implemented Interfaces:
IRoboticsAPIApplication, ILegacyRoboticsAPITask, com.kuka.task.IRoboticsAPITask
Direct Known Subclasses:
SunriseApplication

public abstract class RoboticsAPIApplication
extends RoboticsAPITask
implements IRoboticsAPIApplication

Base class for RoboticsAPI applications.

See Also:
Available types for Dependency Injection

Constructor Summary
protected RoboticsAPIApplication()
          This constructor is meant to be used with dependency injection.
protected RoboticsAPIApplication(RoboticsAPIContext context)
          Creates a new instance of the application with specified context, without logging or task manager capabilities.
protected RoboticsAPIApplication(RoboticsAPIContext context, com.kuka.task.ITaskLogger logger, com.kuka.task.ITaskManager taskManager)
          Creates a new instance of the application with specified context.
 
Method Summary
<T extends SpatialObject>
T
createFromTemplate(String name)
          Creates an instance if SpatialObject (or its specialization) based on the template with the given name.
 IApplicationControl getApplicationControl()
          Gets the application control interface for the application.
 IApplicationUI getApplicationUI()
          Gets the application UI interface for the application.
 ObjectFrame getFrame(String name)
          Gets a persistent frame with the given name.
 IRecovery getRecovery()
          Gets the interface for recovery.
 void onApplicationStateChanged(RoboticsAPIApplicationState state)
          Called from the framework when the application state has changed.
 void runApplication()
          Convenience method that initializes, runs and disposes the application.
 
Methods inherited from class com.kuka.roboticsAPI.applicationModel.tasks.RoboticsAPITask
dispose, getApplicationData, getContext, getController, getDevice, getDevice, getLogger, getObserverManager, getRobot, getRobot, getTaskFunction, getTaskManager, initialize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.kuka.roboticsAPI.applicationModel.tasks.ILegacyRoboticsAPITask
getContext, getLogger
 
Methods inherited from interface com.kuka.task.IRoboticsAPITask
dispose, initialize, run
 

Constructor Detail

RoboticsAPIApplication

protected RoboticsAPIApplication()
This constructor is meant to be used with dependency injection. When using this constructor, the class depends on fields to be injected.


RoboticsAPIApplication

protected RoboticsAPIApplication(RoboticsAPIContext context)
Creates a new instance of the application with specified context, without logging or task manager capabilities. The application will not be able to use logging (RoboticsAPITask.getLogger() or the task manager ( RoboticsAPITask.getTaskManager() and RoboticsAPITask.getTaskFunction(Class)).

Parameters:
context - context of the task. It will be disposed when this task is disposed.

RoboticsAPIApplication

protected RoboticsAPIApplication(RoboticsAPIContext context,
                                 com.kuka.task.ITaskLogger logger,
                                 com.kuka.task.ITaskManager taskManager)
Creates a new instance of the application with specified context.

Parameters:
context - context of the task. It will be disposed when this task is disposed.
logger - the logger that will be returned by RoboticsAPITask.getLogger()
taskManager - the task manager that will be returned by RoboticsAPITask.getTaskManager() and is used by RoboticsAPITask.getTaskFunction(Class)
Method Detail

runApplication

public void runApplication()
Convenience method that initializes, runs and disposes the application.

The dispose method will be called, even if an exception is thrown during initialization or run.

See Also:
RoboticsAPITask.initialize(), IRoboticsAPITask.run(), RoboticsAPITask.dispose()

getFrame

public final ObjectFrame getFrame(String name)
Gets a persistent frame with the given name.

Parameters:
name - The name of the frame.
Returns:
The loaded frame.
Throws:
IllegalStateException - if the context is not available because the application was not properly initialized
This element is not in its final state and might change in future versions.

createFromTemplate

public final <T extends SpatialObject> T createFromTemplate(String name)
Creates an instance if SpatialObject (or its specialization) based on the template with the given name.

Type Parameters:
T - The type of the created instance.
Parameters:
name - The name of a template.
Returns:
The instance based on the template with the given name.
Throws:
IllegalStateException - if the context is not available because the application was not properly initialized
This element is not in its final state and might change in future versions.

onApplicationStateChanged

public void onApplicationStateChanged(RoboticsAPIApplicationState state)
Called from the framework when the application state has changed.

Specified by:
onApplicationStateChanged in interface IRoboticsAPIApplication
Parameters:
state - The new state of the robotics API application.
This element is not in its final state and might change in future versions.

getApplicationUI

public IApplicationUI getApplicationUI()
Gets the application UI interface for the application.

Overrides:
getApplicationUI in class RoboticsAPITask
Returns:
The application UI interface for the application.
Throws:
IllegalArgumentException - if UI engine is not configured for the application.

getApplicationControl

public IApplicationControl getApplicationControl()
Gets the application control interface for the application.

Returns:
The application control interface for the application.
Throws:
IllegalStateException - if the context is not available because the application was not properly initialized

getRecovery

public IRecovery getRecovery()
Gets the interface for recovery.

Overrides:
getRecovery in class RoboticsAPITask
Returns:
The recovery interface.


Copyright © 2019. All rights reserved.