|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.Observable
dlife.robot.Device
dlife.robot.PseudoDevice
public abstract class PseudoDevice
Abstract base class for devices that do not require communication with a robot. The difference between this class and the Device class is that a PseudoDevice makes no contact with the robot which it is applied to. All methods will require another means of communication to gather the required information. Examples of PseudoDevices might be an overhead camera to gather information on a robot, or the proximity of two StageRobots to each other in a Stage simulation.
| Field Summary |
|---|
| Fields inherited from class dlife.robot.Device |
|---|
DEFAULT_GUI_UPDATE_DELAY, DEFAULT_READ_DELAY, myRobot, readCount |
| Constructor Summary | |
|---|---|
PseudoDevice(boolean autoRead)
Construct a new PseudoDevice. |
|
PseudoDevice(int readDelay,
int guiDelay,
boolean autoRead)
Construct a new PseudoDevice. |
|
| Method Summary | |
|---|---|
void |
freeze()
Does nothing. |
Robot |
getRobot()
Returns null. |
abstract void |
readStateFromPseudoDevice()
Reads the state of the Pseudo device. |
void |
readStateFromRobot()
This method just calls readStateFromPseudoDevice. |
void |
setRobot(Robot robot)
This method does nothing. |
| Methods inherited from class dlife.robot.Device |
|---|
createGUIObjects, getAutoRead, getGUI, getGUIUpdateDelay, getReadDelay, getSensorReadCount, getSensorReadRate, setAutoRead, setGUIUpdateDelay, setReadDelay, shutDown, startAutoReadTimer, startUp, stopAutoReadTimer |
| Methods inherited from class java.util.Observable |
|---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PseudoDevice(boolean autoRead)
autoRead - true to ensure that the AutoReadTimer is started, false
to ensure that it is not started.
public PseudoDevice(int readDelay,
int guiDelay,
boolean autoRead)
readDelay - the delay between calls to
readStateFromRobotguiDelay - autoRead - | Method Detail |
|---|
public final void setRobot(Robot robot)
setRobot in class Devicerobot - unusedpublic final Robot getRobot()
getRobot in class Devicepublic final void readStateFromRobot()
readStateFromPseudoDevice. This is
done purely for the semantic meaning of the names.
readStateFromRobot in class Devicepublic void freeze()
freeze in class Devicepublic abstract void readStateFromPseudoDevice()
setChanged method
if the state has changed.
|
dLife Home Page | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||