com.gatespace.service.adc
Interface Channel

All Known Implementing Classes:
ChannelImpl

public interface Channel

Hold current status of one A/D channel. Clients interested in changes on channel values should register as ChannelListeners using the addChannelListener() method.


Method Summary
 void addChannelListener(ChannelListener l)
          Add a listener to this channel.
 int getChannelNo()
          Get channel number.
 int getMode()
          Get measurement mode of channel.
 double getNormalizedValue()
          Get last normalized value read from channel.
 int getRawValue()
          Get last raw value read from channel.
 int getResolution()
          Get resolution of channel.
 int getSampleCount()
          Get oversample count of channel.
 boolean isActive()
          Get activation status.
 boolean read()
          Read a new value from channel.
 void removeChannelListener(ChannelListener l)
          Remove a listener to this channel.
 void setActive(boolean b)
          Set activation status.
 void setMode(int mode)
          Set measurement mode of channel.
 void setResolution(int resolution)
          Set resolution of channel.
 void setSampleCount(int count)
          Set oversample count of channel.
 

Method Detail

getChannelNo

public int getChannelNo()
Get channel number. Note: channels are numbered from zero and upwards.

isActive

public boolean isActive()
Get activation status.
Returns:
true if channel is automatically polled, false otherwise

setActive

public void setActive(boolean b)
Set activation status.
Parameters:
b - true if channel is to be automatically polled, false otherwise

getMode

public int getMode()
Get measurement mode of channel.

getResolution

public int getResolution()
Get resolution of channel.

setMode

public void setMode(int mode)
Set measurement mode of channel.

setResolution

public void setResolution(int resolution)
Set resolution of channel.

getRawValue

public int getRawValue()
Get last raw value read from channel.

getNormalizedValue

public double getNormalizedValue()
Get last normalized value read from channel.
Returns:
value between 0 and 1

read

public boolean read()
             throws java.io.IOException
Read a new value from channel.
Returns:
true if a new value (compared to the last read()) is found.

addChannelListener

public void addChannelListener(ChannelListener l)
Add a listener to this channel.

removeChannelListener

public void removeChannelListener(ChannelListener l)
Remove a listener to this channel.

getSampleCount

public int getSampleCount()
Get oversample count of channel. Each channel may b e sampled more than one time for each read() to overcome problems with jittery input.

setSampleCount

public void setSampleCount(int count)
Set oversample count of channel.