|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.phidgets.Phidget
com.phidgets.FrequencyCounterPhidget
This class represents a Phidget Frequency Counter. All methods to read manipulate the Phidget Frequency Counter are implemented in this class.
| Field Summary | |
static int |
PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_LOGIC_LEVEL
Logic-Level Filter Type. |
static int |
PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_UNKNOWN
Unknown Filter Type. |
static int |
PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_ZERO_CROSSING
Zero-Crossing Filter Type. |
| Constructor Summary | |
FrequencyCounterPhidget()
|
|
| Method Summary | |
void |
addFrequencyCounterCountListener(FrequencyCounterCountListener l)
Adds a count listener. |
boolean |
getEnabled(int index)
Returns the enabled state on the specified channel. |
int |
getFilter(int index)
Gets the channel filter mode. |
double |
getFrequency(int index)
Returns the last calcualted frequency on the specified channel, in Hz. |
int |
getFrequencyInputCount()
Returns the number of channels. |
int |
getTimeout(int index)
Returns the timeout value, in microseconds. |
long |
getTotalCount(int index)
Returns the total number of pulses detected on the specified channel since the Phidget was opened, or since the last reset. |
long |
getTotalTime(int index)
Returns the total elapsed tiem since Phidget was opened, or since the last reset, in microseconds. |
void |
removeFrequencyCounterCountListener(FrequencyCounterCountListener l)
|
void |
reset(int index)
Resets the getTotalCount and getTotalTime counters to 0 for the specified channel. |
void |
setEnabled(int index,
boolean state)
Gets the enabled state on the specified channel. |
void |
setFilter(int index,
int type)
Sets the channel filter mode. |
void |
setTimeout(int index,
int timeout)
Sets the timeout value, in microseconds. |
| Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_ZERO_CROSSING
getFilter and setFilter
public static final int PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_LOGIC_LEVEL
getFilter and setFilter
public static final int PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_UNKNOWN
getFilter and setFilter
| Constructor Detail |
public FrequencyCounterPhidget()
throws PhidgetException
| Method Detail |
public int getFrequencyInputCount()
throws PhidgetException
PhidgetException
public double getFrequency(int index)
throws PhidgetException
getTimeout value elapses without detecting a signal.
Frequency is recalculated up to 31.25 times a second, depending on the pulse rate.
index - Index of the channel
PhidgetException - If this Phidget is not opened and attached, or if the index is out of range.
See open for information on determining if a device is attached.
public long getTotalCount(int index)
throws PhidgetException
index - Index of the channel
PhidgetException - If this Phidget is not opened and attached, or if the index is out of range.
See open for information on determining if a device is attached.
public long getTotalTime(int index)
throws PhidgetException
getTotalCount property.
index - Index of the channel
PhidgetException - If this Phidget is not opened and attached, or if the index is out of range.
See open for information on determining if a device is attached.
public int getTimeout(int index)
throws PhidgetException
index - Index of the channel
PhidgetException - If this Phidget is not opened and attached, or if the index is out of range.
See open for information on determining if a device is attached.
public void setTimeout(int index,
int timeout)
throws PhidgetException
index - Index of the channeltimeout - new timeout value
PhidgetException - If this Phidget is not opened and attached, the index is out of range or the the timeout value is out of range.
See open for information on determining if a device is attached.
public boolean getEnabled(int index)
throws PhidgetException
index - Index of the channel
PhidgetException - If this Phidget is not opened and attached, or if the index is invalid.
See open for information on determining if a device is attached.
public void setEnabled(int index,
boolean state)
throws PhidgetException
index - Index of the channelstate - new enabled state
PhidgetException - If this Phidget is not opened and attached, or if the index is invalid.
See open for information on determining if a device is attached.
public int getFilter(int index)
throws PhidgetException
The possible values for type are PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_ZERO_CROSSING,
PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_LOGIC_LEVEL, PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_UNKNOWN
index - Index of the channel
PhidgetException - If this Phidget is not opened and attached, or if the index is invalid.
See open for information on determining if a device is attached.
public void setFilter(int index,
int type)
throws PhidgetException
The possible values for type are PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_ZERO_CROSSING,
PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_LOGIC_LEVEL, PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_UNKNOWN
index - Index of the channeltype - new filter type
PhidgetException - If this Phidget is not opened and attached, or if the index is invalid.
See open for information on determining if a device is attached.
public void reset(int index)
throws PhidgetException
getTotalCount and getTotalTime counters to 0 for the specified channel. For best performance, this should be called when the channel is disabled.
index - Index of the channel
PhidgetException - If this Phidget is not opened and attached, or if the index is invalid.
See open for information on determining if a device is attached.public final void addFrequencyCounterCountListener(FrequencyCounterCountListener l)
There is no limit on the number of count handlers that can be registered for a particular Phidget.
l - An implemetation of the FrequencyCounterCountListener interfacepublic final void removeFrequencyCounterCountListener(FrequencyCounterCountListener l)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||