com.kuka.roboticsAPI.controllerModel
Class Controller

java.lang.Object
  extended by com.kuka.roboticsAPI.controllerModel.Controller
Direct Known Subclasses:
AbstractSunriseController

public abstract class Controller
extends Object

A controller is the access point to a robotics control controller and has access methods to services each controller must provide. All services have a lazy creation strategy. They are initialized right at the point when they are needed.


Constructor Summary
protected Controller(RoboticsAPIContext context, String name)
          Creates a new instance of a controller.
 
Method Summary
 void addControllerListener(IControllerStateListener listener)
          Adds a lListener.
protected  void afterDispose()
          Called after the controller was disposed.
 boolean afterInitialize()
          Called when the controller was initialized.
protected  boolean areServicesInitialized()
          Indicates if the services (in initialization phase) are initialized.
protected  void callAsyncEvent(com.kuka.common.events.IEventCaller<IControllerStateListener> caller)
          Calls the specified event asynchronously.
protected  void callSyncEvent(com.kuka.common.events.IEventCaller<IControllerStateListener> caller)
          Calls the specified event synchronously.
 void clipProgramOverride(double overrideClip)
          Deprecated. use IApplicationOverrideControl.clipManualOverride(double) instead.
protected  ConditionService createConditionServiceInstance()
          Create a condition service instance.
protected abstract  ExecutionService createExecutionServiceInstance()
          Should return an uninitialized instance of the ExecutionService for this controller.
protected  RecordingService createRecordingServiceInstance()
          Create a recording service instance.
protected abstract  RequestService createRequestServiceInstance()
          Should return an uninitialized instance of the RequestService for this controller.
 void deinitialize()
          Deinitializes the controller.
 void dispose()
          Disposes the controller.
protected  void fireControllerShutdown()
          Informs all listeners about that the controller is about to be shutdown.
protected  void fireFieldBusDeviceConfigurationChangedEvent(DispatchedEventData dispatchedEvent)
          Informs all listeners that the IP-address of the controller has changed.
protected  void fireFieldBusDeviceIdentificationEvent(DispatchedEventData dispatchedEvent)
          Informs all listeners that a field bus identification request came in.
protected  void fireStatePortChanged(com.kuka.roboticsAPI.controllerModel.StatePortData data)
          Informs all listeners that the state port (= error message port) of the controller has changed.
 IControllerInitializeBehaviour getBehavior()
          Gets the current controller initialize behavior.
 ConditionService getConditionService()
          Get the condition service of the controller.
 RoboticsAPIContext getContext()
          Gets the context of this controller.
 ControllerInformation getControllerInformation()
          Gets some additional information about this controller.
protected  ControllerInformation getControllerInformationInstance()
          Should return an initialized instance of the controller information for this controller.
<T extends Device>
T
getDevice(Class<T> deviceClass)
          Gets the first device with the given type or throws an exception if no device was found.
 Device getDevice(String name)
          Gets the device with the given name or throws an exception if no device was found.
protected  Map<String,Device> getDeviceMap()
          Returns the complete map with devices for classes deriving from controller.
 Collection<Device> getDevices()
          Gets a list of available devices from the controller.
 ExecutionService getExecutionService()
          Gets the service from the controller dealing with execution of commands.
 Iterable<com.kuka.common.ParameterSet> getInvalidDevices()
          Gets all devices of the controller that are not initialized and not usable.
 String getName()
          Gets the name of the controller.
 com.kuka.common.ParameterSet getParameters()
          Returns the parameters which were used to configure the controller.
 double getProgramOverride()
          Deprecated. use IApplicationOverrideControl.getManualOverride() instead.
 RecordingService getRecordingService()
          Gets the recording service of the controller.
 RequestService getRequestService()
          Gets the service from the controller dealing with requests.
 ControllerBootInfo getSystemState()
          Gets the state of the system.
 void initialize()
          Initializes the controller.
 boolean isInitialized()
          Returns whether the controller is initialized.
protected  void onDispose()
          Called when this controller get's disposed.
 void onInitialize()
          Called when the controller get's initialized.
 void onInitializeFailed()
          Called when the controller initialization failed.
protected  void onServicesInitialized()
          Called when all services of the controller are initialized.
protected  void onSetParameters(com.kuka.common.ParameterSet attributeMap)
          Sets the attributes for this controller.
 void removeControllerListener(IControllerStateListener listener)
          Removes a listener.
 void resetRecordingService()
          Resets the recording service.
 void setParameters(com.kuka.common.ParameterSet parameters)
          Sets the parameters for this controller.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Controller

protected Controller(RoboticsAPIContext context,
                     String name)
Creates a new instance of a controller.

Subclasses should provide the same constructor with the same parameters, because this constructor is called by the RoboticsAPI through reflection.

Parameters:
context - The context for this controller. null is not allowed.
name - The name of the controller. null is not allowed.
Method Detail

getProgramOverride

@Deprecated
public double getProgramOverride()
Deprecated. use IApplicationOverrideControl.getManualOverride() instead.

Gets the manual override of the application for this controller's robots.

Returns:
The current manual override of the application.

clipProgramOverride

@Deprecated
public void clipProgramOverride(double overrideClip)
Deprecated. use IApplicationOverrideControl.clipManualOverride(double) instead.

Clips the manual override of the application to the specified value.

Parameters:
overrideClip - Manual override will be clipped to this value [0:1].

getInvalidDevices

public final Iterable<com.kuka.common.ParameterSet> getInvalidDevices()
Gets all devices of the controller that are not initialized and not usable.

Invalid devices are only present if the controller handles failures during initialization and reports these failures in the GetDeviceListRequest. Furthermore, the controller should only accept invalid devices if contexts are created in a graceful way.

Returns:
All devices of the controller that are not initialized and/or not usable.
See Also:
RoboticsAPIContext.usingGracefulInitialization()
This element is not in its final state and might change in future versions.

getDevices

public final Collection<Device> getDevices()
Gets a list of available devices from the controller.

Returns:
A list of available devices.

getDeviceMap

protected final Map<String,Device> getDeviceMap()
Returns the complete map with devices for classes deriving from controller.

Returns:
The devices map .

getDevice

public final <T extends Device> T getDevice(Class<T> deviceClass)
Gets the first device with the given type or throws an exception if no device was found.

Type Parameters:
T - The type of the device.
Parameters:
deviceClass - The device class.
Returns:
The first found device with the given type.

getDevice

public final Device getDevice(String name)
Gets the device with the given name or throws an exception if no device was found.

Parameters:
name - The name of the device.
Returns:
The device with the given name.
Throws:
IllegalArgumentException - if device with the specified name does not exists.
This element is not in its final state and might change in future versions.

getRequestService

public RequestService getRequestService()
Gets the service from the controller dealing with requests.

Fails if the controller is not initialized.

Returns:
The request service.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getExecutionService

public ExecutionService getExecutionService()
Gets the service from the controller dealing with execution of commands.

Fails if the controller is not initialized.

Returns:
The execution service
This element is not in its final state and might change in future versions.

getControllerInformation

public ControllerInformation getControllerInformation()
Gets some additional information about this controller.

Fails if the controller is not initialized.

Returns:
A class containing some additional information about this controller.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getName

public final String getName()
Gets the name of the controller.

Returns:
The name of the controller.

getConditionService

public ConditionService getConditionService()
Get the condition service of the controller.

Returns:
The condition service of the controller.

getRecordingService

public final RecordingService getRecordingService()
Gets the recording service of the controller.

Returns:
The recording service of the controller.

resetRecordingService

public void resetRecordingService()
Resets the recording service.


getParameters

public final com.kuka.common.ParameterSet getParameters()
Returns the parameters which were used to configure the controller.

Returns:
The parameters which were used to configure the controller.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getContext

public final RoboticsAPIContext getContext()
Gets the context of this controller.

Returns:
The context of this controller.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

isInitialized

public final boolean isInitialized()
Returns whether the controller is initialized.

Returns:
true if the controller is initialized.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

initialize

public final void initialize()
Initializes the controller.

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

deinitialize

public final void deinitialize()
Deinitializes the controller.

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

dispose

public final void dispose()
Disposes the controller.

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

setParameters

public final void setParameters(com.kuka.common.ParameterSet parameters)
Sets the parameters for this controller. Used when the configuration of the controllers is loaded.

Parameters:
parameters - The parameters defined for this controller.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

addControllerListener

public void addControllerListener(IControllerStateListener listener)
Adds a lListener. The listener is informed when controller state is changed.

Parameters:
listener - The listener that will be registered. null is not allowed.

The same listener instance can be registered only once.

Throws:
IllegalArgumentException - if the specified lister is already registered

removeControllerListener

public void removeControllerListener(IControllerStateListener listener)
Removes a listener. The listener is removed from the list of listener that are informed when safety state is changed.

Parameters:
listener - The listener that will be unregistered. null is not allowed.

fireControllerShutdown

protected void fireControllerShutdown()
Informs all listeners about that the controller is about to be shutdown.


fireStatePortChanged

protected void fireStatePortChanged(com.kuka.roboticsAPI.controllerModel.StatePortData data)
Informs all listeners that the state port (= error message port) of the controller has changed.

Parameters:
data - state port information

fireFieldBusDeviceConfigurationChangedEvent

protected void fireFieldBusDeviceConfigurationChangedEvent(DispatchedEventData dispatchedEvent)
Informs all listeners that the IP-address of the controller has changed.

Parameters:
dispatchedEvent - the new communication layer parameters.

fireFieldBusDeviceIdentificationEvent

protected void fireFieldBusDeviceIdentificationEvent(DispatchedEventData dispatchedEvent)
Informs all listeners that a field bus identification request came in.

Parameters:
dispatchedEvent - the new signal parameters.

callAsyncEvent

protected void callAsyncEvent(com.kuka.common.events.IEventCaller<IControllerStateListener> caller)
Calls the specified event asynchronously.

Asynchronously calls the IEventCaller#callFor(com.kuka.common.IEventListener) method for every IControllerStateListener registered by this controller using event worker thread.

Parameters:
caller - the event caller.

callSyncEvent

protected void callSyncEvent(com.kuka.common.events.IEventCaller<IControllerStateListener> caller)
Calls the specified event synchronously.

Synchronously calls the IEventCaller#callFor(com.kuka.common.IEventListener) method for every IControllerStateListener registered by this controller.

Parameters:
caller - the event caller.

areServicesInitialized

protected final boolean areServicesInitialized()
Indicates if the services (in initialization phase) are initialized.

Returns:
true if the services are initialized.

createRequestServiceInstance

protected abstract RequestService createRequestServiceInstance()
Should return an uninitialized instance of the RequestService for this controller.

Returns:
An uninitialized instance of the RequestService for this controller.

createExecutionServiceInstance

protected abstract ExecutionService createExecutionServiceInstance()
Should return an uninitialized instance of the ExecutionService for this controller.

Returns:
An uninitialized instance of the ExecutionService for this controller.

createConditionServiceInstance

protected ConditionService createConditionServiceInstance()
Create a condition service instance.

Returns:
Condition service instance.

createRecordingServiceInstance

protected RecordingService createRecordingServiceInstance()
Create a recording service instance.

Returns:
Recording service instance.

getControllerInformationInstance

protected ControllerInformation getControllerInformationInstance()
Should return an initialized instance of the controller information for this controller. The default implementation returns a default information instance.

Returns:
An initialized instance of the controller information for this controller.

onSetParameters

protected void onSetParameters(com.kuka.common.ParameterSet attributeMap)
Sets the attributes for this controller. Used when the configuration of the controllers is loaded.

Parameters:
attributeMap - The attributes defined for this controller.

afterDispose

protected void afterDispose()
Called after the controller was disposed.

This method is the last method called during the disposal process.


onDispose

protected void onDispose()
Called when this controller get's disposed. Use this method to dispose controller specific stuff.

This method is the first method called during disposing of a controller. The concrete controller still has all initialized things available.

ControllerServices will get disposed automatically.


onInitializeFailed

public void onInitializeFailed()
Called when the controller initialization failed.


onInitialize

public void onInitialize()
Called when the controller get's initialized. Use this method to do controller specific initialization stuff.

The method is called before any other initialization of the controller occurred. The controller will return false for the isInitialized method and no service will be available.

This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

onServicesInitialized

protected void onServicesInitialized()
Called when all services of the controller are initialized. The services are available, the devices are not.


afterInitialize

public boolean afterInitialize()
Called when the controller was initialized. Use this method to initialize more controller specific stuff. All devices and services are available.

Note that this method instead of the onInitialize method is called after the controller was initialized. The isInitialized method will return true and each service should be available.

Returns:
true if initialization was ok and the controller is ready afterwards. false if the controller can be used but the boot state should be ReadyWithWarnings.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getSystemState

public ControllerBootInfo getSystemState()
Gets the state of the system.

Returns:
the state of the system as controller boot information.
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

getBehavior

public IControllerInitializeBehaviour getBehavior()
Gets the current controller initialize behavior.

Returns:
the current controller initialize behavior
This element is an undocumented internal feature. It is not intended to be used by applications as it might change or be removed in future versions.

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2019. All rights reserved.