00001 /* @version $Revision: 1543 $ * @modifiedby $Author: jacquem $ * @lastmodified $Date: 2012-03-02 16:10:46 +0100 (Fri, 02 Mar 2012) $ */ 00002 #ifndef _DIF_BOARD_HH_ 00003 #define _DIF_BOARD_HH_ 00004 00005 ////////////////////////////////////////////////////////////////////////// 00006 // MICROMEGAS 00007 // 00008 // Dif board for Hardroc and Dirac 00009 // 00010 ////////////////////////////////////////////////////////////////////////// 00011 // This board serves as a connector for several Hardroc or Dirac boards. 00012 // It mainly contains an Id and the list of connected boards. 00013 ////////////////////////////////////////////////////////////////////////// 00014 00015 #include "mTypes.h" 00016 #include <iostream> 00017 00018 00019 ////////////////////////////////////////////////////////////////////////// 00020 // class Dif 00021 ////////////////////////////////////////////////////////////////////////// 00022 class Dif { 00023 //--------------------------// 00024 friend std::ostream& operator <<(std::ostream& out, const Dif *x); 00025 friend std::ostream& operator <<(std::ostream& out, const Dif& x); 00026 public: 00027 Dif(const i32 aId); 00028 // ~Dif() { }; 00029 protected: 00030 std::ostream& operator <<(std::ostream& out) const; 00031 00032 //------ methods --------// 00033 public: 00034 inline const i32 getId() const { return(id); }; 00035 inline const BoardMap_t& getBoards() const { return(boards); }; 00036 00037 void addBoard(Board *aBoard); 00038 const Board& getBoardById(const i32 boardId) const; 00039 Board& getBoardByCol(const ui16 col) const; 00040 Chip &getChipById(const i32 chipId); 00041 Chip &getChipByRowCol(const ui16 boardCol, const ui16 row, const ui16 col ); 00042 00043 00044 unsigned char getLowRegister() const { return low_register; } ; 00045 unsigned char getHighRegister()const { return high_register; } ; 00046 unsigned char getBeforeRegister() const { return before_register; } ; 00047 unsigned char getAfterRegister() const { return after_register; } ; 00048 unsigned char getAcqMode() const { return acqMode; } ; 00049 00050 void setLowRegister(const unsigned char value) { low_register =value; }; 00051 void setHighRegister(const unsigned char value) { high_register =value; }; 00052 void setBeforeRegister(const unsigned char value) { before_register =value; }; 00053 void setAfterRegister(const unsigned char value) { after_register =value; }; 00054 00055 void setChipByPassed(const bool value); 00056 00057 00058 inline ui16 getDifFirmware() const{ return difFirmware; } ; 00059 void setDifFirmware(ui16 value) ; 00060 00061 inline ui16 getDifConfig() const{ return difConfig; } ; 00062 void setDifConfig(ui16 value) { difConfig = value; } ; 00063 00064 inline ui16 getAsicType() const{ return asicType; } ; 00065 void setAsicType(ui16 value) { asicType = value; } ; 00066 00067 inline ui16 getAsu1Id() const{ return asu1Id; } ; 00068 void setAsu1Id(ui16 value) { asu1Id = value; } ; 00069 00070 inline ui16 getAsu2Id() const{ return asu2Id; } ; 00071 void setAsu2Id(ui16 value) { asu2Id = value; } ; 00072 00073 void setConfigured(bool value) { configured = value; } ; 00074 bool isConfigured(void) const { return configured ; }; 00075 00076 00077 void setAcqMode(const unsigned char value) { acqMode = value; } ; 00078 00079 //------ data members --------// 00080 private: 00081 const i32 id; /** id of the board **/ 00082 bool configured; // set to true when Dif config has been read fromn data 00083 BoardMap_t boards; /** list of the connected boards **/ 00084 unsigned char low_register; //8 bits 00085 unsigned char high_register; //8 bits 00086 unsigned char before_register; //8 bits 00087 unsigned char after_register ; //8 bits 00088 unsigned char acqMode; //8 bits acquisition mode 00089 00090 ui16 difFirmware; // Dif firmware version 8 bits 00091 ui16 difConfig; // Dif config 8 bits 00092 ui16 asicType; // Code to describe front-end electronic device: 00093 // 01 Hardroc1 00094 // 02 Hardroc2 00095 // 03 Hardroc2b 00096 // 11 Dirac1 00097 // 12 Dirac2 00098 // 31 Microroc1 00099 ui16 asu1Id; // First Slab ASU number 00100 ui16 asu2Id; // Second Slab ASU number 00101 00102 public: 00103 i32 nbChips; 00104 00105 }; // class Dif 00106 00107 #endif // _DIF_BOARD_HH_