Dif Class Reference

#include <Dif.hh>

Collaboration diagram for Dif:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Dif (const i32 aId)
const i32 getId () const
const BoardMap_t & getBoards () const
void addBoard (Board *aBoard)
const BoardgetBoardById (const i32 boardId) const
BoardgetBoardByCol (const ui16 col) const
ChipgetChipById (const i32 chipId)
ChipgetChipByRowCol (const ui16 boardCol, const ui16 row, const ui16 col)
unsigned char getLowRegister () const
unsigned char getHighRegister () const
unsigned char getBeforeRegister () const
unsigned char getAfterRegister () const
unsigned char getAcqMode () const
void setLowRegister (const unsigned char value)
void setHighRegister (const unsigned char value)
void setBeforeRegister (const unsigned char value)
void setAfterRegister (const unsigned char value)
void setChipByPassed (const bool value)
ui16 getDifFirmware () const
void setDifFirmware (ui16 value)
ui16 getDifConfig () const
void setDifConfig (ui16 value)
ui16 getAsicType () const
void setAsicType (ui16 value)
ui16 getAsu1Id () const
void setAsu1Id (ui16 value)
ui16 getAsu2Id () const
void setAsu2Id (ui16 value)
void setConfigured (bool value)
bool isConfigured (void) const
void setAcqMode (const unsigned char value)

Public Attributes

i32 nbChips

Protected Member Functions

std::ostream & operator<< (std::ostream &out) const

Private Attributes

const i32 id
bool configured
BoardMap_t boards
unsigned char low_register
unsigned char high_register
unsigned char before_register
unsigned char after_register
unsigned char acqMode
ui16 difFirmware
ui16 difConfig
ui16 asicType
ui16 asu1Id
ui16 asu2Id

Friends

std::ostream & operator<< (std::ostream &out, const Dif *x)
std::ostream & operator<< (std::ostream &out, const Dif &x)

Detailed Description

Definition at line 22 of file Dif.hh.


Constructor & Destructor Documentation

Dif::Dif ( const i32  aId  ) 

Definition at line 21 of file Dif.cpp.

00021                       : id(aId), configured(false)
00022 {
00023    low_register    = 0;        //8 bits
00024    high_register   = 0;        //8 bits
00025    before_register = 0;        //8 bits
00026    after_register  = 0;        //8 bits
00027    acqMode         = 0;        // 16 bits acquisition mod
00028    nbChips         = 0;
00029          difFirmware     = 0;
00030    difConfig       = 0;
00031          asicType        = 0;
00032          asu1Id          = 0;
00033          asu2Id          = 0;
00034 };


Member Function Documentation

std::ostream & Dif::operator<< ( std::ostream &  out  )  const [protected]

Definition at line 37 of file Dif.cpp.

00037                                                   {
00038   out << "  Dif id " << id << endl;
00039   for (map<i32, Board *>::const_iterator it = boards.begin(); it != boards.end(); ++it)
00040     out << *(it->second);
00041   return(out);
00042 }; // Dif.operator <<

const i32 Dif::getId ( void   )  const [inline]

Definition at line 34 of file Dif.hh.

Referenced by Chamber::addDif(), Channel::Channel(), Chip::Chip(), MicrorocOldLabviewReader::getAcqData(), MicrorocMergeReader::getAcqData(), MicrorocOldLabviewReader::getScData(), MicrorocTestChamber::init(), MicrorocChamber6::init(), MicrorocChamber1::init(), MetreCarreChamber::init(), Hardroc2IPNLChamber6::init(), Hardroc2Chamber6::init(), Hardroc2Chamber2::init(), Hardroc2Chamber1::init(), Hardroc1Chamber::init(), DiracChamber1::init(), MTChannel::MTChannel(), MTEvent::operator=(), MTDif::operator=(), MTChip::operator=(), and Chip::operator=().

00034 { return(id); };

const BoardMap_t& Dif::getBoards ( void   )  const [inline]

Definition at line 35 of file Dif.hh.

Referenced by MicrorocOldLabviewReader::getAcqData(), MicrorocMergeReader::getAcqData(), MicrorocOldLabviewReader::getAnalogData(), DiracReader::getConfigData(), TestMicrorocParser::getNextEvent(), and MicrorocMergeReader::getScData().

00035 { return(boards); };

void Dif::addBoard ( Board aBoard  ) 

Definition at line 44 of file Dif.cpp.

Referenced by MicrorocTestChamber::init(), MicrorocChamber6::init(), MicrorocChamber1::init(), MetreCarreChamber::init(), Hardroc2IPNLChamber6::init(), Hardroc2Chamber6::init(), Hardroc2Chamber2::init(), Hardroc2Chamber1::init(), Hardroc1Chamber::init(), and DiracChamber1::init().

00044                                 {
00045   if (aBoard  != NULL )
00046   {
00047       aBoard->setDif(this);
00048       boards.insert(make_pair(aBoard->getId(), aBoard));
00049   }
00050 }; // Dif.addBoard

const Board & Dif::getBoardById ( const i32  boardId  )  const

Definition at line 53 of file Dif.cpp.

Referenced by BeamProfile::DrawChip2D().

00054 {
00055   std::map<i32, Board *>::const_iterator it = boards.find(boardId);
00056   if (it == boards.end())
00057     throw MicroException("Dif.getBoardById : no Board found for this id");
00058 
00059   //FILE_LOG(logDEBUG1) << "---- Dif.getBoardById(" << boardId << ") found" << endl;
00060   return(*(it->second));
00061 }; // Dif.getBoardById

Board & Dif::getBoardByCol ( const ui16  col  )  const

Definition at line 65 of file Dif.cpp.

Referenced by getChipByRowCol(), MicrorocOldLabviewReader::getScData(), and MicrorocMergeReader::getScData().

00066 {
00067     for ( BoardMap_t::const_iterator it = boards.begin(); it !=boards.end() ; it++ )
00068     {
00069          try 
00070          {
00071              Board& board = *(it)->second ;
00072               if ( board.getColumn() == col )
00073               {
00074                 return board;
00075               }
00076          }
00077          catch ( ... ) { }
00078     }
00079     throw MicroException(" No Board with this col for this Dif");
00080 }

Chip & Dif::getChipById ( const i32  chipId  ) 

Definition at line 82 of file Dif.cpp.

Referenced by BeamProfile::DrawChannel2D(), DiracLabview::getNextEvent(), Hardroc2LabviewReader::getScData(), Hardroc1Reader::getScData(), main(), MicrorocSCReader::parseSC(), and MicrorocSCReader::parseSCFromDb().

00083 {
00084     for ( BoardMap_t::iterator it = boards.begin(); it !=boards.end() ; it++ )
00085     {
00086          try 
00087          {
00088              Board& board = *(it)->second ;
00089              FILE_LOG(logDEBUG1) << "board id " << board.getId() <<endl;
00090              return board.getChipById(chipId);
00091          }
00092          catch ( ... ) { }
00093     }
00094     throw MicroException(" No Chip with this id for this Dif");
00095 }

Chip & Dif::getChipByRowCol ( const ui16  boardCol,
const ui16  row,
const ui16  col 
)

Definition at line 97 of file Dif.cpp.

Referenced by MicrorocOldLabviewReader::getAcqData(), MicrorocMergeReader::getAcqData(), and MicrorocOldLabviewReader::getAnalogData().

00098 {
00099          try 
00100          {
00101              Board& board = this->getBoardByCol(boardCol) ;
00102              return board.getChipByRowCol(row,col);
00103          }
00104          catch ( ... ) { }
00105     throw MicroException(" No Chip with this boardCol , row and col for this Dif");
00106 }

unsigned char Dif::getLowRegister (  )  const [inline]

Definition at line 44 of file Dif.hh.

Referenced by MTDif::operator=().

00044 { return low_register; } ;

unsigned char Dif::getHighRegister (  )  const [inline]

Definition at line 45 of file Dif.hh.

Referenced by MTDif::operator=().

00045 { return high_register; } ;

unsigned char Dif::getBeforeRegister (  )  const [inline]

Definition at line 46 of file Dif.hh.

Referenced by MTDif::operator=().

00046 { return before_register; } ;

unsigned char Dif::getAfterRegister (  )  const [inline]

Definition at line 47 of file Dif.hh.

Referenced by MTDif::operator=().

00047 { return after_register; } ;

unsigned char Dif::getAcqMode (  )  const [inline]

Definition at line 48 of file Dif.hh.

Referenced by MTDif::operator=().

00048 { return acqMode; } ;

void Dif::setLowRegister ( const unsigned char  value  )  [inline]

Definition at line 50 of file Dif.hh.

Referenced by DiracReader::storeDifInfo().

00050 { low_register =value; };

void Dif::setHighRegister ( const unsigned char  value  )  [inline]

Definition at line 51 of file Dif.hh.

Referenced by DiracReader::storeDifInfo().

00051 { high_register =value; };

void Dif::setBeforeRegister ( const unsigned char  value  )  [inline]

Definition at line 52 of file Dif.hh.

Referenced by DiracReader::storeDifInfo().

00052 { before_register =value; };

void Dif::setAfterRegister ( const unsigned char  value  )  [inline]

Definition at line 53 of file Dif.hh.

Referenced by DiracReader::storeDifInfo().

00053 { after_register =value; };

void Dif::setChipByPassed ( const bool  value  ) 

Definition at line 108 of file Dif.cpp.

Referenced by MicrorocOldLabviewReader::getScData(), and MicrorocMergeReader::getScData().

00109 {
00110     for ( BoardMap_t::iterator it = boards.begin(); it !=boards.end() ; it++ )
00111     {
00112        {
00113           Board& board = *(it)->second ;
00114           ChipMap_t chips =  board.getChips();
00115           for ( ChipMap_t::iterator itc = chips.begin(); itc !=chips.end() ; itc++ )
00116           {
00117             Chip& chip = *(itc)->second;
00118             chip.setBypassed(value);
00119           }
00120        }
00121     }
00122 }

ui16 Dif::getDifFirmware (  )  const [inline]

Definition at line 58 of file Dif.hh.

Referenced by MicrorocOldLabviewReader::getScData(), Hardroc2LabviewReader::getScData(), DifSynchroReader::getScData(), and MTDif::operator=().

00058 { return difFirmware; } ;

void Dif::setDifFirmware ( ui16  value  ) 

Definition at line 124 of file Dif.cpp.

Referenced by MicrorocOldLabviewReader::getScData(), Hardroc2LabviewReader::getScData(), and DifSynchroReader::getScData().

00125  { 
00126     difFirmware = value; 
00127  } 

ui16 Dif::getDifConfig (  )  const [inline]

Definition at line 61 of file Dif.hh.

Referenced by MicrorocOldLabviewReader::getScData(), Hardroc2LabviewReader::getScData(), and MTDif::operator=().

00061 { return difConfig; } ;

void Dif::setDifConfig ( ui16  value  )  [inline]

Definition at line 62 of file Dif.hh.

Referenced by MicrorocOldLabviewReader::getScData(), and Hardroc2LabviewReader::getScData().

00062 { difConfig = value; } ;

ui16 Dif::getAsicType (  )  const [inline]

Definition at line 64 of file Dif.hh.

Referenced by MicrorocOldLabviewReader::getScData(), Hardroc2LabviewReader::getScData(), and MTDif::operator=().

00064 { return asicType; } ;

void Dif::setAsicType ( ui16  value  )  [inline]

Definition at line 65 of file Dif.hh.

Referenced by MicrorocOldLabviewReader::getScData(), and Hardroc2LabviewReader::getScData().

00065 { asicType = value; } ;

ui16 Dif::getAsu1Id (  )  const [inline]

Definition at line 67 of file Dif.hh.

Referenced by MicrorocMergeReader::getAcqData(), MicrorocOldLabviewReader::getScData(), MicrorocMergeReader::getScData(), Hardroc2LabviewReader::getScData(), and MTDif::operator=().

00067 { return asu1Id; } ;

void Dif::setAsu1Id ( ui16  value  )  [inline]

Definition at line 68 of file Dif.hh.

Referenced by MicrorocOldLabviewReader::getScData(), MicrorocMergeReader::getScData(), and Hardroc2LabviewReader::getScData().

00068 { asu1Id = value; } ;

ui16 Dif::getAsu2Id (  )  const [inline]

Definition at line 70 of file Dif.hh.

Referenced by MicrorocMergeReader::getAcqData(), MicrorocOldLabviewReader::getScData(), MicrorocMergeReader::getScData(), Hardroc2LabviewReader::getScData(), and MTDif::operator=().

00070 { return asu2Id; } ;

void Dif::setAsu2Id ( ui16  value  )  [inline]

Definition at line 71 of file Dif.hh.

Referenced by MicrorocOldLabviewReader::getScData(), MicrorocMergeReader::getScData(), and Hardroc2LabviewReader::getScData().

00071 { asu2Id = value; } ;

void Dif::setConfigured ( bool  value  )  [inline]

Definition at line 73 of file Dif.hh.

Referenced by MicrorocOldLabviewReader::getScData().

00073 { configured = value; } ; 

bool Dif::isConfigured ( void   )  const [inline]

Definition at line 74 of file Dif.hh.

Referenced by MTDif::operator=().

00074 { return configured ; };

void Dif::setAcqMode ( const unsigned char  value  )  [inline]

Definition at line 77 of file Dif.hh.

Referenced by DiracReader::storeDifInfo().

00077 { acqMode = value; } ;


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const Dif x 
) [friend]

Definition at line 13 of file Dif.cpp.

00013                                                        {
00014   return(x->operator <<(out));
00015 };

std::ostream& operator<< ( std::ostream &  out,
const Dif x 
) [friend]

Definition at line 17 of file Dif.cpp.

00017                                                        {
00018   return(x.operator <<(out));
00019 };


Member Data Documentation

const i32 Dif::id [private]

Definition at line 77 of file Dif.hh.

bool Dif::configured [private]

id of the board

Definition at line 82 of file Dif.hh.

Referenced by isConfigured(), and setConfigured().

BoardMap_t Dif::boards [private]

Definition at line 83 of file Dif.hh.

Referenced by addBoard(), getBoardByCol(), getBoardById(), getBoards(), getChipById(), operator<<(), and setChipByPassed().

unsigned char Dif::low_register [private]

list of the connected boards

Definition at line 84 of file Dif.hh.

Referenced by Dif(), getLowRegister(), and setLowRegister().

unsigned char Dif::high_register [private]

Definition at line 85 of file Dif.hh.

Referenced by Dif(), getHighRegister(), and setHighRegister().

unsigned char Dif::before_register [private]

Definition at line 86 of file Dif.hh.

Referenced by Dif(), getBeforeRegister(), and setBeforeRegister().

unsigned char Dif::after_register [private]

Definition at line 87 of file Dif.hh.

Referenced by Dif(), getAfterRegister(), and setAfterRegister().

unsigned char Dif::acqMode [private]

Definition at line 88 of file Dif.hh.

Referenced by Dif(), getAcqMode(), and setAcqMode().

ui16 Dif::difFirmware [private]

Definition at line 90 of file Dif.hh.

Referenced by Dif(), getDifFirmware(), and setDifFirmware().

ui16 Dif::difConfig [private]

Definition at line 91 of file Dif.hh.

Referenced by Dif(), getDifConfig(), and setDifConfig().

ui16 Dif::asicType [private]

Definition at line 92 of file Dif.hh.

Referenced by Dif(), getAsicType(), and setAsicType().

ui16 Dif::asu1Id [private]

Definition at line 99 of file Dif.hh.

Referenced by Dif(), getAsu1Id(), and setAsu1Id().

ui16 Dif::asu2Id [private]

Definition at line 100 of file Dif.hh.

Referenced by Dif(), getAsu2Id(), and setAsu2Id().

i32 Dif::nbChips

Definition at line 103 of file Dif.hh.

Referenced by Dif().


The documentation for this class was generated from the following files:
Generated on Mon Jan 7 13:18:09 2013 for MicromegasFramework by  doxygen 1.4.7