org.jactr.modules.pm.motor.managers
Class MotorManager

java.lang.Object
  extended by org.jactr.modules.pm.motor.managers.MotorManager
All Implemented Interfaces:
org.commonreality.efferent.event.IEfferentCommandListener, org.commonreality.event.ICommonRealityListener, org.commonreality.object.manager.event.IObjectListener<org.commonreality.efferent.IEfferentCommand>

public class MotorManager
extends java.lang.Object
implements org.commonreality.efferent.event.IEfferentCommandListener

The motor manager encapsulates all of the IEfferentCommand processing necessary to engage in motor movements. Basically, it delegates each of the phases to specific instantiations of AbstractManager (which handles the general communication logic and thread juggling between ModelThread and Common reality). Specifically using PreparationManager, ProcessingManager, and ExecutionManager.

There should be little need to make changes to this code to add new functionality.

Author:
harrison

Constructor Summary
MotorManager(AbstractMotorModule module)
           
 
Method Summary
 void abort(IMovement movement)
           
 void clear()
          clear all the managers.
 void execute(IMovement movement)
           
 IMovement getLastExecutedMovement(org.commonreality.identifier.IIdentifier muscleId)
           
 IMovement getLastPreparedMovement(org.commonreality.identifier.IIdentifier muscleId)
           
 MuscleState getMuscleState(org.commonreality.identifier.IIdentifier muscleId)
           
 void objectsAdded(org.commonreality.object.manager.event.IObjectEvent<org.commonreality.efferent.IEfferentCommand,?> addEvent)
          dont care, we just listen for updates and removes
 void objectsRemoved(org.commonreality.object.manager.event.IObjectEvent<org.commonreality.efferent.IEfferentCommand,?> removeEvent)
           
 void objectsUpdated(org.commonreality.object.manager.event.IObjectEvent<org.commonreality.efferent.IEfferentCommand,?> updateEvent)
           
 IMovement prepare(ChunkTypeRequest pattern, boolean prepareOnly)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MotorManager

public MotorManager(AbstractMotorModule module)
Method Detail

objectsAdded

public void objectsAdded(org.commonreality.object.manager.event.IObjectEvent<org.commonreality.efferent.IEfferentCommand,?> addEvent)
dont care, we just listen for updates and removes

Specified by:
objectsAdded in interface org.commonreality.object.manager.event.IObjectListener<org.commonreality.efferent.IEfferentCommand>
Parameters:
addEvent -

objectsRemoved

public void objectsRemoved(org.commonreality.object.manager.event.IObjectEvent<org.commonreality.efferent.IEfferentCommand,?> removeEvent)
Specified by:
objectsRemoved in interface org.commonreality.object.manager.event.IObjectListener<org.commonreality.efferent.IEfferentCommand>

objectsUpdated

public void objectsUpdated(org.commonreality.object.manager.event.IObjectEvent<org.commonreality.efferent.IEfferentCommand,?> updateEvent)
Specified by:
objectsUpdated in interface org.commonreality.object.manager.event.IObjectListener<org.commonreality.efferent.IEfferentCommand>
Parameters:
updateEvent -

getMuscleState

public MuscleState getMuscleState(org.commonreality.identifier.IIdentifier muscleId)

getLastPreparedMovement

public IMovement getLastPreparedMovement(org.commonreality.identifier.IIdentifier muscleId)

getLastExecutedMovement

public IMovement getLastExecutedMovement(org.commonreality.identifier.IIdentifier muscleId)

prepare

public IMovement prepare(ChunkTypeRequest pattern,
                         boolean prepareOnly)

execute

public void execute(IMovement movement)

abort

public void abort(IMovement movement)

clear

public void clear()
clear all the managers. this should be called on the common reality executor.