My Project
 All Classes Files Functions Variables Enumerations Enumerator Friends Macros Pages
DioBoloClient.h
Go to the documentation of this file.
1 #ifndef GCP_RECEIVER_DIOBOLOCLIENT_H
2 #define GCP_RECEIVER_DIOBOLOCLIENT_H
3 
13 #include "gcp/util/common/RegDate.h"
14 
15 #include "gcp/receiver/specific/BoloDoubleBuffer.h"
16 #include "gcp/receiver/specific/DioClient.h"
17 #include "gcp/control/code/unix/libunix_src/specific/specificregs.h"
18 
19 #define BOLO_DEBUG
20 
21 namespace gcp {
22  namespace receiver {
23 
24  class DioBoloClient : public DioClient {
25  public:
26 
27  // Constructor.
28 
29  DioBoloClient(std::string dioHost, unsigned short dioPort,
30  std::string hwHost, unsigned short hwPort,
31  unsigned int nSamplesPerSecond,
32  unsigned npix);
33 
34  // Destructor.
35 
36  virtual ~DioBoloClient();
37 
38  // Add a single sample of DIO data to the buffer
39 
41  vector<MuxReadout::DIODatum>& data,
42  bool isValid);
43 
45 
46  void releaseReadFrame();
47 
48  // Over load the base-class method to initialize the channels we
49  // will read from
50 
51  void initializeChannels();
52 
53  // Overload the base-class method to set up the filter function
54  // for this client
55 
56  void setUpFilter();
57 
58  // Overload the baseclass method to archive the filter values
59 
60  void archiveFilterValues(gcp::util::Frequency& freq, unsigned ntaps);
61 
62  // Overload the baseclass method to archive the subsampling rate
63 
64  void archiveSubSampling(unsigned sampling);
65 
66  // Copy stored values of persistent items into the register
67  // frame
68 
70 
71  private:
72 
73  // Switch buffers in our double-buffering scheme and reset
74  // pointers
75 
76  void switchBuffers();
77 
78  void bufferId(std::string id, unsigned iBolo);
79  void bufferPixelXY(std::vector<double> xy, unsigned iBolo);
80 
81  // The double buffer to which we will record data
82 
83  BoloDoubleBuffer buffer_;
84 
85  // Pointers to specific memory locations in the frame to which
86  // we will record data
87 
88  gcp::util::RegDate::Data* frameUtcPtr_;
89  unsigned int* frameRecordPtr_;
90  gcp::util::RegDate::Data* boloUtcPtr_;
91  float* acPtr_;
92  float* dtPtr_;
93  double* xyPtr_;
94 
95  unsigned nPixel_;
96 
97  float filterFreqHz_;
98  unsigned filterNtaps_;
99  unsigned subSampling_;
100  unsigned char ids_[NUM_BOLOMETERS * DIO_ID_LEN];
101  double xy_[NUM_BOLOMETERS * 2];
102 
103  }; // End class DioBoloClient
104 
105  } // End namespace receiver
106 } // End namespace gcp
107 
108 
109 
110 #endif // End #ifndef GCP_RECEIVER_DIOBOLOCLIENT_H
void archiveSubSampling(unsigned sampling)
Definition: DioBoloClient.cc:190
Definition: DioClient.h:28
void setUpFilter()
Definition: DioBoloClient.cc:213
Definition: RegDate.h:22
void addSampleToBuffer(gcp::util::RegDate &date, vector< MuxReadout::DIODatum > &data, bool isValid)
Definition: DioBoloClient.cc:116
void releaseReadFrame()
Definition: DioBoloClient.cc:172
void initializeChannels()
Definition: DioBoloClient.cc:46
Definition: DioBoloClient.h:24
void archiveFilterValues(gcp::util::Frequency &freq, unsigned ntaps)
Definition: DioBoloClient.cc:180
gcp::util::RegMapDataFrameManager * grabReadFrame()
Definition: DioBoloClient.cc:164
virtual ~DioBoloClient()
Definition: DioBoloClient.cc:111
Definition: ArrayMapDataFrameManager.h:28
void copyPersistentRegs(gcp::util::ArrayMapDataFrameManager *frame)
Definition: DioBoloClient.cc:200
Definition: BoloDoubleBuffer.h:23
Definition: RegDate.h:19
DioBoloClient(std::string dioHost, unsigned short dioPort, std::string hwHost, unsigned short hwPort, unsigned int nSamplesPerSecond, unsigned npix)
Definition: DioBoloClient.cc:20
Definition: RegMapDataFrameManager.h:26
Definition: Frequency.h:21