cat.sig
Class SensorMonitor

java.lang.Object
  extended bycat.sig.SensorMonitor
All Implemented Interfaces:
java.lang.Runnable, SensorListener

public class SensorMonitor
extends java.lang.Object
implements SensorListener

This class is a tool used by SigManager. It listens to all sensors in CAT, so that the sensor data can be shared to SIGs if there are any. Sensor data is given to the SigManager who can distribute it to the SIGs.


Field Summary
private  java.util.Vector eventQueue
          Contains unprocessed sensor events.
private  SigManager parent
          The manager which we give sensor data to.
 
Constructor Summary
SensorMonitor(SigManager manager)
          This constructor initializes the monitor by setting the SigManager, and starting the thread to process Sensor events.
 
Method Summary
 void run()
          This method loops through any and all sensor events that this class listens to.
 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parent

private SigManager parent
The manager which we give sensor data to.


eventQueue

private java.util.Vector eventQueue
Contains unprocessed sensor events.

Constructor Detail

SensorMonitor

public SensorMonitor(SigManager manager)
This constructor initializes the monitor by setting the SigManager, and starting the thread to process Sensor events.

Parameters:
manager - The manager who will get the sensor data and share it.
Method Detail

run

public void run()
This method loops through any and all sensor events that this class listens to. It extracts the sensor data and gives it to the SigManager to be distributed to the SIGs.

Specified by:
run in interface java.lang.Runnable

update

public void update(java.lang.Object event)
Being an Observer, we must implement this method to get sensor events from those that we observe.

Specified by:
update in interface SensorListener
Parameters:
event - The incoming sensor event.