1 #ifndef ROACHBACKENDMSG_H
2 #define ROACHBACKENDMSG_H
14 #include <netinet/in.h>
17 #include "gcp/util/common/Exception.h"
18 #include "gcp/util/common/LogStream.h"
20 #include "gcp/util/common/GenericTaskMsg.h"
24 #include "gcp/control/code/unix/libunix_src/common/netobj.h"
25 #include "gcp/util/common/Debug.h"
26 #include "gcp/util/specific/Directives.h"
32 #define ROACH_DATA_MAX_LEN 40000
33 #define MILLI_SECOND_SAMPLE_RATE 10
34 #define MAX_RESPONSE_SAMPLES 1000/MILLI_SECOND_SAMPLE_RATE*6*2*64
37 #define NUM_ROACH_INTEGRATION_PER_TRANSFER 10
38 #define NUM_CHANNELS_PER_BAND 32
41 #define kDataperPacket 10
42 #define vectorLength 32 //size of FFT (32)
43 #define kMax32bitchans 320 //size of vector to store data (kDataperPacket*vectorLenght
45 #define CC_TO_SEC 128/250000000
47 #define DEFAULT_NUMBER_BYTES_PER_TRANSFER 17680
119 int numBytesExpected_;
125 int numBytesReceived_;
162 std::vector<int> bufferBacklog_;
163 std::vector<int> tstart_;
164 std::vector<int> seconds_;
165 std::vector<int> useconds_;
166 std::vector<int> switchstatus_;
167 std::vector<float> Coeffs_;
174 std::vector<std::vector< std::vector<float> > > LL_;
175 std::vector<std::vector<std::vector<float> > > RR_;
176 std::vector<std::vector<std::vector<float> > > Q_;
177 std::vector<std::vector<std::vector<float> > > U_;
178 std::vector<std::vector<std::vector<float> > > TL1_;
179 std::vector<std::vector<std::vector<float> > > TL2_;
182 std::vector<std::vector<float> > LL_;
183 std::vector<std::vector<float> > RR_;
184 std::vector<std::vector<float> > Q_;
185 std::vector<std::vector<float> > U_;
186 std::vector<std::vector<float> > TL1_;
187 std::vector<std::vector<float> > TL2_;
222 int data_ch0odd[kDataperPacket*vectorLength];
223 int data_ch0even[kDataperPacket*vectorLength];
224 int data_ch1odd[kDataperPacket*vectorLength];
225 int data_ch1even[kDataperPacket*vectorLength];
226 int data_ch2odd[kDataperPacket*vectorLength];
227 int data_ch2even[kDataperPacket*vectorLength];
228 int data_ch3odd[kDataperPacket*vectorLength];
229 int data_ch3even[kDataperPacket*vectorLength];
230 int data_ch4odd[kDataperPacket*vectorLength];
231 int data_ch4even[kDataperPacket*vectorLength];
232 int data_ch5odd[kDataperPacket*vectorLength];
233 int data_ch5even[kDataperPacket*vectorLength];
234 int data_switchstatus[kDataperPacket];
235 int secondIntegration[kDataperPacket];
271 inline void packReadDataMsg()
274 gcp::util::GenericTaskMsg::TASK_SPECIFIC;
279 numBytesExpected_ = DEFAULT_NUMBER_BYTES_PER_TRANSFER;
291 gcp::util::GenericTaskMsg::TASK_SPECIFIC;
302 inline void packConnectMsg()
305 gcp::util::GenericTaskMsg::TASK_SPECIFIC;
313 inline void packDisconnectMsg()
316 gcp::util::GenericTaskMsg::TASK_SPECIFIC;
325 inline void packRoachCmdMsg(std::string stringCommand)
328 gcp::util::GenericTaskMsg::TASK_SPECIFIC;
333 numBytesExpected_ = 12;
347 #endif // End #ifndef
Definition: GenericTaskMsg.h:31
RoachBackendMsg()
Definition: RoachBackendMsg.cc:25
void Assign3DVectorMemory()
Definition: RoachBackendMsg.cc:221
std::string expectedResponse_
Definition: RoachBackendMsg.h:118
unsigned short cmdSize_
Definition: RoachBackendMsg.h:103
void PrintData()
Definition: RoachBackendMsg.cc:328
int version_
Definition: RoachBackendMsg.h:158
unsigned char readData_[ROACH_DATA_MAX_LEN]
Definition: RoachBackendMsg.h:153
~RoachBackendMsg()
Definition: RoachBackendMsg.cc:38
double currTime_
Definition: RoachBackendMsg.h:79
GenericMsgType genericMsgType_
Definition: GenericTaskMsg.h:50
bool simpleValidityCheck()
void packCommand(Request req)
float responseValue_[MAX_RESPONSE_SAMPLES]
Definition: RoachBackendMsg.h:208
bool responseValid_
Definition: RoachBackendMsg.h:193
int packetizeNetworkMsg()
Definition: RoachBackendMsg.cc:44
Definition: RoachBackendMsg.h:59
Definition: RoachBackendMsg.h:211
double getTimeInSeconds() const
Definition: TimeVal.cc:589
bool responseValueValid_
Definition: RoachBackendMsg.h:203
bool responseGood_
Definition: RoachBackendMsg.h:198
std::string messageToSend_
Definition: RoachBackendMsg.h:108
char responseReceived_[DEFAULT_NUMBER_BYTES_PER_TRANSFER]
Definition: RoachBackendMsg.h:124
Request
Definition: RoachBackendMsg.h:84
bool expectsResponse_
Definition: RoachBackendMsg.h:113
unsigned char request_
Definition: RoachBackendMsg.h:98
void Assign2DVectorMemory()
Definition: RoachBackendMsg.cc:279