|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcat.sensor.core.Sensor
cat.sensor.soft.AndSensor
This is a Soft Sensor. It is a sensor/service which takes input from real physical sensors, and does some manipulation with the data before passing it on as new sensor data. This soft sensor listens to light and sound sensors, and if sound is above 40dB and light is more than 50%, then true is output.
Field Summary | |
private java.util.Vector |
eventsQueue
The queue of incoming sensor data. |
private boolean[] |
state
An array of the most current sensor data from the sensors that this soft sensor listens to. |
Fields inherited from class cat.sensor.core.Sensor |
|
Constructor Summary | |
AndSensor(java.lang.String id)
This constructor sets the id of this sensor, and then starts the thread to process any incoming sensor data that this sensor listens to. |
Method Summary | |
void |
run()
Checks for any new sensor data and processes it to create new sensor data which this sensor outputs. |
void |
update(java.lang.Object event)
Being an Observer, we must implement this method to get sensor events from those that we observe. |
Methods inherited from class cat.sensor.core.Sensor |
addSensorListener, countSensorListeners, deleteSensorListener, deleteSensorListeners, getID, getSensorType, isRemote, notifySensorListeners, setID, setRemote, setSensorType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private boolean[] state
private java.util.Vector eventsQueue
Constructor Detail |
public AndSensor(java.lang.String id)
id
- The unique id of this sensor.Method Detail |
public void run()
run
in interface java.lang.Runnable
public void update(java.lang.Object event)
update
in interface SensorListener
event
- The incoming sensor event.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |