otsdaq_demo  v2_05_02_indev
FrontEndInterfaceTemplate.cc
1 #include "otsdaq/DetectorWriter/FrontEndInterfaceTemplate.h"
2 
3 #include "otsdaq/DAQHardware/FrontEndFirmwareTemplate.h"
4 #include "otsdaq/DAQHardware/FrontEndHardwareTemplate.h"
5 
6 using namespace ots;
7 
8 #undef __MF_SUBJECT__
9 #define __MF_SUBJECT__ "FrontEndInterfaceTemplate"
10 
11 //==============================================================================
12 FrontEndInterfaceTemplate::FrontEndInterfaceTemplate(std::string name)
13  : FrontEndVirtualInterface(name)
14 {
15  theFrontEndHardware_ = new FrontEndHardwareTemplate();
16  theFrontEndFirmware_ = new FrontEndFirmwareTemplate();
17  universalAddressSize_ = 4;
18  universalDataSize_ = 4;
19 
20  __COUT__ << "FrontEndInterfaceTemplate instantiated with name: " << name << std::endl;
21 }
22 
23 //==============================================================================
24 FrontEndInterfaceTemplate::~FrontEndInterfaceTemplate(void)
25 {
26  delete theFrontEndHardware_;
27  delete theFrontEndFirmware_;
28 }
29 
30 //==============================================================================
31 void FrontEndInterfaceTemplate::configure(void) {}
32 
33 //==============================================================================
34 void FrontEndInterfaceTemplate::halt(void) {}
35 
36 //==============================================================================
37 void FrontEndInterfaceTemplate::pause(void) {}
38 
39 //==============================================================================
40 void FrontEndInterfaceTemplate::resume(void) {}
41 
42 //==============================================================================
43 void FrontEndInterfaceTemplate::start(std::string) // runNumber)
44 {
45 }
46 
47 //==============================================================================
48 void FrontEndInterfaceTemplate::stop(void) {}
49 
50 //==============================================================================
51 bool FrontEndInterfaceTemplate::running(void)
52 {
53  while(WorkLoop::continueWorkLoop_)
54  {
55  break; // exit workloop
56  }
57  return false;
58 }
59 
60 //==============================================================================
61 // universalRead
62 // Must implement this function for Macro Maker to work with this interface.
63 // When Macro Maker calls:
64 // - address will be a [universalAddressSize_] byte long char array
65 // - returnValue will be a [universalDataSize_] byte long char array
66 // - expects return value of 0 on success and negative numbers on failure
67 int FrontEndInterfaceTemplate::universalRead(char* address, char* returnValue)
68 {
69  // TODO - implement the read for this interface
70  return -1; // failed
71 }
72 
73 //==============================================================================
74 // universalWrite
75 // Must implement this function for Macro Maker to work with this interface.
76 // When Macro Maker calls:
77 // - address will be a [universalAddressSize_] byte long char array
78 // - writeValue will be a [universalDataSize_] byte long char array
79 void FrontEndInterfaceTemplate::universalWrite(char* address, char* writeValue)
80 {
81  // TODO - implement the write for this interface
82 }
83 
84 DEFINE_OTS_INTERFACE(FrontEndInterfaceTemplate)