1 #ifndef _ots_DTCFrontEndInterface_h_
2 #define _ots_DTCFrontEndInterface_h_
8 #include "dtcInterfaceLib/DTC.h"
9 #include "dtcInterfaceLib/DTCSoftwareCFO.h"
10 #include "mu2e_driver/mu2e_mmap_ioctl.h"
11 #include "otsdaq-mu2e/CFOandDTCCore/CFOandDTCCoreVInterface.h"
12 #include "otsdaq-mu2e/ROCCore/ROCCoreVInterface.h"
24 const ConfigurationTree& theXDAQContextConfigTree,
25 const std::string& interfaceConfigurationPath);
31 virtual void configureSlowControls (
void)
override;
32 virtual void resetSlowControlsChannelIterator (
void)
override;
33 virtual FESlowControlsChannel* getNextSlowControlsChannel (
void)
override;
34 virtual unsigned int getSlowControlsChannelCount (
void)
override;
35 virtual void getSlowControlsValue (FESlowControlsChannel& channel, std::string& readValue)
override;
37 bool currentChannelIsInROC_;
38 std::string currentChannelROCUID_;
43 void configure (
void);
47 void start (std::string runNumber);
53 void emulatorConfigure (
void);
65 virtual void readStatus (
void)
override;
72 bool ROCActive (
unsigned int ROC_link);
73 int getROCLinkStatus (
int ROC_link);
74 int getCFOLinkStatus (
void);
75 int checkLinkStatus (
void);
77 DTCLib::DTC* thisDTC_;
80 void createROCs (
void);
81 void registerFEMacros (
void);
86 int dtc_location_in_chain_ = -1;
88 unsigned roc_mask_ = 0;
92 DTCLib::DTCSoftwareCFO* EmulatedCFO_;
94 std::ofstream datafile_[8];
96 std::map<std::string ,
97 std::unique_ptr<ROCCoreVInterface>> rocs_;
99 std::map<std::string ,
100 std::pair<std::string ,
101 std::string >> rocFEMacroMap_;
103 std::map<std::string ,
104 FESlowControlsChannel> mapOfROCSlowControlsChannels_;
106 m_ioc_reg_access_t reg_access_;
108 unsigned initial_9100_ = 0;
109 unsigned initial_9114_ = 0;
111 std::ofstream outputStream;
114 void ReadROC (__ARGS__);
115 void WriteROC (__ARGS__);
116 void WriteROCBlock (__ARGS__);
117 void ReadROCBlock (__ARGS__);
118 void BlockReadROC (__ARGS__);
119 void DTCHighRateBlockCheck (__ARGS__);
120 void DTCReset (__ARGS__);
121 void DTCReset (
void);
122 void DTCHighRateDCSCheck (__ARGS__);
123 void RunROCFEMacro (__ARGS__);
124 void DTCSendHeartbeatAndDataRequest(__ARGS__);