/***************************************************************
 * PrTRCBoard.h
 *
 * This is TRC board class.
 *
 ****************************************************************/

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

#ifndef _PrTRCBoard_h
#define _PrTRCBoard_h

#include "PrGlobalDefn.h"

#define PR_TRCBOARD_OK    1
#define PR_TRCBOARD_ERROR 0

class PrEncoderTRC;
class PrADCTRC;
class PrDACTRC;

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

    int flag() { return flag_; }

    // hardware reset
    int zero();
    
    int valueDAC(int channel,Float &volt);
    int valueADC(int channel,Float &volt);
    int valuesENC(Float *data);
    int valuesPresetENC(const int *data);

    int powerOn();
    int powerOff();
    int thermostat();
    int calibrationSet();
    int calibrationCheck();

    int handOpen();
    int handClose();

 private:
    int flag_;
    int discreteReg_;
    PrEncoderTRC *enc_;
    PrADCTRC *adc_;
    PrDACTRC *dac_;

    int WriteDiscreteOutReg();
    int ReadStatusInReg();

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

#endif // _PrTRCBoard_h
