1 #ifndef _ots_ROCStream_h_
2 #define _ots_ROCStream_h_
4 #include "otsdaq-components/DetectorConfiguration/ROCDACs.h"
5 #include "otsdaq/Macros/CoutMacros.h"
21 , theFEWROCAddress_(0)
30 void setDetectorID(
const std::string& rocName) { theDetectorID_ = rocName; }
31 void setROCType(
const std::string& rocType) { theROCType_ = rocType; }
32 void setROCStatus(
bool rocStatus) { theROCStatus_ = rocStatus; }
33 void setFEWROCAddress(
unsigned int fecROCAddress)
35 theFEWROCAddress_ = fecROCAddress;
37 void setROCDACs(
const ROCDACs& rocDACs) { theROCDACs_ = rocDACs; }
38 void addDAC(std::string name,
unsigned int address,
unsigned int value)
40 theROCDACs_.setDAC(name, address, value);
42 void setROCMask(
const std::string& rocMask);
43 void setROCTrimBits(
const std::string& rocTrimBits) { theROCTrimBits_ = rocTrimBits; }
46 const std::string& getDetectorID(
void)
const {
return theDetectorID_; }
47 const std::string& getROCType(
void)
const {
return theROCType_; }
48 bool getROCStatus(
void)
const {
return theROCStatus_; }
49 unsigned int getFEWROCAddress(
void)
const {
return theFEWROCAddress_; }
50 const ROCDACs& getROCDACs(
void)
const {
return theROCDACs_; }
51 const std::string& getROCMask(
void)
const {
return theROCMask_; }
52 const std::string& getROCTrimBits(
void)
const {
return theROCTrimBits_; }
55 std::string theDetectorID_;
56 std::string theROCType_;
58 unsigned int theFEWROCAddress_;
60 std::string theROCMask_;
61 std::string theROCTrimBits_;
66 inline void ots::ROCStream::setROCMask(
const std::string& rocMask)
74 for(
unsigned int i = 0; i < rocMask.length(); i++)
88 __SS__ <<
"Too many [ in bit mask configuration" << std::endl;
89 __COUT_ERR__ <<
"\n" << ss.str();
92 else if(rocMask[i] ==
']')
105 __SS__ <<
"Too many ] in bit mask configuration" << std::endl;
106 __COUT_ERR__ <<
"\n" << ss.str();
109 else if(rocMask[i] ==
'0' || rocMask[i] ==
'1')
115 #endif // ots_ROCStream_h