Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes
com.phidgets.FrequencyCounterPhidget Class Reference
Inheritance diagram for com.phidgets.FrequencyCounterPhidget:
Inheritance graph
[legend]

List of all members.

Public Member Functions

final void addFrequencyCounterCountListener (FrequencyCounterCountListener l)
 FrequencyCounterPhidget () throws PhidgetException
native boolean getEnabled (int index) throws PhidgetException
native int getFilter (int index) throws PhidgetException
native double getFrequency (int index) throws PhidgetException
native int getFrequencyInputCount () throws PhidgetException
native int getTimeout (int index) throws PhidgetException
native long getTotalCount (int index) throws PhidgetException
native long getTotalTime (int index) throws PhidgetException
final void removeFrequencyCounterCountListener (FrequencyCounterCountListener l)
native void reset (int index) throws PhidgetException
native void setEnabled (int index, boolean state) throws PhidgetException
native void setFilter (int index, int type) throws PhidgetException
native void setTimeout (int index, int timeout) throws PhidgetException

Static Public Attributes

static final int PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_LOGIC_LEVEL = 2
static final int PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_UNKNOWN = 3
static final int PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_ZERO_CROSSING = 1

Private Member Functions

final void enableDeviceSpecificEvents (boolean b)
native void enableFrequencyCounterCountEvents (boolean b)
void fireFrequencyCounterCount (FrequencyCounterCountEvent e)

Static Private Member Functions

static native long create () throws PhidgetException

Private Attributes

LinkedList frequencyCounterCountListeners = new LinkedList ()
long nativeFrequencyCounterCountHandler = 0

Detailed Description

This class represents a Phidget Frequency Counter. All methods to read manipulate the Phidget Frequency Counter are implemented in this class. See your device's User Guide for more specific API details, technical information, and revision details. The User Guide, along with other resources, can be found on the product page for your device.

Author:
Phidgets Inc.

Definition at line 20 of file FrequencyCounterPhidget.java.


Constructor & Destructor Documentation

Definition at line 22 of file FrequencyCounterPhidget.java.


Member Function Documentation

final void com.phidgets.FrequencyCounterPhidget.addFrequencyCounterCountListener ( FrequencyCounterCountListener  l) [inline]

Adds a count listener. The count handler is a method that will be called whenever some counts have been detected. This event will fire up to 31.25 times a second, depending on the pulse rate. The time is in microseconds and represents the amount of time in which the number of counts occured. This event can be used to calculate frequency independently of the phidget21 library frequency implementation. This event will fire with a count of 0 once, after the Timeout time has elapsed with no counts for a channel, to indicate 0 Hz.

There is no limit on the number of count handlers that can be registered for a particular Phidget.

Parameters:
lAn implemetation of the FrequencyCounterCountListener interface

Definition at line 151 of file FrequencyCounterPhidget.java.

static native long com.phidgets.FrequencyCounterPhidget.create ( ) throws PhidgetException [static, private]

Reimplemented from com.phidgets.Phidget.

Definition at line 137 of file FrequencyCounterPhidget.java.

void com.phidgets.FrequencyCounterPhidget.fireFrequencyCounterCount ( FrequencyCounterCountEvent  e) [inline, private]

Definition at line 165 of file FrequencyCounterPhidget.java.

Returns the enabled state on the specified channel. When the channel is disabled, it will no longer register counts. TotalTime and TotalCount properties will not be incremented until the channel is re-enabled.

Parameters:
indexIndex of the channel
Returns:
state
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is invalid. See open for information on determining if a device is attached.

Gets the channel filter mode. This controls the type of signal that the Frequency Counter will respond to - either a zero-centered or a logic-level signal.

The possible values for type are PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_ZERO_CROSSING, PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_LOGIC_LEVEL, PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_UNKNOWN

Parameters:
indexIndex of the channel
Returns:
filter type
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is invalid. See open for information on determining if a device is attached.

Returns the last calcualted frequency on the specified channel, in Hz. This function will return 0 if the getTimeout value elapses without detecting a signal. Frequency is recalculated up to 31.25 times a second, depending on the pulse rate.

Parameters:
indexIndex of the channel
Returns:
frequency of the channel
Exceptions:
PhidgetExceptionIf 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.

Returns the number of channels.

Returns:
Number of inputs

Returns the timeout value, in microseconds. This value is used to set the time to wait without detecting a signal before reporting 0 Hz. The valid range is 0.1 - 100 seconds(100,000 - 100,000,000 microseconds). 0.1 timeout represents the lowest frequency that will be measurable.

Parameters:
indexIndex of the channel
Returns:
timeout value
Exceptions:
PhidgetExceptionIf 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.

Returns the total number of pulses detected on the specified channel since the Phidget was opened, or since the last reset.

Parameters:
indexIndex of the channel
Returns:
total number of pulses
Exceptions:
PhidgetExceptionIf 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.

Returns the total elapsed tiem since Phidget was opened, or since the last reset, in microseconds. This time corresponds to the getTotalCount property.

Parameters:
indexIndex of the channel
Returns:
total time, in microseconds
Exceptions:
PhidgetExceptionIf 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.
final void com.phidgets.FrequencyCounterPhidget.removeFrequencyCounterCountListener ( FrequencyCounterCountListener  l) [inline]

Definition at line 159 of file FrequencyCounterPhidget.java.

Resets the getTotalCount and getTotalTime counters to 0 for the specified channel. For best performance, this should be called when the channel is disabled.

Parameters:
indexIndex of the channel
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is invalid. See open for information on determining if a device is attached.
native void com.phidgets.FrequencyCounterPhidget.setEnabled ( int  index,
boolean  state 
) throws PhidgetException

Gets the enabled state on the specified channel. When the channel is disabled, it will no longer register counts. TotalTime and TotalCount properties will not be incremented until the channel is re-enabled.

Parameters:
indexIndex of the channel
statenew enabled state
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is invalid. See open for information on determining if a device is attached.
native void com.phidgets.FrequencyCounterPhidget.setFilter ( int  index,
int  type 
) throws PhidgetException

Sets the channel filter mode. This controls the type of signal that the Frequency Counter will respond to - either a zero-centered or a logic-level signal.

The possible values for type are PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_ZERO_CROSSING, PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_LOGIC_LEVEL, PHIDGET_FREQUENCYCOUNTER_FILTERTYPE_UNKNOWN

Parameters:
indexIndex of the channel
typenew filter type
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the index is invalid. See open for information on determining if a device is attached.
native void com.phidgets.FrequencyCounterPhidget.setTimeout ( int  index,
int  timeout 
) throws PhidgetException

Sets the timeout value, in microseconds. This value is used to set the time to wait without detecting a signal before reporting 0 Hz. The valid range is 0.1 - 100 seconds(100,000 - 100,000,000 microseconds). 0.1 timeout represents the lowest frequency that will be measurable.

Parameters:
indexIndex of the channel
timeoutnew timeout value
Exceptions:
PhidgetExceptionIf 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.

Member Data Documentation

Definition at line 157 of file FrequencyCounterPhidget.java.

Definition at line 158 of file FrequencyCounterPhidget.java.

Logic-Level Filter Type. This is used with getFilter and setFilter

Definition at line 34 of file FrequencyCounterPhidget.java.

Unknown Filter Type. This is used with getFilter and setFilter

Definition at line 38 of file FrequencyCounterPhidget.java.

Zero-Crossing Filter Type. This is used with getFilter and setFilter

Definition at line 30 of file FrequencyCounterPhidget.java.


The documentation for this class was generated from the following file:


pedal_monitor
Author(s): Pedro Mendes
autogenerated on Fri Jun 6 2014 18:37:22