1 #ifndef _ots_ROCStream_h_
2 #define _ots_ROCStream_h_
4 #include "otsdaq-components/DetectorConfiguration/ROCDACs.h"
5 #include "otsdaq-core/Macros/CoutMacros.h"
19 , theFEWROCAddress_(0)
28 void setDetectorID(
const std::string& rocName) { theDetectorID_ = rocName; }
29 void setROCType(
const std::string& rocType) { theROCType_ = rocType; }
30 void setROCStatus(
bool rocStatus) { theROCStatus_ = rocStatus; }
31 void setFEWROCAddress(
unsigned int fecROCAddress)
33 theFEWROCAddress_ = fecROCAddress;
35 void setROCDACs(
const ROCDACs& rocDACs) { theROCDACs_ = rocDACs; }
36 void addDAC(std::string name,
unsigned int address,
unsigned int value)
38 theROCDACs_.setDAC(name, address, value);
40 void setROCMask(
const std::string& rocMask);
41 void setROCTrimBits(
const std::string& rocTrimBits) { theROCTrimBits_ = rocTrimBits; }
44 const std::string& getDetectorID(
void)
const {
return theDetectorID_; }
45 const std::string& getROCType(
void)
const {
return theROCType_; }
46 bool getROCStatus(
void)
const {
return theROCStatus_; }
47 unsigned int getFEWROCAddress(
void)
const {
return theFEWROCAddress_; }
48 const ROCDACs& getROCDACs(
void)
const {
return theROCDACs_; }
49 const std::string& getROCMask(
void)
const {
return theROCMask_; }
50 const std::string& getROCTrimBits(
void)
const {
return theROCTrimBits_; }
53 std::string theDetectorID_;
54 std::string theROCType_;
56 unsigned int theFEWROCAddress_;
58 std::string theROCMask_;
59 std::string theROCTrimBits_;
64 inline void ots::ROCStream::setROCMask(
const std::string& rocMask)
72 for(
unsigned int i = 0; i < rocMask.length(); i++)
86 __SS__ <<
"Too many [ in bit mask configuration" << std::endl;
87 __COUT_ERR__ <<
"\n" << ss.str();
90 else if(rocMask[i] ==
']')
103 __SS__ <<
"Too many ] in bit mask configuration" << std::endl;
104 __COUT_ERR__ <<
"\n" << ss.str();
107 else if(rocMask[i] ==
'0' || rocMask[i] ==
'1')
113 #endif // ots_ROCStream_h