public class MotorCommandManager extends EfferentCommandManager<MovementCommand>
Constructor and Description |
---|
MotorCommandManager(AbstractMotorModule module) |
Modifier and Type | Method and Description |
---|---|
IMovement |
abort(IMovement movement,
double requestTime) |
IMovement |
adjust(IMovement movement,
ChunkTypeRequest request,
double requestTime)
nudge an executing movement.
|
boolean |
canAbort(ChunkTypeRequest request) |
boolean |
canAbort(IMovement movement) |
boolean |
canAdjust(ChunkTypeRequest request) |
boolean |
canAdjust(IMovement movement) |
boolean |
canExecute(ChunkTypeRequest request) |
boolean |
canPrepare(ChunkTypeRequest request) |
void |
clear()
explicitly request that executing commands are aborted, and issue a remove
for all the other commands.
|
void |
clear(boolean stopActiveMovements) |
void |
clear(IIdentifier muscleId)
clear an individual muscle
|
protected void |
commandAborted(MovementCommand command,
boolean wasRequested)
call back executed on the CR executor
|
protected void |
commandAccepted(MovementCommand command)
call back executed on the CR executor
|
protected void |
commandCompleted(MovementCommand command)
call back executed on the CR executor
|
protected void |
commandRejected(MovementCommand command)
call back executed on the CR executor
|
protected void |
commandRemoved(MovementCommand command)
call back executed on the CR executor
|
protected void |
commandRunning(MovementCommand command)
call back executed on the CR executor
|
protected MovementCommand |
createCommand(IEfferentObject object,
java.lang.Object... parameters)
create the command using the provided efferent object, from which a
template should be extracted and instantiated
|
IMovement |
execute(IMovement movement,
double requestTime) |
IMovement |
getMovementFromCommand(IIdentifier commandId) |
IMovement |
getMovementFromMuscle(IIdentifier muscleId) |
IMovement |
getPreparedMovement(IIdentifier muscleId) |
protected boolean |
isInterestedIn(IEfferentCommand command) |
protected void |
modelMovementAborted(Movement movement,
MovementCommand command,
boolean wasRequested) |
protected void |
modelMovementCompleted(Movement movement,
MovementCommand command) |
protected void |
modelMovementPrepared(Movement movement,
MovementCommand command)
called on model thread, this handles the states.
|
protected void |
modelMovementProcessed(Movement movement,
MovementCommand command) |
protected void |
modelMovementRejected(Movement movement,
MovementCommand command) |
IMovement |
prepare(ChunkTypeRequest request,
double requestTime,
boolean prepareOnly) |
abort, execute, getAgent, getCommand, getExecutingCommandIds, getExecutingCommands, getIndividualManager, getLock, getMuscle, install, isAutoDeleteEnabled, isExecuting, newCommand, newCommandInternal, remove, request, send, setAutoDeleteEnabled, uninstall
public MotorCommandManager(AbstractMotorModule module)
public IMovement getPreparedMovement(IIdentifier muscleId)
public void clear(IIdentifier muscleId)
muscleId
- public void clear(boolean stopActiveMovements)
public void clear()
EfferentCommandManager
clear
in class EfferentCommandManager<MovementCommand>
public IMovement getMovementFromCommand(IIdentifier commandId)
public IMovement getMovementFromMuscle(IIdentifier muscleId)
protected boolean isInterestedIn(IEfferentCommand command)
isInterestedIn
in class EfferentCommandManager<MovementCommand>
protected void commandRemoved(MovementCommand command)
EfferentCommandManager
commandRemoved
in class EfferentCommandManager<MovementCommand>
protected MovementCommand createCommand(IEfferentObject object, java.lang.Object... parameters)
EfferentCommandManager
createCommand
in class EfferentCommandManager<MovementCommand>
object
- parameters
- IMovement
movement command muscleEfferentCommandManager.createCommand(org.commonreality.object.IEfferentObject,
java.lang.Object[])
public boolean canAdjust(ChunkTypeRequest request)
public boolean canAdjust(IMovement movement)
public IMovement adjust(IMovement movement, ChunkTypeRequest request, double requestTime)
request
- requestTime
- public boolean canPrepare(ChunkTypeRequest request)
public IMovement prepare(ChunkTypeRequest request, double requestTime, boolean prepareOnly) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
request
- prepareOnly
- java.lang.IllegalArgumentException
java.lang.IllegalStateException
protected void commandAccepted(MovementCommand command)
EfferentCommandManager
commandAccepted
in class EfferentCommandManager<MovementCommand>
protected void modelMovementPrepared(Movement movement, MovementCommand command)
movement
- command
- protected void commandRejected(MovementCommand command)
EfferentCommandManager
commandRejected
in class EfferentCommandManager<MovementCommand>
protected void modelMovementRejected(Movement movement, MovementCommand command)
public boolean canExecute(ChunkTypeRequest request)
public IMovement execute(IMovement movement, double requestTime) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
java.lang.IllegalArgumentException
java.lang.IllegalStateException
protected void commandRunning(MovementCommand command)
EfferentCommandManager
commandRunning
in class EfferentCommandManager<MovementCommand>
protected void modelMovementProcessed(Movement movement, MovementCommand command)
protected void commandCompleted(MovementCommand command)
EfferentCommandManager
commandCompleted
in class EfferentCommandManager<MovementCommand>
protected void modelMovementCompleted(Movement movement, MovementCommand command)
public boolean canAbort(ChunkTypeRequest request)
public boolean canAbort(IMovement movement)
public IMovement abort(IMovement movement, double requestTime) throws java.lang.IllegalArgumentException, java.lang.IllegalStateException
java.lang.IllegalArgumentException
java.lang.IllegalStateException
protected void commandAborted(MovementCommand command, boolean wasRequested)
EfferentCommandManager
commandAborted
in class EfferentCommandManager<MovementCommand>
protected void modelMovementAborted(Movement movement, MovementCommand command, boolean wasRequested)