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