otsdaq  v2_00_00
FEVInterfacesManager.h
1 #ifndef _ots_FEVInterfacesManager_h_
2 #define _ots_FEVInterfacesManager_h_
3 
4 //#include "artdaq/Application/MPI2/MPISentry.hh"
5 //#include "artdaq/DAQrate/quiet_mpi.hh"
6 #include "otsdaq-core/FiniteStateMachine/VStateMachine.h"
7 #include "otsdaq-core/Configurable/Configurable.h"
8 
9 #include <map>
10 #include <string>
11 #include <memory>
12 
13 namespace ots
14 {
15 class FEVInterface;
16 
18 {
19 public:
20 
21  FEVInterfacesManager(const ConfigurationTree& theXDAQContextConfigTree, const std::string& supervisorConfigurationPath);
22  virtual ~FEVInterfacesManager(void);
23 
24  //Methods
25  void init (void);
26  void destroy (void);
27  void createInterfaces (void);
28 
29  //State Machine Methods
30  void configure (void);
31  void halt (void);
32  void initialize (void);
33  void pause (void);
34  void resume (void);
35  void start (std::string runNumber);
36  void stop (void);
37 
38 
39 
40  int universalRead (const std::string &interfaceID, char* address, char* returnValue); //used by MacroMaker
41  void universalWrite (const std::string &interfaceID, char* address, char* writeValue); //used by MacroMaker
42  std::string getFEListString (const std::string &supervisorLid); //used by MacroMaker
43  std::string getFEMacrosString (const std::string &supervisorLid); //used by MacroMaker
44  void runFEMacro (const std::string &interfaceID, const std::string &feMacroName, const std::string &inputArgs, std::string &outputArgs); //used by MacroMaker
45  unsigned int getInterfaceUniversalAddressSize (const std::string &interfaceID); //used by MacroMaker
46  unsigned int getInterfaceUniversalDataSize (const std::string &interfaceID); //used by MacroMaker
47  bool allFEWorkloopsAreDone (void); //used by Iterator, e.g.
48 
49  //void progDAC (std::string dacName, std::string rocName="*");
50  //void write (long long address, const std::vector<long long>& data);
51  //void read (long long address, std::vector<long long>& data);
52 // void initHardware (void);
53 
54 
55 
56 protected:
57 // virtual std::unique_ptr<FEVInterface> interpretInterface (
58 // const unsigned int interfaceId,
59 // const std::string typeName, const std::string firmwareName,
60 // const FEInterfaceConfigurationBase* frontEndHardwareConfiguration);
61 
62 private:
63 
64 
65  std::map<std::string /*name*/, std::unique_ptr<FEVInterface> > theFEInterfaces_;
66 
67 };
68 
69 }
70 
71 #endif