|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcat.sensor.core.SensorManager
This CAT manager sets up and controls all sensors in CAT. It inits all the basic sensors, and provides tools for adding/removing and finding sensors.
Field Summary | |
private java.util.Vector |
appList
list of applications that want to know if a sensor has been added or removed the members MUST implement SensorListener. |
private java.util.Vector |
senList
List of sensors that want notifications from this manager. |
private SocketReceiver |
sr
This object is used for connecting sensor proxies to simulator. |
private java.util.HashMap |
table
Contains all sensors and their ids |
Constructor Summary | |
SensorManager()
This constructor inits the manager by calling init. |
Method Summary | |
void |
addLeafSensor(java.lang.String id,
LeafSensor sensor)
This method is for adding a LeafSensor into CAT. |
void |
addLeafSensor(java.lang.String id,
LeafSensor sensor,
SensorProxy sp1)
This method is for adding a LeafSensor into CAT. |
void |
addSensor(java.lang.String id,
Sensor sensor)
This method is for adding a SoftSensor into CAT. |
void |
addSensorListener(SensorListener s)
This method adds a listener to this manager. |
void |
deleteSensorListener(SensorListener s)
This method removes a listener to this manager. |
Sensor[] |
getAllSensors()
Returns an array of all the sensors that this Manager has (which is all sensors in CAT). |
Sensor |
getSensor(java.lang.String id)
Returns the sensor which has the desired id. |
void |
init()
This method creates and adds as many basic LeafSensors as it can to CAT. |
void |
notifySensorListeners(java.lang.Object event)
This method notifies all listeners of a Sensor data event that this manager observes. |
Sensor |
removeSensor(java.lang.String id)
This method is for removing the Sensor with the given id. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private java.util.HashMap table
private java.util.Vector appList
private java.util.Vector senList
private SocketReceiver sr
Constructor Detail |
public SensorManager()
Method Detail |
public void init()
public Sensor[] getAllSensors()
public Sensor getSensor(java.lang.String id)
public void addSensor(java.lang.String id, Sensor sensor)
id
- The sensor's id.sensor
- The soft sensor to add.public void addLeafSensor(java.lang.String id, LeafSensor sensor)
id
- The sensor's id.sensor
- The leaf sensor to add.public void addLeafSensor(java.lang.String id, LeafSensor sensor, SensorProxy sp1)
id
- The sensor's id.sensor
- The leaf sensor to add.sp1
- The proxy for the sensor to use to get data.public Sensor removeSensor(java.lang.String id)
id
- The sensor's id.public void addSensorListener(SensorListener s)
s
- listener.public void deleteSensorListener(SensorListener s)
s
- listener.public void notifySensorListeners(java.lang.Object event)
event
- Sesnor data event.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |