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

List of all members.

Public Member Functions

final void addBridgeDataListener (BridgeDataListener l)
 BridgePhidget () throws PhidgetException
native double getBridgeMax (int index) throws PhidgetException
native double getBridgeMin (int index) throws PhidgetException
native double getBridgeValue (int index) throws PhidgetException
native int getDataRate () throws PhidgetException
native int getDataRateMax () throws PhidgetException
native int getDataRateMin () throws PhidgetException
native boolean getEnabled (int index) throws PhidgetException
native int getGain (int index) throws PhidgetException
native int getInputCount () throws PhidgetException
final void removeBridgeDataListener (BridgeDataListener l)
native void setDataRate (int rate) throws PhidgetException
native void setEnabled (int index, boolean state) throws PhidgetException
native void setGain (int index, int gain) throws PhidgetException

Static Public Attributes

static final int PHIDGET_BRIDGE_GAIN_1 = 1
static final int PHIDGET_BRIDGE_GAIN_128 = 6
static final int PHIDGET_BRIDGE_GAIN_16 = 3
static final int PHIDGET_BRIDGE_GAIN_32 = 4
static final int PHIDGET_BRIDGE_GAIN_64 = 5
static final int PHIDGET_BRIDGE_GAIN_8 = 2
static final int PHIDGET_BRIDGE_GAIN_UNKNOWN = 7

Private Member Functions

native void enableBridgeDataEvents (boolean b)
final void enableDeviceSpecificEvents (boolean b)
void fireBridgeData (BridgeDataEvent e)

Static Private Member Functions

static native long create () throws PhidgetException

Private Attributes

LinkedList bridgeDataListeners = new LinkedList ()
long nativeBridgeDataHandler = 0

Detailed Description

This class represents a Phidget Bridge. All methods to manipulate the Phidget Bridge 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 BridgePhidget.java.


Constructor & Destructor Documentation

Definition at line 22 of file BridgePhidget.java.


Member Function Documentation

final void com.phidgets.BridgePhidget.addBridgeDataListener ( BridgeDataListener  l) [inline]

Adds a bridge data listener. The bridge data handler is a method that will be called at the specified data rate, for each enabled bridge. Value is the bridgeValue, in mV/V.

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

Parameters:
lAn implemetation of the BridgeDataListener interface

Definition at line 182 of file BridgePhidget.java.

static native long com.phidgets.BridgePhidget.create ( ) throws PhidgetException [static, private]
final void com.phidgets.BridgePhidget.enableDeviceSpecificEvents ( boolean  b) [inline, private]

Reimplemented from com.phidgets.Phidget.

Definition at line 171 of file BridgePhidget.java.

void com.phidgets.BridgePhidget.fireBridgeData ( BridgeDataEvent  e) [inline, private]

Definition at line 196 of file BridgePhidget.java.

native double com.phidgets.BridgePhidget.getBridgeMax ( int  index) throws PhidgetException

Returns the maximum value that the selected bridge can measure, in mV/V. This value will depend on the selected gain. At a gain of 1, BridgeMin == 1000 mV/V.

Parameters:
indexIndex of the bridge
Returns:
maximum 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.
native double com.phidgets.BridgePhidget.getBridgeMin ( int  index) throws PhidgetException

Returns the minimum value that the selected bridge can measure, in mV/V. This value will depend on the selected gain. At a gain of 1, BridgeMin == -1000 mV/V.

Parameters:
indexIndex of the bridge
Returns:
minimum 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.
native double com.phidgets.BridgePhidget.getBridgeValue ( int  index) throws PhidgetException

Returns the value of the selected input, in mV/V. If the input is not enabled, an EPHIDGET_UNKNOWNVAL exception will be thrown. If the bridge is saturated , this will be equal to BridgeMax or BridgeMin and an error event will be fired - in this case, gain should be reduced if possible.

Parameters:
indexIndex of the bridge
Returns:
bridge 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 data rate, in ms. Data rate applies to all 4 bridges simultaneously. Setting a slower data rate will reduce noise at the cost of sample time. Also note that each bridge is being sampled only 1/4 of the time - this is okay for very stable signals, but for changing signals, it is best to set a higher sampling rate and do averaging in the software.

Data rate must be a multiple of 8ms. Trying to set something between multiplies of 8 will cause an EPHIDGET_INVALIDARG exception.

Returns:
Data Rate
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 maximum supported data rate, in ms.

Returns:
maximum supported data rate
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached. See open for information on determining if a device is attached.

Gets the minimum supported data rate, in ms.

Returns:
minimum supported data rate
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached. See open for information on determining if a device is attached.
native boolean com.phidgets.BridgePhidget.getEnabled ( int  index) throws PhidgetException

Returns the enabled state of the specified bridge. This applies power between +5v and Ground, and starts measuring the differential on the +/- pins. By default, all bridges are disabled, and need to be explicitly enabled on startup.

Parameters:
indexIndex of the bridge
Returns:
state of the specified bridge
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 int com.phidgets.BridgePhidget.getGain ( int  index) throws PhidgetException

Returns the gain for the selected bridge. Note that increasing the gains will reduce the measurable voltage difference by the gain factor, with +-1000 mV/V being the maximum, with no gain. The possible values for gain are PHIDGET_BRIDGE_GAIN_1, PHIDGET_BRIDGE_GAIN_8, PHIDGET_BRIDGE_GAIN_16, PHIDGET_BRIDGE_GAIN_32, PHIDGET_BRIDGE_GAIN_64, PHIDGET_BRIDGE_GAIN_128, PHIDGET_BRIDGE_GAIN_UNKNOWN

Parameters:
indexIndex of the bridge
Returns:
gain
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 number of bridges.

Returns:
Number of bridges
final void com.phidgets.BridgePhidget.removeBridgeDataListener ( BridgeDataListener  l) [inline]

Definition at line 190 of file BridgePhidget.java.

Sets the data rate, in ms. Data rate applies to all 4 bridges simultaneously. Setting a slower data rate will reduce noise at the cost of sample time. Also note that each bridge is being sampled only 1/4 of the time - this is okay for very stable signals, but for changing signals, it is best to set a higher sampling rate and do averaging in the software.

Data rate must be a multiple of 8ms. Trying to set something between multiplies of 8 will cause an EPHIDGET_INVALIDARG exception.

Parameters:
ratenew data rate
Exceptions:
PhidgetExceptionIf this Phidget is not opened and attached, or if the data rate is out of range See open for information on determining if a device is attached.
native void com.phidgets.BridgePhidget.setEnabled ( int  index,
boolean  state 
) throws PhidgetException

Sets the enabled state of the specified bridge. This applies power between +5v and Ground, and starts measuring the differential on the +/- pins. By default, all bridges are disabled, and need to be explicitly enabled on startup.

Parameters:
indexIndex of the bridge
statenew state of the specified bridge
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.BridgePhidget.setGain ( int  index,
int  gain 
) throws PhidgetException

Sets the gain for the selected bridge. Note that increasing the gains will reduce the measurable voltage difference by the gain factor, with +-1000 mV/V being the maximum, with no gain.

The possible values for gain are PHIDGET_BRIDGE_GAIN_1, PHIDGET_BRIDGE_GAIN_8, PHIDGET_BRIDGE_GAIN_16, PHIDGET_BRIDGE_GAIN_32, PHIDGET_BRIDGE_GAIN_64, PHIDGET_BRIDGE_GAIN_128, PHIDGET_BRIDGE_GAIN_UNKNOWN

Parameters:
indexIndex of the bridge
gainnew gain
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.

Member Data Documentation

LinkedList com.phidgets.BridgePhidget.bridgeDataListeners = new LinkedList () [private]

Definition at line 188 of file BridgePhidget.java.

Definition at line 189 of file BridgePhidget.java.

1 Gain. This is used with getGain and setGain

Definition at line 30 of file BridgePhidget.java.

128 Gain. This is used with getGain and setGain

Definition at line 50 of file BridgePhidget.java.

16 Gain. This is used with getGain and setGain

Definition at line 38 of file BridgePhidget.java.

32 Gain. This is used with getGain and setGain

Definition at line 42 of file BridgePhidget.java.

64 Gain. This is used with getGain and setGain

Definition at line 46 of file BridgePhidget.java.

8 Gain. This is used with getGain and setGain

Definition at line 34 of file BridgePhidget.java.

Unknown Gain. This is used with getGain and setGain

Definition at line 54 of file BridgePhidget.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