#include <encoder.h>
|
| Encoder (int32_t serial_number, int hub_port, bool is_hub_port_device, int channel, std::function< void(int, int, double, int)> position_change_handler) |
|
uint32_t | getDataInterval () const |
|
bool | getEnabled () const |
| Checks if an encoder is powered on and receiving events. More...
|
|
int64_t | getIndexPosition () const |
| 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. More...
|
|
Phidget_EncoderIOMode | getIOMode () const |
|
int64_t | getPosition () const |
| Reads the current position of an encoder. More...
|
|
void | positionChangeHandler (int position_change, double time, int index_triggered) |
|
void | setDataInterval (uint32_t data_interval_ms) const |
|
void | setEnabled (bool enabled) const |
| 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. More...
|
|
void | setIOMode (Phidget_EncoderIOMode io_mode) const |
|
void | setPosition (int64_t position) const |
| Sets the offset of an encoder such that current position is the specified value. More...
|
|
| ~Encoder () |
|
|
static void | PositionChangeHandler (PhidgetEncoderHandle phid, void *ctx, int position_change, double time_change, int index_triggered) |
|
Definition at line 41 of file encoder.h.
◆ Encoder()
phidgets::Encoder::Encoder |
( |
int32_t |
serial_number, |
|
|
int |
hub_port, |
|
|
bool |
is_hub_port_device, |
|
|
int |
channel, |
|
|
std::function< void(int, int, double, int)> |
position_change_handler |
|
) |
| |
|
explicit |
◆ ~Encoder()
phidgets::Encoder::~Encoder |
( |
| ) |
|
◆ getDataInterval()
uint32_t phidgets::Encoder::getDataInterval |
( |
| ) |
const |
◆ getEnabled()
bool phidgets::Encoder::getEnabled |
( |
| ) |
const |
Checks if an encoder is powered on and receiving events.
Definition at line 115 of file encoder.cpp.
◆ getIndexPosition()
int64_t phidgets::Encoder::getIndexPosition |
( |
| ) |
const |
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.
Definition at line 99 of file encoder.cpp.
◆ getIOMode()
Phidget_EncoderIOMode phidgets::Encoder::getIOMode |
( |
| ) |
const |
◆ getPosition()
int64_t phidgets::Encoder::getPosition |
( |
| ) |
const |
Reads the current position of an encoder.
Definition at line 72 of file encoder.cpp.
◆ positionChangeHandler()
void phidgets::Encoder::positionChangeHandler |
( |
int |
position_change, |
|
|
double |
time, |
|
|
int |
index_triggered |
|
) |
| |
◆ PositionChangeHandler()
void phidgets::Encoder::PositionChangeHandler |
( |
PhidgetEncoderHandle |
phid, |
|
|
void * |
ctx, |
|
|
int |
position_change, |
|
|
double |
time_change, |
|
|
int |
index_triggered |
|
) |
| |
|
staticprivate |
◆ setDataInterval()
void phidgets::Encoder::setDataInterval |
( |
uint32_t |
data_interval_ms | ) |
const |
◆ setEnabled()
void phidgets::Encoder::setEnabled |
( |
bool |
enabled | ) |
const |
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.
- Parameters
-
enabled | The new powered state of the encoder |
Definition at line 130 of file encoder.cpp.
◆ setIOMode()
void phidgets::Encoder::setIOMode |
( |
Phidget_EncoderIOMode |
io_mode | ) |
const |
◆ setPosition()
void phidgets::Encoder::setPosition |
( |
int64_t |
position | ) |
const |
Sets the offset of an encoder such that current position is the specified value.
- Parameters
-
position | The new value that should be returned by 'getPosition(index)' at the current position of the encoder |
Definition at line 87 of file encoder.cpp.
◆ channel_
int phidgets::Encoder::channel_ |
|
private |
◆ encoder_handle_
PhidgetEncoderHandle phidgets::Encoder::encoder_handle_ |
|
private |
◆ position_change_handler_
std::function<void(int, int, double, int)> phidgets::Encoder::position_change_handler_ |
|
private |
The documentation for this class was generated from the following files: