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)
38 throw std::runtime_error(
"Must have THE Supervisor (or THE OtsConfigurationWizardSupervisor) as part of the context configuration!");
41 theLogbookSupervisor_ = *(applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::LogbookSupervisor").begin());
42 if(theLogbookSupervisor_ == 0)
44 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::LogbookSupervisor\" (Must have been removed from the xdaq context configuration)" << std::endl;
48 theDataManagerSupervisors_.clear();
49 for(
auto& it: applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::DataManagerSupervisor"))
50 theDataManagerSupervisors_[it->getLocalId()] = it;
51 if(theDataManagerSupervisors_.size() == 0)
53 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::DataManagerSupervisor\" (Must have been removed from the xdaq context configuration)" << std::endl;
57 theFESupervisors_.clear();
58 for(
auto& it: applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::FESupervisor"))
59 theFESupervisors_[it->getLocalId()] = it;
61 if(theFESupervisors_.size() == 0)
63 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::FESupervisor\" (Must have been removed from the xdaq context configuration)" << std::endl;
67 theFEDataManagerSupervisors_.clear();
68 for(
auto& it: applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::FEDataManagerSupervisor"))
69 theFEDataManagerSupervisors_[it->getLocalId()] = it;
70 if(theFEDataManagerSupervisors_.size() == 0)
72 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::FEDataManagerSupervisor\" (Must have been removed from the xdaq context configuration)" << std::endl;
85 theARTDAQFEDataManagerSupervisors_.clear();
86 for(
auto& it: applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::ARTDAQFEDataManagerSupervisor"))
87 theARTDAQFEDataManagerSupervisors_[it->getLocalId()] = it;
88 if(theARTDAQFEDataManagerSupervisors_.size() == 0)
90 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::ARTDAQFEDataManagerSupervisor\" (Must have been removed from the xdaq context configuration)" << std::endl;
93 theARTDAQDataManagerSupervisors_.clear();
94 for(
auto& it: applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::ARTDAQDataManagerSupervisor"))
95 theARTDAQDataManagerSupervisors_[it->getLocalId()] = it;
96 if(theARTDAQDataManagerSupervisors_.size() == 0)
98 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::ARTDAQDataManagerSupervisor\" (Must have been removed from the xdaq context configuration)" << std::endl;
102 theARTDAQBuilderSupervisors_.clear();
103 for(
auto& it: applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::EventBuilderApp"))
104 theARTDAQBuilderSupervisors_[it->getLocalId()] = it;
105 if(theARTDAQBuilderSupervisors_.size() == 0)
107 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::EventBuilderApp\" (Must have been removed from the xdaq context configuration)" << std::endl;
111 theARTDAQAggregatorSupervisors_.clear();
112 for(
auto& it: applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::AggregatorApp"))
113 theARTDAQAggregatorSupervisors_[it->getLocalId()] = it;
114 if(theARTDAQAggregatorSupervisors_.size() == 0)
116 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::AggregatorApp\" (Must have been removed from the xdaq context configuration)" << std::endl;
120 theVisualSupervisors_.clear();
121 for(
auto& it: applicationContext->getDefaultZone()->getApplicationGroup(
"daq")->getApplicationDescriptors(
"ots::VisualSupervisor"))
122 theVisualSupervisors_[it->getLocalId()] = it;
123 if(theVisualSupervisors_.size() == 0)
125 std::cout << __COUT_HDR_FL__ <<
"Can't find application descriptor called \"ots::VisualSupervisor\" (Must have been removed from the xdaq context configuration)" << std::endl;
131 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getDataManagerDescriptors(
void)
const
133 return theDataManagerSupervisors_;
137 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getFEDescriptors(
void)
const
139 return theFESupervisors_;
143 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getFEDataManagerDescriptors(
void)
const
145 return theFEDataManagerSupervisors_;
154 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getARTDAQFEDataManagerDescriptors(
void)
const
156 return theARTDAQFEDataManagerSupervisors_;
159 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getARTDAQDataManagerDescriptors (
void)
const
161 return theARTDAQDataManagerSupervisors_;
165 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getARTDAQBuilderDescriptors(
void)
const
167 return theARTDAQBuilderSupervisors_;
171 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getARTDAQAggregatorDescriptors(
void)
const
173 return theARTDAQAggregatorSupervisors_;
177 const SupervisorDescriptors& SupervisorDescriptorInfoBase::getVisualDescriptors(
void)
const
179 return theVisualSupervisors_;
183 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getSupervisorDescriptor(
void)
const
185 return theSupervisor_;
189 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getWizardDescriptor(
void)
const
195 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getLogbookDescriptor(
void)
const
197 return theLogbookSupervisor_;
201 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getVisualDescriptor(xdata::UnsignedIntegerT instance)
const
203 if(theVisualSupervisors_.find(instance) == theVisualSupervisors_.end())
204 std::cout << __COUT_HDR_FL__ <<
"Couldn't find: " << instance << std::endl;
205 return theVisualSupervisors_.find(instance)->second;
209 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getDataManagerDescriptor(xdata::UnsignedIntegerT instance)
const
211 if(theDataManagerSupervisors_.find(instance) == theDataManagerSupervisors_.end())
212 std::cout << __COUT_HDR_FL__ <<
"Couldn't find: " << instance << std::endl;
213 return theDataManagerSupervisors_.find(instance)->second;
217 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getFEDescriptor(xdata::UnsignedIntegerT instance)
const
219 if(theFESupervisors_.find(instance) == theFESupervisors_.end())
220 std::cout << __COUT_HDR_FL__ <<
"Couldn't find: " << instance << std::endl;
221 return theFESupervisors_.find(instance)->second;
225 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getFEDataManagerDescriptor(xdata::UnsignedIntegerT instance)
const
227 if(theFEDataManagerSupervisors_.find(instance) == theFEDataManagerSupervisors_.end())
228 std::cout << __COUT_HDR_FL__ <<
"Couldn't find: " << instance << std::endl;
229 return theFEDataManagerSupervisors_.find(instance)->second;
241 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getARTDAQFEDataManagerDescriptor(xdata::UnsignedIntegerT instance)
const
243 if(theARTDAQFEDataManagerSupervisors_.find(instance) == theARTDAQFEDataManagerSupervisors_.end())
244 std::cout << __COUT_HDR_FL__ <<
"Couldn't find: " << instance << std::endl;
245 return theARTDAQFEDataManagerSupervisors_.find(instance)->second;
249 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getARTDAQDataManagerDescriptor (xdata::UnsignedIntegerT instance)
const
251 if(theARTDAQDataManagerSupervisors_.find(instance) == theARTDAQDataManagerSupervisors_.end())
252 std::cout << __COUT_HDR_FL__ <<
"Couldn't find: " << instance << std::endl;
253 return theARTDAQDataManagerSupervisors_.find(instance)->second;
257 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getARTDAQBuilderDescriptor(xdata::UnsignedIntegerT instance)
const
259 if(theARTDAQBuilderSupervisors_.find(instance) == theARTDAQBuilderSupervisors_.end())
260 std::cout << __COUT_HDR_FL__ <<
"Couldn't find: " << instance << std::endl;
261 return theARTDAQBuilderSupervisors_.find(instance)->second;
265 XDAQ_CONST_CALL xdaq::ApplicationDescriptor* SupervisorDescriptorInfoBase::getARTDAQAggregatorDescriptor(xdata::UnsignedIntegerT instance)
const
267 if(theARTDAQAggregatorSupervisors_.find(instance) == theARTDAQAggregatorSupervisors_.end())
268 std::cout << __COUT_HDR_FL__ <<
"Couldn't find: " << instance << std::endl;
269 return theARTDAQAggregatorSupervisors_.find(instance)->second;
273 std::string SupervisorDescriptorInfoBase::getFEURL(xdata::UnsignedIntegerT instance)
const
275 return getFEDescriptor(instance)->getContextDescriptor()->getURL();