tdaq-develop-2025-02-12
InterfacePluginTestMain.cc
1 // #include <otsdaq_demo/otsdaq-demo/FEInterfaces/FEWROtsUDPFSSRInterface.h>
2 // #include <otsdaq_demo/otsdaq-demo/UserConfigurationDataFormats/FEWROtsUDPFSSRInterfaceConfiguration.h>
3 #include "otsdaq/ConfigurationInterface/ConfigurationManager.h"
4 #include "otsdaq/FECore/FEVInterfacesManager.h"
5 // #include "otsdaq/TableDataFormats/TableGroupKey.h"
6 
7 // #include "otsdaq-demo/FEInterfaces/FEWOtsGenericInterface.h"
8 #include "otsdaq/FECore/FEVInterface.h"
9 
10 #include <iostream>
11 #include <memory>
12 
13 #include "otsdaq/ConfigurationInterface/ConfigurationInterface.h"
14 #include "otsdaq/FECore/MakeInterface.h"
15 #include "otsdaq/TableCore/MakeTable.h"
16 
17 // #include "otsdaq-components/FEInterfaces/FEWOtsUDPFSSRInterface.h"
18 // #include "otsdaq-components/FEInterfaces/FEWOtsUDPHCALInterface.h"
19 
20 using namespace ots;
21 
22 int main()
23 {
24  // Variables
25  std::string supervisorContextUID_ = "MainContext";
26  std::string supervisorApplicationUID_ = "FeSupervisor0";
27  std::string ConfigurationAlias_ = "Physics";
28  std::string theSupervisorConfigurationPath_ =
29  supervisorContextUID_ + "/LinkToApplicationTable/" + supervisorApplicationUID_ +
30  "/LinkToSupervisorTable";
31  // const int TableGroupKeyValue_ = 0;
32  // std::shared_ptr<TableGroupKey> theConfigurationTableGroupKey_(new
33  // TableGroupKey(TableGroupKeyValue_));
34 
36  // INSERTED GLOBALLY IN THE CODE
37  ConfigurationManager* theConfigurationManager_ = new ConfigurationManager;
38  FEVInterfacesManager theFEVInterfacesManager_(
39  theConfigurationManager_->getNode(ConfigurationManager::XDAQ_CONTEXT_TABLE_NAME),
40  theSupervisorConfigurationPath_);
41 
42  std::pair<std::string /*group name*/, TableGroupKey> theGroup =
43  theConfigurationManager_->getTableGroupFromAlias(ConfigurationAlias_);
44 
45  theConfigurationManager_->loadTableGroup(theGroup.first, theGroup.second, true);
46 
47  theFEVInterfacesManager_.configure();
49  exit(0);
51  // Getting just the informations about the FEWInterface
52 
53  // const std::string feId_ = "0";
54  // ConfigurationInterface* theInterface_;
55  // theInterface_ = ConfigurationInterface::getInstance(true);//FIXME This will be
56  // variable because if false it takes it from the database Configurations*
57  // configurations = 0;
58  // theInterface_->get((TableBase*&)configurations,"Configurations");
59  // TableBase* frontEndConfiguration = 0;
60  // theInterface_->get(frontEndConfiguration, "FEConfiguration",
61  // theConfigurationTableGroupKey_,
62  // configurations);
63  //
64  // const std::string interfaceName = "FEOtsUDPFSSRInterface";
65  // const std::string configurationName = interfaceName + "Table";
66  //
67  // //FEWOtsUDPHardwareConfiguration* interfaceConfiguration_ = 0;
68  //
69  // TableBase* interfaceConfiguration_ =
70  // 0;//makeConfigurationInterface(configurationName);
71  //
72  // if(configurations->findKOC(*theConfigurationTableGroupKey_,configurationName))
73  // {
74  // theInterface_->get(interfaceConfiguration_, configurationName,
75  // theConfigurationTableGroupKey_, configurations);
76  // }
77  //
78  // std::unique_ptr<FEVInterface> theFEWInterface = makeInterface(interfaceName,
79  // feId_, (FEInterfaceTableBase*)interfaceConfiguration_);
80 
82 
83  return 0;
84 }
void loadTableGroup(const std::string &tableGroupName, const TableGroupKey &tableGroupKey, bool doActivate=false, std::map< std::string, TableVersion > *groupMembers=0, ProgressBar *progressBar=0, std::string *accumulateWarnings=0, std::string *groupComment=0, std::string *groupAuthor=0, std::string *groupCreateTime=0, bool doNotLoadMember=false, std::string *groupTypeString=0, std::map< std::string, std::string > *groupAliases=0, ConfigurationManager::LoadGroupType onlyLoadIfBackboneOrContext=ConfigurationManager::LoadGroupType::ALL_TYPES, bool ignoreVersionTracking=false)
ConfigurationTree getNode(const std::string &nodeString, bool doNotThrowOnBrokenUIDLinks=false) const
"root/parent/parent/"
std::pair< std::string, TableGroupKey > getTableGroupFromAlias(std::string systemAlias, ProgressBar *progressBar=0)
Getters.