org.lejon
Class DriveModel

java.lang.Object
  extended byorg.lejon.DriveModel
Direct Known Subclasses:
DDModel

public abstract class DriveModel
extends java.lang.Object

This is an abstract description of a drive. Each concrete architecture should be inherited from this class and implemented.


Field Summary
static int IDLE
          Constant for execution state IDLE
static int MOVING
          Constant for execution state MOVING
static int PAUSE
          Constant for execution state PAUSE
static int SETUP
          Constant for execution state SETUP
 
Method Summary
 void addMotionEventListener(MotionEventListener motionEventListener)
          Sets a listener for handling callbacks from here.
abstract  void cancel()
          Cancels the running action.
abstract  MotionReport getMotionReport()
          Returns the motion report for the current action.
abstract  void move()
          Executes the action that was set up previously.
abstract  void pause()
          Pauses the running action.
 void removeMotionEventListener()
          Removes the current MotionEventListener.
abstract  void resume()
          Restarts the previously paused action.
abstract  void setMotionCommand(MotionCommand motionCommand)
          Sets a motion command which defines the action to be excecuted by the drive.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

IDLE

public static final int IDLE
Constant for execution state IDLE

See Also:
Constant Field Values

SETUP

public static final int SETUP
Constant for execution state SETUP

See Also:
Constant Field Values

MOVING

public static final int MOVING
Constant for execution state MOVING

See Also:
Constant Field Values

PAUSE

public static final int PAUSE
Constant for execution state PAUSE

See Also:
Constant Field Values
Method Detail

setMotionCommand

public abstract void setMotionCommand(MotionCommand motionCommand)
Sets a motion command which defines the action to be excecuted by the drive.

Parameters:
motionCommand - the motion command.

getMotionReport

public abstract MotionReport getMotionReport()
Returns the motion report for the current action.

Returns:
the current motion report

move

public abstract void move()
Executes the action that was set up previously.


pause

public abstract void pause()
Pauses the running action.


resume

public abstract void resume()
Restarts the previously paused action.


cancel

public abstract void cancel()
Cancels the running action.


addMotionEventListener

public void addMotionEventListener(MotionEventListener motionEventListener)
Sets a listener for handling callbacks from here.

Parameters:
motionEventListener - the listener object

removeMotionEventListener

public void removeMotionEventListener()
Removes the current MotionEventListener.