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 |
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.
Definition at line 20 of file BridgePhidget.java.
com.phidgets.BridgePhidget.BridgePhidget | ( | ) | throws PhidgetException [inline] |
Definition at line 22 of file BridgePhidget.java.
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.
l | An implemetation of the BridgeDataListener interface |
Definition at line 182 of file BridgePhidget.java.
static native long com.phidgets.BridgePhidget.create | ( | ) | throws PhidgetException [static, private] |
native void com.phidgets.BridgePhidget.enableBridgeDataEvents | ( | boolean | b | ) | [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.
index | Index of the bridge |
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. |
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.
index | Index of the bridge |
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. |
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.
index | Index of the bridge |
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. |
native int com.phidgets.BridgePhidget.getDataRate | ( | ) | throws PhidgetException |
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.
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. |
native int com.phidgets.BridgePhidget.getDataRateMax | ( | ) | throws PhidgetException |
Gets the maximum supported data rate, in ms.
PhidgetException | If this Phidget is not opened and attached. See open for information on determining if a device is attached. |
native int com.phidgets.BridgePhidget.getDataRateMin | ( | ) | throws PhidgetException |
Gets the minimum supported data rate, in ms.
PhidgetException | If 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.
index | Index of the bridge |
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. |
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
index | Index of the bridge |
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. |
native int com.phidgets.BridgePhidget.getInputCount | ( | ) | throws PhidgetException |
Returns the number of bridges.
final void com.phidgets.BridgePhidget.removeBridgeDataListener | ( | BridgeDataListener | l | ) | [inline] |
Definition at line 190 of file BridgePhidget.java.
native void com.phidgets.BridgePhidget.setDataRate | ( | int | rate | ) | throws PhidgetException |
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.
rate | new data rate |
PhidgetException | If 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.
index | Index of the bridge |
state | new state of the specified bridge |
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. |
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
index | Index of the bridge |
gain | new gain |
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. |
LinkedList com.phidgets.BridgePhidget.bridgeDataListeners = new LinkedList () [private] |
Definition at line 188 of file BridgePhidget.java.
long com.phidgets.BridgePhidget.nativeBridgeDataHandler = 0 [private] |
Definition at line 189 of file BridgePhidget.java.
final int com.phidgets.BridgePhidget.PHIDGET_BRIDGE_GAIN_1 = 1 [static] |
1 Gain. This is used with getGain and setGain
Definition at line 30 of file BridgePhidget.java.
final int com.phidgets.BridgePhidget.PHIDGET_BRIDGE_GAIN_128 = 6 [static] |
128 Gain. This is used with getGain and setGain
Definition at line 50 of file BridgePhidget.java.
final int com.phidgets.BridgePhidget.PHIDGET_BRIDGE_GAIN_16 = 3 [static] |
16 Gain. This is used with getGain and setGain
Definition at line 38 of file BridgePhidget.java.
final int com.phidgets.BridgePhidget.PHIDGET_BRIDGE_GAIN_32 = 4 [static] |
32 Gain. This is used with getGain and setGain
Definition at line 42 of file BridgePhidget.java.
final int com.phidgets.BridgePhidget.PHIDGET_BRIDGE_GAIN_64 = 5 [static] |
64 Gain. This is used with getGain and setGain
Definition at line 46 of file BridgePhidget.java.
final int com.phidgets.BridgePhidget.PHIDGET_BRIDGE_GAIN_8 = 2 [static] |
8 Gain. This is used with getGain and setGain
Definition at line 34 of file BridgePhidget.java.
final int com.phidgets.BridgePhidget.PHIDGET_BRIDGE_GAIN_UNKNOWN = 7 [static] |
Unknown Gain. This is used with getGain and setGain
Definition at line 54 of file BridgePhidget.java.