|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.kuka.roboticsAPI.controllerModel.ControllerService
com.kuka.roboticsAPI.controllerModel.ExecutionService
com.kuka.roboticsAPI.controllerModel.sunrise.SunriseExecutionService
public class SunriseExecutionService
Sunrise execution service. Maps commands to SPRs and sends them to Sunrise. It also handles the incoming message from Sunrise concerning SPR states and SPR data.
This class is responsible for handling the main command protocol with Sunrise. Changes in the protocol must be reflected in this class.
| Nested Class Summary | |
|---|---|
static interface |
SunriseExecutionService.IPauseListener
A listener for the pause. |
| Method Summary | |
|---|---|
void |
addContainerQueuedListener(IContainerQueuedListener listener)
Adds the specified execution event listener. |
void |
addExecutionListener(IExecutionListener listener)
Adds the specified execution event listener. |
void |
addPauseListener(SunriseExecutionService.IPauseListener listener)
Adds the specified pause event listener. |
void |
addSPRHook(ISPRHook hook)
Adds the given SPRHook to the list. |
ICommandContainer |
beginExecution(IControllerCommand command,
IContainerStateListener listener)
The execute method should execute the given container in an asynchronous manner. |
void |
blockExecution()
Blocks the execution of commands by the execution service. |
void |
cancel(ICommandContainer container)
Cancels the given command in the given container. |
void |
cancelAll()
Cancels all pending commands for this controller. |
void |
cancelAllOn(Device device)
Cancels all pending commands on the given device. |
void |
cancelPause()
Cancels the pause state and resets the execution service. |
void |
clearExecutionContainerQueues()
Cancels all current active MotionContainers and cancels all currentActiveContainers plus clears both lists. |
protected void |
dispose()
Disposes this service. |
void |
doPausing()
Handles pausing of the execution after the pausing request. |
ICommandContainer |
execute(IControllerCommand command,
IContainerStateListener listener)
The execute method should execute the given container in a synchronous manner. |
ICommandContainer |
executeSPR(SPR spr)
Executes the specified SPR. |
protected SPRRuntime |
findSPRRuntime(long sprId)
Searches for a SPR which is being currently executed. |
protected SPRRuntime |
findSPRRuntimeByMotionId(long motionId)
Searches for a SPR which is being currently executed. |
int |
getActiveContainerCount()
|
protected ExecutorService |
getContainerCleanupWorker()
Returns the container cleanup worker. |
protected ExecutorService |
getContainerEventWorker()
Returns the container event worker. |
SunriseController |
getController()
Gets the controller associated with this service. |
IErrorHandler |
getErrorHandler()
Gets the handler for errors in asynchronous motion commands. |
com.kuka.roboticsAPI.executionModel.ExecutionMode |
getExecutionMode()
Gets the actual execution mode. |
SunriseMapperTable |
getMapperTable()
Gets the mapper table used by this execution service. |
RecoveryManager |
getRecovery()
Returns the recovery interface which can be used: to determine if the application can be resumed, which strategies are available to resume the application and which recovery strategy is used to resume the application. |
protected ExecutorService |
getSprListenerWorker()
|
protected void |
initialize()
Initializes this service. |
boolean |
isPaused()
Returns true if ExecutionService is paused at this moment. |
boolean |
isPausedAndStopped()
Returns true if the execution service is in paused state and all motions are already stopped. |
static void |
printSPRs(boolean printSPRs)
Raises the log level of SPRs from TRACE to INFO. |
void |
removeContainerQueuedListener(IContainerQueuedListener listener)
Removes the specified execution event listener. |
void |
removeExecutionListener(IExecutionListener listener)
Removes the specified execution event listener. |
void |
removePauseListener(SunriseExecutionService.IPauseListener listener)
Removes the specified pause event listener. |
void |
removeSPRHook(ISPRHook hook)
Removes the given SPRHook. |
boolean |
resumeExecution(ResumeMode mode)
Resumes the paused execution. |
void |
setAlwaysResetOnMotion(boolean alwaysReset)
Ensures that every executed motion sets the reset flag for the interpolator to true. |
void |
setEnforceMsr2Cmd()
Use to force a Msr2Cmd before the next command. |
void |
setErrorHandler(IErrorHandler errorHandler)
Sets the handler for errors in asynchronous motion commands. |
void |
setExecutionMode(com.kuka.roboticsAPI.executionModel.ExecutionMode newExecutionMode)
Sets the execution mode. |
void |
startPause()
Requests pausing of the execution . |
String |
toString()
|
void |
waitForPaused()
Wait for paused. |
boolean |
waitForPaused(long timeout,
TimeUnit unit)
|
void |
waitForResumed()
Wait for resumed. |
boolean |
waitForResumed(long timeout,
TimeUnit unit)
|
| Methods inherited from class com.kuka.roboticsAPI.controllerModel.ControllerService |
|---|
getContext |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public SunriseController getController()
getController in class ControllerServicepublic static void printSPRs(boolean printSPRs)
printSPRs - True if you want to raise the log level of SPRs.public void addContainerQueuedListener(IContainerQueuedListener listener)
listener - the listener for the execution events.
IllegalArgumentException - if listener is null or the same listener is already registered by the execution servicepublic void removeContainerQueuedListener(IContainerQueuedListener listener)
listener - execution event listener to remove.public void addPauseListener(SunriseExecutionService.IPauseListener listener)
listener - the listener for the pause events.
IllegalArgumentException - if listener is null or the same listener is already registered by the execution servicepublic void removePauseListener(SunriseExecutionService.IPauseListener listener)
listener - execution event listener to remove.protected void initialize()
ControllerServicePlease note that when the method is called, the controller of the service is not yet initialized. This means that there are no guarantees that the controller is operable.
initialize in class ExecutionServiceprotected void dispose()
ControllerService
dispose in class ExecutionService
public ICommandContainer execute(IControllerCommand command,
IContainerStateListener listener)
execute in class ExecutionServicecommand - The command to be executed. null is not allowed.listener - The listener which will be called when the container state changes. May be null.
public ICommandContainer beginExecution(IControllerCommand command,
IContainerStateListener listener)
beginExecution in class ExecutionServicecommand - The command to be executed. null is not allowed.listener - The listener which will be called when the container state changes. May be null.
public boolean isPaused()
IExecutionServicePaused
isPaused in interface IExecutionServicePausedpublic boolean isPausedAndStopped()
IExecutionServicePaused
isPausedAndStopped in interface IExecutionServicePausedpublic void waitForPaused()
public boolean waitForPaused(long timeout,
TimeUnit unit)
timeout - wait-timeunit - time-unit
public void waitForResumed()
public boolean waitForResumed(long timeout,
TimeUnit unit)
timeout - wait-timeunit - time-unit
public void startPause()
startPause in interface IPausableExecutionServicepublic void doPausing()
public boolean resumeExecution(ResumeMode mode)
IPausableExecutionService
resumeExecution in interface IPausableExecutionServicemode - specifies how execution should be resumed
public void cancelPause()
cancelPause in interface IPausableExecutionServicepublic void blockExecution()
If execution is blocked - exception is thrown by attempt to call the execute method.
public void cancelAll()
cancelAll in class ExecutionServicepublic void cancelAllOn(Device device)
device - the device where to cancel all commandspublic void cancel(ICommandContainer container)
cancel in class ExecutionServicecontainer - The container to cancel.public SunriseMapperTable getMapperTable()
public ICommandContainer executeSPR(SPR spr)
The execution is asynchronous. However the method can block if the execution service is in paused state. Use the
IExecutionContainer.await() method on the returned container to block until the SPR in done.
spr - The SPR to be executed. null is not allowed.
public void removeSPRHook(ISPRHook hook)
hook - The hook which should be removed. null is not allowed.public void addSPRHook(ISPRHook hook)
hook - The hook which should get called. null is not allowed.protected SPRRuntime findSPRRuntime(long sprId)
sprId - The SPR id.
protected SPRRuntime findSPRRuntimeByMotionId(long motionId)
motionId - The Motion id.
public com.kuka.roboticsAPI.executionModel.ExecutionMode getExecutionMode()
public void setExecutionMode(com.kuka.roboticsAPI.executionModel.ExecutionMode newExecutionMode)
Execution mode cannot be changed when the execution is not paused or the application is executed in automatic operation mode.
newExecutionMode - the execution mode to set.
IllegalStateException - if changing of the execution mode is not possible at this momentprotected ExecutorService getContainerEventWorker()
ExecutionServiceThis worker can be used by every execution container to throw its events.
getContainerEventWorker in class ExecutionServiceprotected ExecutorService getContainerCleanupWorker()
ExecutionServiceThis worker can be used by every execution container to perform cleanup actions.
getContainerCleanupWorker in class ExecutionServiceprotected ExecutorService getSprListenerWorker()
public void clearExecutionContainerQueues()
public int getActiveContainerCount()
public IErrorHandler getErrorHandler()
public void setErrorHandler(IErrorHandler errorHandler)
errorHandler - handler of errors in asynchronous motion commands. Can not be null.public void setAlwaysResetOnMotion(boolean alwaysReset)
alwaysReset - when true, the reset flag is always set to true for every motion.public RecoveryManager getRecovery()
getRecovery in interface IPausableExecutionServicepublic void setEnforceMsr2Cmd()
public void addExecutionListener(IExecutionListener listener)
IPausableExecutionService
addExecutionListener in interface IPausableExecutionServicelistener - the listener for the execution events.public void removeExecutionListener(IExecutionListener listener)
IPausableExecutionService
removeExecutionListener in interface IPausableExecutionServicelistener - execution event listener to remove.public String toString()
toString in class ExecutionService
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||