|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.phidgets.Phidget
com.phidgets.EncoderPhidget
This class represents a Phidget Encoder. All methods to read encoder data from an encoder are implemented in this class.
Phidget Encoder boards generally support 1 or more encoders with 0 or more digital inputs. Both high speed optical and low speed mechanical encoders are supported with this API.
Field Summary |
Constructor Summary | |
EncoderPhidget()
|
Method Summary | |
void |
addEncoderPositionChangeListener(EncoderPositionChangeListener l)
Adds a position change listener. |
void |
addInputChangeListener(InputChangeListener l)
Adds an input change listener. |
boolean |
getEnabled(int index)
Returns the enabled state of an encoder. |
int |
getEncoderCount()
Returns number of encoders. |
int |
getEncoderPosition(int index)
Deprecated. Replaced by getPosition(int) |
int |
getIndexPosition(int index)
Returns the last index position of an encoder. |
int |
getInputCount()
Returns number of digital inputs. |
boolean |
getInputState(int index)
Returns the state of a digital input. |
int |
getPosition(int index)
Returns the position of an encoder. |
void |
removeEncoderPositionChangeListener(EncoderPositionChangeListener l)
|
void |
removeInputChangeListener(InputChangeListener l)
|
void |
setEnabled(int index,
boolean state)
Sets the enabled state of an encoder. |
void |
setEncoderPosition(int index,
int position)
Deprecated. Replaced by setPosition(int, int) |
void |
setPosition(int index,
int position)
Sets the position of a specific encoder. |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public EncoderPhidget() throws PhidgetException
Method Detail |
public int getEncoderCount() throws PhidgetException
PhidgetException
- If this Phidget is not opened and attached.
See open
for information on determining if a device is attached.public int getInputCount() throws PhidgetException
PhidgetException
- If this Phidget is not opened and attached.
See open
for information on determining if a device is attached.public int getPosition(int index) throws PhidgetException
setEncoderPosition
.
index
- index of the encoder
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 getIndexPosition(int index) throws PhidgetException
index
- index of the encoder
PhidgetException
- If this Phidget is not opened and attached, if the index is out of range, of if index is not supported.
See open
for information on determining if a device is attached.public int getEncoderPosition(int index) throws PhidgetException
getPosition(int)
PhidgetException
public void setPosition(int index, int position) throws PhidgetException
getEncoderPosition(int)
.
index
- index of the encoderposition
- new position for this encoder.
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 setEncoderPosition(int index, int position) throws PhidgetException
setPosition(int, int)
PhidgetException
public boolean getInputState(int index) throws PhidgetException
index
- index of the input
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 encoder
PhidgetException
- If this Phidget is not opened and attached, the index is out of range, or enable is not supported.
See open
for information on determining if a device is attached.public void setEnabled(int index, boolean state) throws PhidgetException
index
- index of the encoderstate
- desired state
PhidgetException
- If this Phidget is not opened and attached, the index is out of range, or enable is not supported.
See open
for information on determining if a device is attached.public final void addEncoderPositionChangeListener(EncoderPositionChangeListener l)
getEncoderPosition(int)
.
There is no limit on the number of position change handlers that can be registered for a particular Phidget.
l
- An implemetation of the EncoderPositionChangeListener
interfacepublic final void removeEncoderPositionChangeListener(EncoderPositionChangeListener l)
public final void addInputChangeListener(InputChangeListener l)
There is no limit on the number of input change handlers that can be registered for a particular Phidget.
l
- An implemetation of the InputChangeListener
interfacepublic final void removeInputChangeListener(InputChangeListener l)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |