$treeview $search $mathjax $extrastylesheet
otsdaq
v2_03_00
$projectbrief
|
$projectbrief
|
$searchbox |
00001 #include <iostream> 00002 #include "otsdaq-core/ConfigurationPluginDataFormats/FETable.h" 00003 #include "otsdaq-coreMacros/TablePluginMacros.h" 00004 00005 using namespace ots; 00006 00007 //============================================================================== 00008 FEConfiguration::FEConfiguration(void) : TableBase("FEConfiguration") 00009 { 00011 // WARNING: the names and the order MUST match the ones in the enum // 00013 // FEConfigurationInfo.xml 00014 //<?xml version="1.0" encoding="UTF-8" standalone="no" ?> 00015 //<ROOT xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 00016 // xsi:noNamespaceSchemaLocation="TableInfo.xsd"> 00017 // <CONFIGURATION Name="FEConfiguration"> 00018 // <VIEW Name="FE_CONFIGURATION" Type="File,Database,DatabaseTest"> 00019 // <COLUMN Name="SupervisorType" StorageName="SUPERVISOR_TYPE" 00020 // DataType="VARCHAR2"/> <COLUMN Name="SupervisorInstance" 00021 // StorageName="SUPERVISOR_INSTANCE" DataType="NUMBER" /> <COLUMN 00022 // Name="FrontEndType" StorageName="FRONT_END_TYPE" DataType="VARCHAR2"/> 00023 // <COLUMN Name="FrontEndID" StorageName="INTERFACE_ID" 00024 // DataType="VARCHAR2"/> 00025 // </VIEW> 00026 // </CONFIGURATION> 00027 //</ROOT> 00028 } 00029 00030 //============================================================================== 00031 FEConfiguration::~FEConfiguration(void) {} 00032 00033 //============================================================================== 00034 void FEConfiguration::init(ConfigurationManager* configManager) 00035 { 00036 std::string tmpType; 00037 unsigned int tmpInstance; 00038 std::string tmpID; 00039 for(unsigned int row = 0; row < TableBase::activeTableView_->getNumberOfRows(); row++) 00040 { 00041 TableBase::activeTableView_->getValue(tmpType, row, SupervisorType); 00042 TableBase::activeTableView_->getValue(tmpInstance, row, SupervisorInstance); 00043 TableBase::activeTableView_->getValue(tmpID, row, FrontEndId); 00044 std::cout << __COUT_HDR_FL__ << "Type: " << tmpType << " Name: " << tmpInstance 00045 << " row: " << row << std::endl; 00046 typeNameToRow_[composeUniqueName(tmpType, tmpInstance)][tmpID] = row; 00047 } 00048 } 00049 // 00051 // std::vector<std::string> FEConfiguration::getListOfFEIDs(void) const 00052 //{ 00053 // std::vector<std::string> list; 00054 // for(const auto& itSupervisors : typeNameToRow_) 00055 // for(const auto& itFrontEnds : itSupervisors.second) 00056 // list.push_back(itFrontEnds.first); 00057 // return list; 00058 //} 00059 // 00061 // std::vector<std::string> FEConfiguration::getListOfFEIDs(const std::string& 00062 // supervisorType, unsigned int supervisorInstance) const 00063 //{ 00064 // std::string uniqueName = composeUniqueName(supervisorType, supervisorInstance); 00065 // std::vector<std::string> list; 00066 // if(typeNameToRow_.find(uniqueName) == typeNameToRow_.end()) 00067 // { 00068 // std::cout << __COUT_HDR_FL__ 00069 // << "Couldn't find any supervisor of type " << supervisorType 00070 // << " and instance " << supervisorInstance 00071 // << std::endl; 00072 // //assert(0); //RAR - 8/12/16 - empty list is ok 00073 // } 00074 // else 00075 // { 00076 // for(const auto& it : typeNameToRow_.find(uniqueName)->second) 00077 // list.push_back(it.first); 00078 // } 00079 // 00080 // return list; 00081 //} 00082 // 00084 // const std::string FEConfiguration::getFEInterfaceType(const std::string& frontEndID) 00085 // const 00086 //{ 00087 // for(const auto& itSupervisors : typeNameToRow_) 00088 // for(const auto& itFrontEnds : itSupervisors.second) 00089 // if(itFrontEnds.first == frontEndID) 00090 // return 00091 // TableBase::getView().getDataView()[typeNameToRow_.find(itSupervisors.first)->second.find(frontEndID)->second][FrontEndType]; 00092 // std::cout << __COUT_HDR_FL__ << "Didn't find any interface with ID: " << frontEndID << 00093 // std::endl; assert(0); 00094 // __THROW__("FEID not found!"); 00095 // return ""; 00096 //} 00097 // 00099 // const std::string FEConfiguration::getFEInterfaceType(const std::string& 00100 // supervisorType, unsigned int supervisorInstance, const std::string& frontEndID) const 00101 //{ 00102 // std::string uniqueName = composeUniqueName(supervisorType, supervisorInstance); 00103 // if(typeNameToRow_.find(uniqueName) == typeNameToRow_.end()) 00104 // { 00105 // std::cout << __COUT_HDR_FL__ 00106 // << "Couldn't find any supervisor of type " << supervisorType 00107 // << " and instance " << supervisorInstance 00108 // << std::endl; 00109 // assert(0); 00110 // } 00111 // if(typeNameToRow_.find(uniqueName)->second.find(frontEndID) == 00112 // typeNameToRow_.find(uniqueName)->second.end()) 00113 // { 00114 // std::cout << __COUT_HDR_FL__ 00115 // << "Couldn't find any front end ID " << frontEndID 00116 // << " for supervisor type " << supervisorType 00117 // << " and instance " << supervisorInstance 00118 // << std::endl; 00119 // assert(0); 00120 // } 00121 // 00122 // return 00123 // TableBase::getView().getDataView()[typeNameToRow_.find(uniqueName)->second.find(frontEndID)->second][FrontEndType]; 00124 //} 00125 00127 // std::vector<unsigned int> FEConfiguration::getListOfFEWRs(void) const 00128 //{ 00129 // return getListOfFEs("FEWR"); 00130 //} 00131 // 00133 // std::vector<unsigned int> FEConfiguration::getListOfFEWRs(unsigned int 00134 // supervisorInstance) const 00135 //{ 00136 // return getListOfFEs("FEWR",supervisorInstance); 00137 //} 00138 // 00140 // const std::string& FEConfiguration::getFEWRInterfaceName(unsigned int id) const 00141 //{ 00142 // return getFEInterfaceType("FEWR", id); 00143 //} 00144 // 00146 // std::vector<unsigned int> FEConfiguration::getListOfFEWs(void) const 00147 //{ 00148 // return getListOfFEs("FEW"); 00149 //} 00150 // 00152 // std::vector<unsigned int> FEConfiguration::getListOfFEWs(unsigned int 00153 // supervisorInstance) const 00154 //{ 00155 // return getListOfFEs("FEW",supervisorInstance); 00156 //} 00157 // 00159 // const std::string& FEConfiguration::getFEWInterfaceName(unsigned int id) const 00160 //{ 00161 // return getFEInterfaceType("FEW", id); 00162 //} 00163 // 00165 // std::vector<unsigned int> FEConfiguration::getListOfFERs(void) const 00166 //{ 00167 // return getListOfFEs("FER"); 00168 //} 00169 // 00171 // std::vector<unsigned int> FEConfiguration::getListOfFERs(unsigned int 00172 // supervisorInstance) const 00173 //{ 00174 // return getListOfFEs("FER",supervisorInstance); 00175 //} 00176 // 00178 // const std::string& FEConfiguration::getFERInterfaceName(unsigned int id) const 00179 //{ 00180 // return getFEInterfaceType("FER", id); 00181 //} 00182 00183 DEFINE_OTS_CONFIGURATION(FEConfiguration)