$treeview $search $mathjax $extrastylesheet
otsdaq_components
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #include "otsdaq-core/ConfigurationDataFormats/DACsTableBase.h" 00002 00003 #include <iostream> 00004 00005 using namespace ots; 00006 00007 //============================================================================== 00008 DACsTableBase::DACsTableBase(std::string configurationName, 00009 unsigned int rocNameColumn, 00010 unsigned int firstDAC, 00011 unsigned int lastDAC) 00012 : TableBase(configurationName) 00013 , rocNameColumn_(rocNameColumn) 00014 , firstDAC_(firstDAC) 00015 , lastDAC_(lastDAC) 00016 { 00017 } 00018 00019 //============================================================================== 00020 DACsTableBase::~DACsTableBase(void) {} 00021 00022 //============================================================================== 00023 void DACsTableBase::init(ConfigurationManager* configManager) 00024 { 00025 nameToROCDACsMap_.clear(); 00026 00027 std::string tmpDetectorID; 00028 std::string tmpDACName; 00029 unsigned int tmpDACValue; 00030 for(unsigned int row = 0; row < TableBase::activeTableView_->getNumberOfRows(); row++) 00031 { 00032 TableBase::activeTableView_->getValue(tmpDetectorID, row, rocNameColumn_); 00033 nameToROCDACsMap_[tmpDetectorID] = ROCDACs(); 00034 ROCDACs& aROCDACs = nameToROCDACsMap_[tmpDetectorID]; 00035 for(unsigned int col = firstDAC_; col <= lastDAC_; col++) 00036 { 00037 TableBase::activeTableView_->getValue(tmpDACValue, row, col); 00038 tmpDACName = TableBase::activeTableView_->getColumnInfo(col).getName(); 00039 aROCDACs.setDAC(tmpDACName, dacNameToDACAddress_[tmpDACName], tmpDACValue); 00040 // std::cout << __COUT_HDR_FL__ << "DAC. Name: " << tmpDACName << " addr: " << 00041 // dacNameToDACAddress_[tmpDACName] << " val: " << tmpDACValue << std::endl; 00042 } 00043 } 00044 } 00045 00046 //============================================================================== 00047 const ROCDACs& DACsTableBase::getROCDACs(std::string rocName) const 00048 { 00049 // FIXME This check should be removed when you are sure you don't have inconsistencies 00050 // between configurations 00051 if(nameToROCDACsMap_.find(rocName) == nameToROCDACsMap_.end()) 00052 { 00053 std::cout << __COUT_HDR_FL__ << "ROC named " << rocName 00054 << " doesn't exist in any DAC configuration." << std::endl; 00055 assert(0); 00056 } 00057 // 00058 // for(ots::DACList::const_iterator it = 00059 // nameToROCDACsMap_.find(rocName)->second.getDACList().begin(); it != 00060 // nameToROCDACsMap_.find(rocName)->second.getDACList().end(); ++it) std::cout << 00061 //__COUT_HDR_FL__ << "DAC Name :" << it->first << ", value: " << it->second.second << 00062 // std::endl; 00063 return nameToROCDACsMap_.find(rocName)->second; 00064 }