00001 #include "otsdaq-components/DetectorConfiguration/DACStream.h"
00002 #include "otsdaq-core/ConfigurationInterface/ConfigurationTree.h"
00003 #include "otsdaq-components/DetectorConfiguration/FSSRDACsConfiguration.h"
00004
00005 using namespace ots;
00006
00007
00008
00009 DACStream::DACStream(void)
00010 {}
00011
00012
00013 DACStream::~DACStream(void)
00014 {}
00015
00016
00017 void DACStream::makeStream(const ConfigurationTree& feToDetectorTree)
00018 {
00019 theChannelStreamMap_.clear();
00020 std::multimap<unsigned int, ROCStream>::iterator currentElement;
00021 std::string detectorType = "";
00022 auto feWriterDetectorList = feToDetectorTree.getChildren();
00023
00024 FSSRDACsConfiguration dacsMaker;
00025 for(auto& it : feWriterDetectorList)
00026 {
00027 const ConfigurationTree& detectorConfiguration = it.second.getNode("LinkToDetectorTable");
00028 const ConfigurationTree& dacsConfiguration = detectorConfiguration.getNode("LinkToDACsTable");
00029 const ConfigurationTree& maskConfiguration = detectorConfiguration.getNode("LinkToMaskTable");
00030
00031
00032
00033
00034 currentElement = theChannelStreamMap_.insert(std::pair<unsigned int, ROCStream>(it.second.getNode("FEWriterChannel").getValue<unsigned int>(),ROCStream()));
00035 currentElement->second.setDetectorID (it.first);
00036 detectorType = detectorConfiguration.getNode("DetectorType").getValue<std::string>();
00037 currentElement->second.setROCType (detectorType);
00038 currentElement->second.setROCStatus (detectorConfiguration.getNode(ViewColumnInfo::COL_NAME_STATUS).getValue<bool>());
00039 currentElement->second.setFEWROCAddress(it.second.getNode("FEWriterDetectorAddress").getValue<unsigned int>());
00040 currentElement->second.setROCDACs (dacsMaker.getROCDACs(dacsConfiguration));
00041
00042
00043 currentElement->second.setROCMask (maskConfiguration.getNode("KillMask").getValue<std::string>());
00044 }
00045
00046
00047 }