devs.sensorpackage.sonarexplorer
Class Sensor

java.lang.Object
  extended by java.lang.Thread
      extended by biocell.BioThread
          extended by devs.sensorpackage.sonarexplorer.Sensor
All Implemented Interfaces:
java.lang.Runnable

public abstract class Sensor
extends BioThread

Author:
biamonte To change the template for this generated type comment go to Window - Preferences - Java - Code Generation - Code and Comments

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
           
static int HIGH_POSITION
           
static int HIGH_SPEED
           
protected  int highPosition
           
protected  int highSpeed
           
static int LOW_POSITION
           
static int LOW_SPEED
           
protected  int lowPosition
           
protected  int lowSpeed
           
static int MIDDLE_SPEED
           
static int MIDLE_POSITION
           
protected  int midlePosition
           
protected  java.util.List motorListeners
           
protected  int motorNumber
           
protected  int newPosition
           
protected  int newSpeed
           
protected static Milford5120 sensorController
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
Sensor()
           
 
Method Summary
 void addMotorListener(SensorListener n)
           
 void fireMotorEvent(SensorEvent e)
           
abstract  int getCurrentPosition()
           
abstract  int getCurrentSpeed()
           
abstract  int getMotorNumber()
           
 void removeMotorListener(SensorListener n)
           
abstract  void rotate(int pos)
           
abstract  void setSpeed(int pos)
           
 void stateChanged()
           
 
Methods inherited from class biocell.BioThread
getCurrentmood, getMoodParam, getstate, setMood, stepEnergy
 
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
 

Field Detail

motorListeners

protected java.util.List motorListeners

sensorController

protected static Milford5120 sensorController

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

HIGH_POSITION

public static final int HIGH_POSITION
See Also:
Constant Field Values

MIDLE_POSITION

public static final int MIDLE_POSITION
See Also:
Constant Field Values

LOW_POSITION

public static final int LOW_POSITION
See Also:
Constant Field Values

HIGH_SPEED

public static final int HIGH_SPEED
See Also:
Constant Field Values

MIDDLE_SPEED

public static final int MIDDLE_SPEED
See Also:
Constant Field Values

LOW_SPEED

public static final int LOW_SPEED
See Also:
Constant Field Values
Constructor Detail

Sensor

public Sensor()
Method Detail

getCurrentPosition

public abstract int getCurrentPosition()

getCurrentSpeed

public abstract int getCurrentSpeed()

rotate

public abstract void rotate(int pos)

setSpeed

public abstract void setSpeed(int pos)

getMotorNumber

public abstract int getMotorNumber()
Returns:

removeMotorListener

public void removeMotorListener(SensorListener n)

stateChanged

public void stateChanged()

fireMotorEvent

public void fireMotorEvent(SensorEvent e)

addMotorListener

public void addMotorListener(SensorListener n)