|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.openuat.sensors.DeviceStateListener
public abstract class DeviceStateListener
This is a small helper class for checking the status of a device with multiple lines/time series based on the events fired by its SampleSource objects. A device is defined to be active when at least one of its lines is active. It calls the abstract functions toActive and toPassive when the device state changes, and forwards all samples via calls to addSample.
| Constructor Summary | |
|---|---|
DeviceStateListener(int numLines)
Constructs the device listener objects. |
|
| Method Summary | |
|---|---|
SamplesSink_Int[] |
getSinks_Int()
Returns an array of SampleSink_Int implementations that can be registered with the respective source of sample events. |
SamplesSink[] |
getSinks()
Returns an array of SampleSink implementations that can be registered with the respective source of sample events. |
void |
reset()
Resets the time series to the state as created when freshly constructing it (i.e. quiescent). |
protected abstract void |
sampleAdded(int lineIndex,
double sample,
int numSample)
This method will be called when a new sample is received. |
protected abstract void |
sampleAdded(int lineIndex,
int sample,
int numSample)
This method will be called when a new sample is received. |
protected abstract void |
toActive(int changedLineIndex,
int numSample)
This method will be called when the device was quiescent and became active with the last sample. |
protected abstract void |
toQuiescent(int changedLineIndex,
int numSample)
This method will be called when the device was active and became quiescent with the last sample. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DeviceStateListener(int numLines)
numLines - The number of lines/time series this device has.| Method Detail |
|---|
public SamplesSink[] getSinks()
public SamplesSink_Int[] getSinks_Int()
public void reset()
protected abstract void toActive(int changedLineIndex,
int numSample)
changedLineIndex - The line/time series index that caused the change from
quiescent to active, i.e. the first line/time series index
that became active.numSample - The number of the sample within the time series that caused the
state change.
protected abstract void toQuiescent(int changedLineIndex,
int numSample)
changedLineIndex - The line/time series index that caused the change from
active to quiescent, i.e. the last line/time series index
that became quiescent.numSample - The number of the sample within the time series that caused the
state change.
protected abstract void sampleAdded(int lineIndex,
double sample,
int numSample)
lineIndex - The line/time series that received the sample.sample - The sample value.numSample - The number of the sample within the time series.
protected abstract void sampleAdded(int lineIndex,
int sample,
int numSample)
lineIndex - The line/time series that received the sample.sample - The sample value.numSample - The number of the sample within the time series.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||