|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.phidgets.Phidget
com.phidgets.BridgePhidget
This class represents a Phidget Bridge. All methods to manipulate the Phidget Bridge are implemented in this class.
Field Summary | |
static int |
PHIDGET_BRIDGE_GAIN_1
1 Gain. |
static int |
PHIDGET_BRIDGE_GAIN_128
128 Gain. |
static int |
PHIDGET_BRIDGE_GAIN_16
16 Gain. |
static int |
PHIDGET_BRIDGE_GAIN_32
32 Gain. |
static int |
PHIDGET_BRIDGE_GAIN_64
64 Gain. |
static int |
PHIDGET_BRIDGE_GAIN_8
8 Gain. |
static int |
PHIDGET_BRIDGE_GAIN_UNKNOWN
Unknown Gain. |
Constructor Summary | |
BridgePhidget()
|
Method Summary | |
void |
addBridgeDataListener(BridgeDataListener l)
Adds a bridge data listener. |
double |
getBridgeMax(int index)
Returns the maximum value that the selected bridge can measure, in mV/V. |
double |
getBridgeMin(int index)
Returns the minimum value that the selected bridge can measure, in mV/V. |
double |
getBridgeValue(int index)
Returns the value of the selected input, in mV/V. |
int |
getDataRate()
Returns the data rate, in ms. |
int |
getDataRateMax()
Gets the maximum supported data rate, in ms. |
int |
getDataRateMin()
Gets the minimum supported data rate, in ms. |
boolean |
getEnabled(int index)
Returns the enabled state of the specified bridge. |
int |
getGain(int index)
Returns the gain for the selected bridge. |
int |
getInputCount()
Returns the number of bridges. |
void |
removeBridgeDataListener(BridgeDataListener l)
|
void |
setDataRate(int rate)
Sets the data rate, in ms. |
void |
setEnabled(int index,
boolean state)
Sets the enabled state of the specified bridge. |
void |
setGain(int index,
int gain)
Sets the gain for the selected bridge. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int PHIDGET_BRIDGE_GAIN_1
getGain
and setGain
public static final int PHIDGET_BRIDGE_GAIN_8
getGain
and setGain
public static final int PHIDGET_BRIDGE_GAIN_16
getGain
and setGain
public static final int PHIDGET_BRIDGE_GAIN_32
getGain
and setGain
public static final int PHIDGET_BRIDGE_GAIN_64
getGain
and setGain
public static final int PHIDGET_BRIDGE_GAIN_128
getGain
and setGain
public static final int PHIDGET_BRIDGE_GAIN_UNKNOWN
getGain
and setGain
Constructor Detail |
public BridgePhidget() throws PhidgetException
Method Detail |
public int getInputCount() throws PhidgetException
PhidgetException
public double getBridgeValue(int index) throws PhidgetException
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.public double getBridgeMin(int index) throws PhidgetException
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.public double getBridgeMax(int index) throws PhidgetException
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.public boolean getEnabled(int index) throws PhidgetException
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.public void setEnabled(int index, boolean state) throws PhidgetException
index
- Index of the bridgestate
- 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.public int getGain(int index) throws PhidgetException
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.public void setGain(int index, int gain) throws PhidgetException
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 bridgegain
- 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.public int getDataRate() throws PhidgetException
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.public void setDataRate(int rate) throws PhidgetException
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.public int getDataRateMin() throws PhidgetException
PhidgetException
- If this Phidget is not opened and attached.
See open
for information on determining if a device is attached.public int getDataRateMax() throws PhidgetException
PhidgetException
- If this Phidget is not opened and attached.
See open
for information on determining if a device is attached.public final void addBridgeDataListener(BridgeDataListener l)
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
interfacepublic final void removeBridgeDataListener(BridgeDataListener l)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |