1 #include "otsdaq-core/SupervisorDescriptorInfo/SupervisorDescriptorInfoBase.h"
2 #include <xdaq/ContextDescriptor.h>
3 #include "otsdaq-core/MessageFacility/MessageFacility.h"
11 SupervisorDescriptorInfoBase::SupervisorDescriptorInfoBase(
void)
16 SupervisorDescriptorInfoBase::~SupervisorDescriptorInfoBase()
20 void SupervisorDescriptorInfoBase::init(xdaq::ApplicationContext* applicationContext)
22 if(applicationContext->getDefaultZone()->getApplicationGroup(
"daq") == 0)
24 std::cout << __COUT_HDR_FL__ <<
"Can't find application group called \"daq\" (Must have been removed from the xdaq context configuration)" << std::endl;
29 theSupervisor_ = *(applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::Supervisor").begin());
30 if(theSupervisor_ == 0)
31 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::Supervisor\" (Must have been removed from the xdaq context configuration)" << std::endl;
33 theWizard_ = *(applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::OtsConfigurationWizardSupervisor").begin());
35 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::OtsConfigurationWizardSupervisor\" (Must have been removed from the xdaq context configuration)" << std::endl;
37 if(theWizard_ == 0 && theSupervisor_ == 0)
39 __SS__ <<
"Must have THE Supervisor (or THE OtsConfigurationWizardSupervisor) as part of the context configuration!" << std::endl;
40 __COUT_ERR__ <<
"\n" << ss.str();
41 throw std::runtime_error(ss.str());
45 theLogbookSupervisor_ = *(applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::LogbookSupervisor").begin());
46 if(theLogbookSupervisor_ == 0)
48 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::LogbookSupervisor\" (Must have been removed from the xdaq context configuration)" << std::endl;
52 theDataManagerSupervisors_.clear();
53 for(
auto& it: applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::DataManagerSupervisor"))
54 theDataManagerSupervisors_[it->getLocalId()] = it;
55 if(theDataManagerSupervisors_.size() == 0)
57 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::DataManagerSupervisor\" (Must have been removed from the xdaq context configuration)" << std::endl;
61 theFESupervisors_.clear();
62 for(
auto& it: applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::FESupervisor"))
63 theFESupervisors_[it->getLocalId()] = it;
65 if(theFESupervisors_.size() == 0)
67 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::FESupervisor\" (Must have been removed from the xdaq context configuration)" << std::endl;
71 theDTCSupervisors_.clear();
72 for(
auto& it: applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"Ph2TkDAQ::DTCSupervisor"))
73 theDTCSupervisors_[it->getLocalId()] = it;
75 if(theDTCSupervisors_.size() == 0)
77 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::DTCSupervisor\" (Must have been removed from the xdaq context configuration)" << std::endl;
81 theFEDataManagerSupervisors_.clear();
82 for(
auto& it: applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::FEDataManagerSupervisor"))
83 theFEDataManagerSupervisors_[it->getLocalId()] = it;
84 if(theFEDataManagerSupervisors_.size() == 0)
86 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::FEDataManagerSupervisor\" (Must have been removed from the xdaq context configuration)" << std::endl;
99 theARTDAQFEDataManagerSupervisors_.clear();
100 for(
auto& it: applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::ARTDAQFEDataManagerSupervisor"))
101 theARTDAQFEDataManagerSupervisors_[it->getLocalId()] = it;
102 if(theARTDAQFEDataManagerSupervisors_.size() == 0)
104 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::ARTDAQFEDataManagerSupervisor\" (Must have been removed from the xdaq context configuration)" << std::endl;
107 theARTDAQDataManagerSupervisors_.clear();
108 for(
auto& it: applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::ARTDAQDataManagerSupervisor"))
109 theARTDAQDataManagerSupervisors_[it->getLocalId()] = it;
110 if(theARTDAQDataManagerSupervisors_.size() == 0)
112 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::ARTDAQDataManagerSupervisor\" (Must have been removed from the xdaq context configuration)" << std::endl;
116 theARTDAQBuilderSupervisors_.clear();
117 for(
auto& it: applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::EventBuilderApp"))
118 theARTDAQBuilderSupervisors_[it->getLocalId()] = it;
119 if(theARTDAQBuilderSupervisors_.size() == 0)
121 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::EventBuilderApp\" (Must have been removed from the xdaq context configuration)" << std::endl;
125 theARTDAQAggregatorSupervisors_.clear();
126 for(
auto& it: applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::AggregatorApp"))
127 theARTDAQAggregatorSupervisors_[it->getLocalId()] = it;
128 if(theARTDAQAggregatorSupervisors_.size() == 0)
130 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::AggregatorApp\" (Must have been removed from the xdaq context configuration)" << std::endl;
134 theVisualSupervisors_.clear();
135 for(
auto& it: applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::VisualSupervisor"))
136 theVisualSupervisors_[it->getLocalId()] = it;
137 if(theVisualSupervisors_.size() == 0)
139 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::VisualSupervisor\" (Must have been removed from the xdaq context configuration)" << std::endl;
145 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getDataManagerDescriptors(
void)
const
147 return theDataManagerSupervisors_;
151 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getFEDescriptors(
void)
const
153 return theFESupervisors_;
157 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getDTCDescriptors(
void)
const
159 return theDTCSupervisors_;
163 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getFEDataManagerDescriptors(
void)
const
165 return theFEDataManagerSupervisors_;
174 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getARTDAQFEDataManagerDescriptors(
void)
const
176 return theARTDAQFEDataManagerSupervisors_;
179 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getARTDAQDataManagerDescriptors (
void)
const
181 return theARTDAQDataManagerSupervisors_;
185 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getARTDAQBuilderDescriptors(
void)
const
187 return theARTDAQBuilderSupervisors_;
191 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getARTDAQAggregatorDescriptors(
void)
const
193 return theARTDAQAggregatorSupervisors_;
197 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getVisualDescriptors(
void)
const
199 return theVisualSupervisors_;
203 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getSupervisorDescriptor(
void)
const
205 return theSupervisor_;
209 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getWizardDescriptor(
void)
const
215 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getLogbookDescriptor(
void)
const
217 return theLogbookSupervisor_;
221 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getVisualDescriptor(xdata::UnsignedIntegerT instance)
const
223 if(theVisualSupervisors_.find(instance) == theVisualSupervisors_.end())
224 std::cout << __COUT_HDR_FL__ <<
"Couldn't find: " << instance << std::endl;
225 return theVisualSupervisors_.find(instance)->second;
229 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getDataManagerDescriptor(xdata::UnsignedIntegerT instance)
const
231 if(theDataManagerSupervisors_.find(instance) == theDataManagerSupervisors_.end())
232 std::cout << __COUT_HDR_FL__ <<
"Couldn't find: " << instance << std::endl;
233 return theDataManagerSupervisors_.find(instance)->second;
237 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getFEDescriptor(xdata::UnsignedIntegerT instance)
const
239 if(theFESupervisors_.find(instance) == theFESupervisors_.end())
240 std::cout << __COUT_HDR_FL__ <<
"Couldn't find: " << instance << std::endl;
241 return theFESupervisors_.find(instance)->second;
245 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getDTCDescriptor(xdata::UnsignedIntegerT instance)
const
247 if(theDTCSupervisors_.find(instance) == theDTCSupervisors_.end())
248 std::cout << __COUT_HDR_FL__ <<
"Couldn't find: " << instance << std::endl;
249 return theDTCSupervisors_.find(instance)->second;
253 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getFEDataManagerDescriptor(xdata::UnsignedIntegerT instance)
const
255 if(theFEDataManagerSupervisors_.find(instance) == theFEDataManagerSupervisors_.end())
256 std::cout << __COUT_HDR_FL__ <<
"Couldn't find: " << instance << std::endl;
257 return theFEDataManagerSupervisors_.find(instance)->second;
269 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getARTDAQFEDataManagerDescriptor(xdata::UnsignedIntegerT instance)
const
271 if(theARTDAQFEDataManagerSupervisors_.find(instance) == theARTDAQFEDataManagerSupervisors_.end())
272 std::cout << __COUT_HDR_FL__ <<
"Couldn't find: " << instance << std::endl;
273 return theARTDAQFEDataManagerSupervisors_.find(instance)->second;
277 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getARTDAQDataManagerDescriptor (xdata::UnsignedIntegerT instance)
const
279 if(theARTDAQDataManagerSupervisors_.find(instance) == theARTDAQDataManagerSupervisors_.end())
280 std::cout << __COUT_HDR_FL__ <<
"Couldn't find: " << instance << std::endl;
281 return theARTDAQDataManagerSupervisors_.find(instance)->second;
285 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getARTDAQBuilderDescriptor(xdata::UnsignedIntegerT instance)
const
287 if(theARTDAQBuilderSupervisors_.find(instance) == theARTDAQBuilderSupervisors_.end())
288 std::cout << __COUT_HDR_FL__ <<
"Couldn't find: " << instance << std::endl;
289 return theARTDAQBuilderSupervisors_.find(instance)->second;
293 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getARTDAQAggregatorDescriptor(xdata::UnsignedIntegerT instance)
const
295 if(theARTDAQAggregatorSupervisors_.find(instance) == theARTDAQAggregatorSupervisors_.end())
296 std::cout << __COUT_HDR_FL__ <<
"Couldn't find: " << instance << std::endl;
297 return theARTDAQAggregatorSupervisors_.find(instance)->second;
301 std::string SupervisorDescriptorInfoBase::getFEURL(xdata::UnsignedIntegerT instance)
const
303 return getFEDescriptor(instance)->getContextDescriptor()->getURL();