brain.reflexgenerator
Class PMotionCalculator

java.lang.Object
  extended by java.lang.Thread
      extended by biocell.BioThread
          extended by nns.BioSensor
              extended by brain.reflexgenerator.PMotionCalculator
All Implemented Interfaces:
BioDevice, java.lang.Runnable, java.util.EventListener, MNSListener

public class PMotionCalculator
extends BioSensor

Author:
nabhoth

Nested Class Summary
 
Nested classes/interfaces inherited from class java.lang.Thread
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler
 
Field Summary
(package private)  int baseCounter
           
static int DETECT_LIMIT
           
static int E_STEP
           
static int[] genSteps
           
(package private)  BioDeviceListener listener
           
static int MEM_STEP
           
(package private)  int motionCounter
           
static int N_STEP
           
static int NE_STEP
           
static java.lang.String[] nGenSteps
           
static int NO_STEP
           
static int NW_STEP
           
static int RGB_DETECT_LIMIT
           
static int S_STEP
           
static int SE_STEP
           
static int SW_STEP
           
static int W_STEP
           
 
Fields inherited from class nns.BioSensor
EXTERO_SENSOR, INTERO_SENSOR, PROPRIO_SENSOR
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Fields inherited from interface biocell.BioDevice
BLOCKED, BUSY, CYCLING, DONE, END, PAUSED, RESUMED, START, WAIT
 
Constructor Summary
PMotionCalculator(BioSensorListener listener)
           
PMotionCalculator(ImagePanel ip, BioSensorListener listener)
           
PMotionCalculator(ImagePanel ip, javax.swing.JPanel id, BioSensorListener listener)
           
 
Method Summary
 void addListener(BioDeviceListener rP)
           
 java.lang.String getControls()
           
 javax.swing.JPanel getid()
           
 ImagePanel getIp()
           
 void process(MNSEvent cnv)
          loads a CNSEvent into a listener
 void run()
           
 void setData(java.awt.image.BufferedImage bi)
           
 void setId(javax.swing.JPanel id)
           
 void setIp(ImagePanel ip)
           
 
Methods inherited from class nns.BioSensor
addListener, addSensorListener, geState, getCurrentPosition, getCurrentState, getListener, getname, getType, load, loadCNTR, seState, setListener, setname, setType
 
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, 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

listener

BioDeviceListener listener

baseCounter

int baseCounter

motionCounter

int motionCounter

MEM_STEP

public static int MEM_STEP

DETECT_LIMIT

public static int DETECT_LIMIT

RGB_DETECT_LIMIT

public static int RGB_DETECT_LIMIT

NO_STEP

public static int NO_STEP

N_STEP

public static int N_STEP

E_STEP

public static int E_STEP

W_STEP

public static int W_STEP

S_STEP

public static int S_STEP

NE_STEP

public static int NE_STEP

NW_STEP

public static int NW_STEP

SE_STEP

public static int SE_STEP

SW_STEP

public static int SW_STEP

nGenSteps

public static java.lang.String[] nGenSteps

genSteps

public static int[] genSteps
Constructor Detail

PMotionCalculator

public PMotionCalculator(BioSensorListener listener)
Parameters:
listener -

PMotionCalculator

public PMotionCalculator(ImagePanel ip,
                         BioSensorListener listener)
Parameters:
ip - - the initial display
listener - - the listener

PMotionCalculator

public PMotionCalculator(ImagePanel ip,
                         javax.swing.JPanel id,
                         BioSensorListener listener)
Parameters:
ip -
id -
listener -
Method Detail

addListener

public void addListener(BioDeviceListener rP)
Specified by:
addListener in interface BioDevice
Overrides:
addListener in class BioSensor

getid

public javax.swing.JPanel getid()
Returns:
Returns the id.

setId

public void setId(javax.swing.JPanel id)
Parameters:
id - The id to set.

setIp

public void setIp(ImagePanel ip)
Parameters:
ip - The associated panel to set.

getIp

public ImagePanel getIp()
Returns:
Returns the ip.

getControls

public java.lang.String getControls()
Specified by:
getControls in interface BioDevice
Overrides:
getControls in class BioSensor
Returns:

setData

public void setData(java.awt.image.BufferedImage bi)
Parameters:
bi - - extract the data from the taken image

run

public void run()
Specified by:
run in interface java.lang.Runnable
Overrides:
run in class java.lang.Thread

process

public void process(MNSEvent cnv)
Description copied from interface: MNSListener
loads a CNSEvent into a listener

Specified by:
process in interface MNSListener
Overrides:
process in class BioSensor