/***************************************************************
 * PrEncoderTRC.h
 *
 * This is an encoder class for TRC board.
 *
 ****************************************************************/

/*
 * modification history
 *----------------------
 *
 * 10/26/97: K.C. Chang: created.
 */

#ifndef _PrEncoderTRC_h
#define _PrEncoderTRC_h

#include "PrEncoderIntf.h"

class PrEncoderTRC : public PrEncoderIntf
{
 public:
    // constructor sets flag
    // flag() should be called before using
    PrEncoderTRC();
    ~PrEncoderTRC();

    // preset encoder values with data
    virtual int valuesPreset(const int *data);

    // read the channel value and return it(rad)
    virtual Float channelValue(int channel);

    // preset encoder values with default values
    virtual int zero();

 private:
    int *encoderCountPerRev_;
    int *encoderCountZero_;

    // convert encoder counts to angle(rad)
    Float BitsToRad(int channel,int bits);

    // convert angle(rad) to encoder counts
    int RadToBits(int channel,Float rad);

    // copy is not allowed
    PrEncoderTRC(const PrEncoderTRC &) {}
};

#endif // _PrEncoderTRC_h

