|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Thread biocell.BioThread mns.MNSRobotPart
public class MNSRobotPart
Class implementing parts of the robot from the symbolic or highest point of view Each BodyPart has a set of associated devices that are fetched against the incoming commands in form of either files or strings This set of command is send to CNS that takes care about the synchronization and other low level features The order of devices is as follows: first is speech synthesis second is speech recognition Third is vision control system all devices after are servos associated with robot movements Each CNSRobotPart can have only one ThreadedCommand at a time This is not restricted but the feedback is not tracking the appropriatte devices and confusion between threads can occur This is done by initiating a command with a ExecPeriod != 0 ThreadedCommand will be executing all parts of the command beside SpeechProduction.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.lang.Thread |
---|
java.lang.Thread.State, java.lang.Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class java.lang.Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
MNSRobotPart(MNSRobotPartListener listener,
BioDevice[] devs,
java.lang.String name)
|
|
MNSRobotPart(MNSRobotPartListener listener,
java.lang.String name)
|
Method Summary | |
---|---|
void |
addCommand(java.lang.String biocommand)
add a command to the list of current commands, the ordering of the variables for the constructor matters!!!! Thus synax is maximally required. |
void |
addDevs(BioDevice[] devs)
add a set of devices (BioDevices) and replace the old ones |
void |
addDevs(java.util.Vector bioDevices)
|
void |
commandOccured(CommandEvent o)
|
void |
execute(java.lang.String comm,
java.lang.String argument)
The only public method to execute commands from a external parent such as the CNS All commands must be previously registered specific commands for control of devices: parameters modifying the way of doing things in short direct commands to the hardware that needs a thread executes a command if it exists with the set of parameters |
Command |
getCommand(java.lang.String comName)
get a Command if available in this CNSRobotPart |
java.util.Vector |
getCommands()
|
BioDevice |
getDevice(int index)
return the BioDevice at specified index |
BioDevice[] |
getDevices()
|
java.lang.String |
getname()
get the name of this CNSRobotPArt |
int |
getPartAccel(int bioindex)
|
int |
getPartMax(int bioindex)
|
int |
getPartMin(int bioindex)
|
int |
getPartSpeed(int bioindex)
|
int |
getstate()
fetch the current state according to BioDevice scheme - unusual but exploitable in the future |
void |
run()
overriden from Thread Each RobotPart is sleeping for a period = endCycle and then checks for the command Queue. |
void |
setname(java.lang.String name)
set name of this CNSRobotPart |
void |
setPartAccel(int accel,
int bioindex)
|
void |
setPartMax(int max,
int bioindex)
|
void |
setPartMax(java.lang.String max)
|
void |
setPartMin(int min,
int bioindex)
|
void |
setPartMin(java.lang.String min)
|
void |
setPartSpeed(int speed,
int bioindex)
|
void |
stateChanged(int currentState)
|
Methods inherited from class biocell.BioThread |
---|
getCurrentmood, getMoodParam, 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 |
Constructor Detail |
---|
public MNSRobotPart(MNSRobotPartListener listener, java.lang.String name)
RobotPartListener
- -
the CNSRobotPart listenername
- -
the name of the commandpublic MNSRobotPart(MNSRobotPartListener listener, BioDevice[] devs, java.lang.String name)
RobotPartListener
- -
the CNSRobotPart listenerdevs
- -
the pointers to dedicated devicesname
- -
the name of the robotpartMethod Detail |
---|
public void commandOccured(CommandEvent o)
commandOccured
in interface CommandListener
public void addCommand(java.lang.String biocommand)
command
- -
command to be addedpublic Command getCommand(java.lang.String comName)
commandName
- -
name of the desired command
public java.util.Vector getCommands()
public BioDevice[] getDevices()
public BioDevice getDevice(int index)
index
- -
index of the device
public void addDevs(BioDevice[] devs)
devs
- -
the array of BioDevicespublic void addDevs(java.util.Vector bioDevices)
bioDevices
- public java.lang.String getname()
public void setname(java.lang.String name)
name
- -
Stringpublic void setPartMax(int max, int bioindex)
public void setPartMin(int min, int bioindex)
public void setPartSpeed(int speed, int bioindex)
public int getPartAccel(int bioindex)
public int getPartMax(int bioindex)
public int getPartMin(int bioindex)
public int getPartSpeed(int bioindex)
public void setPartAccel(int accel, int bioindex)
public void setPartMax(java.lang.String max)
max
- public void setPartMin(java.lang.String min)
min
- public int getstate()
getstate
in class BioThread
public void execute(java.lang.String comm, java.lang.String argument)
comm
- -
name of the commandargument
- -
argument to the commandpublic void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void stateChanged(int currentState)
currentState
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |