Public Member Functions | Protected Member Functions | Protected Attributes | Static Private Member Functions
phidgets::Encoder Class Reference

#include <encoder.h>

Inheritance diagram for phidgets::Encoder:
Inheritance graph
[legend]

List of all members.

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)

Detailed Description

Definition at line 9 of file encoder.h.


Constructor & Destructor Documentation

Definition at line 8 of file encoder.cpp.


Member Function Documentation

bool phidgets::Encoder::getEnabled ( int  index)

Checks if an encoder is powered on and receiving events.

Parameters:
indexThe 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.

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.

Parameters:
indexThe index of the encoder to read

Definition at line 74 of file encoder.cpp.

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.

Parameters:
indexThe 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.

Parameters:
indexThe 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.

Parameters:
indexThe index of the encoder to change
enabledThe 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.

Parameters:
indexThe index of the encoder to set
positionThe new value that should be returned by 'getPosition(index)' at the current position of the encoder

Definition at line 67 of file encoder.cpp.


Member Data Documentation

CPhidgetEncoderHandle phidgets::Encoder::encoder_handle_ [protected]

Definition at line 49 of file encoder.h.


The documentation for this class was generated from the following files:


phidgets_api
Author(s): Tully Foote, Ivan Dryanovski
autogenerated on Wed Aug 16 2017 02:50:15