// =====================================================================
//  $Id: TCamacCoincidenceRegisterModule.cc,v 1.3 2003/10/06 17:02:40 goiwai Exp $
//  $Name: CLDAQ-1-11-00 $
//  $Log: TCamacCoincidenceRegisterModule.cc,v $
//  Revision 1.3  2003/10/06 17:02:40  goiwai
//  *** empty log message ***
//
//  Revision 1.2  2003/07/30 16:19:09  goiwai
//  ファイルにコミットログをつけることにしました.
//
// =====================================================================
#include "TCamacCoincidenceRegisterModule.hh"
#include "TDataSegment.hh"
#include "TDataElement.hh"

TCamacCoincidenceRegisterModule::TCamacCoincidenceRegisterModule( TCamacCrateController* cc7x00, Tint slot, Tint nch, Tdata_t datalen )
  : TCamacModule( cc7x00, slot, nch, datalen )
{;}

TCamacCoincidenceRegisterModule::TCamacCoincidenceRegisterModule( const TCamacCoincidenceRegisterModule& right )
  : TCamacModule( right )
{;}

TCamacCoincidenceRegisterModule::~TCamacCoincidenceRegisterModule()
{;}

const TCamacCoincidenceRegisterModule& TCamacCoincidenceRegisterModule::operator=( const TCamacCoincidenceRegisterModule& right )
{
  *( (TCamacModule*)this ) = *( (TCamacModule*)(&right) );
  return *this;
}

Tbool TCamacCoincidenceRegisterModule::operator==( const TCamacCoincidenceRegisterModule& right ) const
{
  return *( (TCamacModule*)this ) == *( (TCamacModule*)(&right) );
}

Tbool TCamacCoincidenceRegisterModule::operator!=( const TCamacCoincidenceRegisterModule& right ) const
{
  return *( (TCamacModule*)this ) != *( (TCamacModule*)(&right) );
}

Tvoid TCamacCoincidenceRegisterModule::FillData( TDataElement& element, Tint channel )
{
  Tstring head = "TCamacCoincidenceRegisterModule::FillData: ";
  if ( channel < 0 || channel >= theNumberOfChannels ) {
    Tcerr << head << "invalid ID " << channel << Tendl;
    element.FillData( &theStatus, tTypeInt, 1 );
  } else {
    Read();
    element.FillData( &theCamacData, tTypeUnsignedInt, 1 );
  }
  return;
}
