00001 #include "otsdaq-core/Supervisor/SupervisorsInfo.h"
00002 #include "otsdaq-core/MessageFacility/MessageFacility.h"
00003 #include "otsdaq-core/Macros/CoutHeaderMacros.h"
00004 #include "otsdaq-core/SupervisorDescriptorInfo/SupervisorDescriptorInfoBase.h"
00005
00006 #include <iostream>
00007
00008
00009 using namespace ots;
00010
00011
00012 SupervisorsInfo::SupervisorsInfo(void)
00013 {
00014 }
00015
00016
00017 SupervisorsInfo::~SupervisorsInfo(void)
00018 {
00019 }
00020
00021
00022 void SupervisorsInfo::init(const SupervisorDescriptorInfoBase& supervisorDescriptorInfo)
00023 {
00024 SupervisorDescriptors::const_iterator it;
00025 it = supervisorDescriptorInfo.getFEDescriptors().begin();
00026 for(; it!=supervisorDescriptorInfo.getFEDescriptors().end(); it++)
00027 theFESupervisorsInfo_[it->first] = SupervisorInfo();
00028
00029
00030
00031
00032 for(auto it : supervisorDescriptorInfo.getARTDAQFEDataManagerDescriptors())
00033 theARTDAQFEDataManagerSupervisorsInfo_[it.first] = SupervisorInfo();
00034
00035 for(auto it : supervisorDescriptorInfo.getARTDAQDataManagerDescriptors())
00036 theARTDAQDataManagerSupervisorsInfo_[it.first] = SupervisorInfo();
00037 }
00038
00039
00040 SupervisorInfo& SupervisorsInfo::getSupervisorInfo(void)
00041 {
00042 return theSupervisorInfo_;
00043 }
00044
00045
00046 SupervisorInfo& SupervisorsInfo::getFESupervisorInfo(xdata::UnsignedIntegerT instance)
00047 {
00048 if(theFESupervisorsInfo_.find(instance) == theFESupervisorsInfo_.end())
00049 std::cout << __COUT_HDR_FL__ << "Couldn't find: " << instance << std::endl;
00050 return theFESupervisorsInfo_.find(instance)->second;
00051 }
00052
00053
00054 SupervisorInfo& SupervisorsInfo::getARTDAQFEDataManagerSupervisorInfo(xdata::UnsignedIntegerT instance)
00055 {
00056 if(theARTDAQFEDataManagerSupervisorsInfo_.find(instance) == theARTDAQFEDataManagerSupervisorsInfo_.end())
00057 std::cout << __COUT_HDR_FL__ << "Couldn't find: " << instance << std::endl;
00058 return theARTDAQFEDataManagerSupervisorsInfo_.find(instance)->second;
00059 }
00060
00061 SupervisorInfo& SupervisorsInfo::getARTDAQDataManagerSupervisorInfo(xdata::UnsignedIntegerT instance)
00062 {
00063 if(theARTDAQDataManagerSupervisorsInfo_.find(instance) == theARTDAQDataManagerSupervisorsInfo_.end())
00064 std::cout << __COUT_HDR_FL__ << "Couldn't find: " << instance << std::endl;
00065 return theARTDAQDataManagerSupervisorsInfo_.find(instance)->second;
00066 }
00067
00068 SupervisorInfo& SupervisorsInfo::getVisualSupervisorInfo(void)
00069 {
00070 return theVisualSupervisorInfo_;
00071 }
00072