#include <encoder.h>
Public Member Functions | |
Encoder () | |
bool | getEnabled (int index) |
Checks if an encoder is powered on and receiving events. | |
int | getEncoderCount () |
Gets the number of encoder input channels supported by this board. | |
int | getIndexPosition (int index) |
Gets the position of an encoder the last time an index pulse occured. An index pulse in this context refers to an input from the encoder the pulses high once every revolution. | |
int | getInputCount () |
Gets the number of digital input channels supported by this board. | |
bool | getInputState (int index) |
Reads the current state of a digital input. | |
int | getPosition (int index) |
Reads the current position of an encoder. | |
void | setEnabled (int index, bool enabled) |
Set the powered state of an encoder. If an encoder is not enabled, it will not be given power, and events and changes in position will not be captured. | |
void | setPosition (int index, int position) |
Sets the offset of an encoder such that current position is the specified value. | |
Protected Member Functions | |
virtual void | indexHandler (int index, int indexPosition) |
virtual void | inputChangeHandler (int index, int inputState) |
virtual void | positionChangeHandler (int index, int time, int positionChange) |
Protected Attributes | |
CPhidgetEncoderHandle | encoder_handle_ |
Static Private Member Functions | |
static int | IndexHandler (CPhidgetEncoderHandle phid, void *userPtr, int index, int indexPosition) |
static int | InputChangeHandler (CPhidgetEncoderHandle phid, void *userPtr, int index, int inputState) |
static int | PositionChangeHandler (CPhidgetEncoderHandle phid, void *userPtr, int index, int time, int positionChange) |
Definition at line 8 of file encoder.cpp.
bool phidgets::Encoder::getEnabled | ( | int | index | ) |
Checks if an encoder is powered on and receiving events.
index | The index of the encoder to check |
Definition at line 87 of file encoder.cpp.
Gets the number of encoder input channels supported by this board.
Definition at line 47 of file encoder.cpp.
int phidgets::Encoder::getIndexPosition | ( | int | index | ) |
Gets the position of an encoder the last time an index pulse occured. An index pulse in this context refers to an input from the encoder the pulses high once every revolution.
index | The index of the encoder to read |
Definition at line 74 of file encoder.cpp.
int phidgets::Encoder::getInputCount | ( | ) |
Gets the number of digital input channels supported by this board.
Definition at line 27 of file encoder.cpp.
bool phidgets::Encoder::getInputState | ( | int | index | ) |
Reads the current state of a digital input.
index | The index of the input to read |
Definition at line 37 of file encoder.cpp.
int phidgets::Encoder::getPosition | ( | int | index | ) |
Reads the current position of an encoder.
index | The index of the encoder to read |
Definition at line 57 of file encoder.cpp.
void phidgets::Encoder::indexHandler | ( | int | index, |
int | indexPosition | ||
) | [protected, virtual] |
Definition at line 129 of file encoder.cpp.
int phidgets::Encoder::IndexHandler | ( | CPhidgetEncoderHandle | phid, |
void * | userPtr, | ||
int | index, | ||
int | indexPosition | ||
) | [static, private] |
Definition at line 114 of file encoder.cpp.
void phidgets::Encoder::inputChangeHandler | ( | int | index, |
int | inputState | ||
) | [protected, virtual] |
Definition at line 119 of file encoder.cpp.
int phidgets::Encoder::InputChangeHandler | ( | CPhidgetEncoderHandle | phid, |
void * | userPtr, | ||
int | index, | ||
int | inputState | ||
) | [static, private] |
Definition at line 104 of file encoder.cpp.
void phidgets::Encoder::positionChangeHandler | ( | int | index, |
int | time, | ||
int | positionChange | ||
) | [protected, virtual] |
Definition at line 124 of file encoder.cpp.
int phidgets::Encoder::PositionChangeHandler | ( | CPhidgetEncoderHandle | phid, |
void * | userPtr, | ||
int | index, | ||
int | time, | ||
int | positionChange | ||
) | [static, private] |
Definition at line 109 of file encoder.cpp.
void phidgets::Encoder::setEnabled | ( | int | index, |
bool | enabled | ||
) |
Set the powered state of an encoder. If an encoder is not enabled, it will not be given power, and events and changes in position will not be captured.
index | The index of the encoder to change |
enabled | The new powered state of the encoder |
Definition at line 97 of file encoder.cpp.
void phidgets::Encoder::setPosition | ( | int | index, |
int | position | ||
) |
Sets the offset of an encoder such that current position is the specified value.
index | The index of the encoder to set |
position | The new value that should be returned by 'getPosition(index)' at the current position of the encoder |
Definition at line 67 of file encoder.cpp.
CPhidgetEncoderHandle phidgets::Encoder::encoder_handle_ [protected] |