devs.motorpackage.asc16
Class Motor

java.lang.Object
  extended by java.lang.Thread
      extended by devs.motorpackage.asc16.Motor
All Implemented Interfaces:
ASC16Listener, java.lang.Runnable
Direct Known Subclasses:
Servo

public abstract class Motor
extends java.lang.Thread
implements ASC16Listener

Author:
biamonte, lukac The superclass of the Servo objects, definitions and abstract methods to be used by every single servo motor

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
protected  int acceleration
           
protected  int currentPosition
           
protected  int currentSpeed
           
protected  int highPosition
           
protected  int highSpeed
           
protected  int lowPosition
           
protected  int lowSpeed
           
protected  int midlePosition
           
protected static ASC16 motorController
           
protected  java.util.List motorListeners
           
protected  int motorNumber
           
protected  int newPosition
           
protected  int newSpeed
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface devs.motorpackage.asc16.ASC16Listener
HIGH_POSITION, HIGH_SPEED, LOW_POSITION, LOW_SPEED, MIDDLE_SPEED, MIDLE_POSITION
 
Constructor Summary
Motor()
           
 
Method Summary
 void fireMotorEvent(MotorEvent e)
           
abstract  int getCurrentPosition()
           
abstract  int getCurrentSpeed()
           
abstract  int getMotorNumber()
           
 void removeMotorListener(MotorListener n)
           
abstract  void setAcceleration(int acceleration)
           
abstract  void setSpeed(int speed)
           
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface devs.motorpackage.asc16.ASC16Listener
stateChanged
 

Field Detail

motorListeners

protected java.util.List motorListeners

motorController

protected static ASC16 motorController

currentPosition

protected int currentPosition

highPosition

protected int highPosition

lowPosition

protected int lowPosition

midlePosition

protected int midlePosition

newPosition

protected int newPosition

currentSpeed

protected int currentSpeed

highSpeed

protected int highSpeed

lowSpeed

protected int lowSpeed

newSpeed

protected int newSpeed

acceleration

protected int acceleration

motorNumber

protected int motorNumber
Constructor Detail

Motor

public Motor()
Method Detail

getCurrentPosition

public abstract int getCurrentPosition()
Returns:

getCurrentSpeed

public abstract int getCurrentSpeed()
Returns:

setSpeed

public abstract void setSpeed(int speed)
Parameters:
pos -

setAcceleration

public abstract void setAcceleration(int acceleration)
Parameters:
pos -

getMotorNumber

public abstract int getMotorNumber()
Returns:

removeMotorListener

public void removeMotorListener(MotorListener n)
Parameters:
n -

fireMotorEvent

public void fireMotorEvent(MotorEvent e)
Parameters:
e -