some small changes

This commit is contained in:
Dhanya Maliakal 2015-11-05 12:05:31 +01:00
parent e9f51e2ef5
commit 667c1c0304
2 changed files with 98 additions and 85 deletions

View File

@ -31,7 +31,7 @@ using namespace std;
*************************************************************************/
UDPStandardImplementation::UDPStandardImplementation(){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
initializeMembers();
@ -59,7 +59,7 @@ UDPStandardImplementation::UDPStandardImplementation(){
}
UDPStandardImplementation::~UDPStandardImplementation(){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
closeFile();
deleteMembers();
}
@ -73,7 +73,7 @@ UDPStandardImplementation::~UDPStandardImplementation(){
/***initial parameters***/
void UDPStandardImplementation::deleteMembers(){
FILE_LOG(logDEBUG1) << __AT__ << " starting";
FILE_LOG(logDEBUG) << __AT__ << " starting";
FILE_LOG(logDEBUG) << "Info: Deleting member pointers";
shutDownUDPSockets();
@ -95,7 +95,7 @@ void UDPStandardImplementation::deleteMembers(){
}
void UDPStandardImplementation::deleteFilter(){
FILE_LOG(logDEBUG1) << __AT__ << " starting";
FILE_LOG(logDEBUG) << __AT__ << " starting";
moenchCommonModeSubtraction = NULL;
for(int i=0; i<MAX_NUMBER_OF_WRITER_THREADS; i++){
@ -111,7 +111,7 @@ void UDPStandardImplementation::deleteFilter(){
}
void UDPStandardImplementation::initializeBaseMembers(){
FILE_LOG(logDEBUG1) << __AT__ << " starting";
FILE_LOG(logDEBUG) << __AT__ << " starting";
UDPBaseImplementation::initializeMembers();
acquisitionPeriod = SAMPLE_TIME_IN_NS;
@ -119,7 +119,7 @@ void UDPStandardImplementation::initializeBaseMembers(){
void UDPStandardImplementation::initializeMembers(){
FILE_LOG(logDEBUG1) << __AT__ << " starting";
FILE_LOG(logDEBUG) << __AT__ << " starting";
FILE_LOG(logDEBUG) << "Info: Initializing members";
@ -207,7 +207,7 @@ void UDPStandardImplementation::initializeMembers(){
void UDPStandardImplementation::initializeFilter(){
FILE_LOG(logDEBUG1) << __AT__ << " starting";
FILE_LOG(logDEBUG) << __AT__ << " starting";
double hc = 0, sigma = 5;
int sign = 1, csize, i;
@ -249,7 +249,7 @@ void UDPStandardImplementation::initializeFilter(){
int UDPStandardImplementation::setupFifoStructure(){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
int64_t i;
int oldNumberofJobsPerBuffer = numberofJobsPerBuffer;
@ -356,7 +356,7 @@ int UDPStandardImplementation::setupFifoStructure(){
void UDPStandardImplementation::configure(map<string, string> config_map){
FILE_LOG(logDEBUG1) << __AT__ << " starting";
FILE_LOG(logDEBUG) << __AT__ << " starting";
map<string, string>::const_iterator pos;
pos = config_map.find("mode");
@ -375,7 +375,7 @@ void UDPStandardImplementation::configure(map<string, string> config_map){
/***file parameters***/
int UDPStandardImplementation::setDataCompressionEnable(const bool b){
FILE_LOG(logDEBUG1) << __AT__ << " starting";
FILE_LOG(logDEBUG) << __AT__ << " starting";
if(myDetectorType != EIGER){
cout << "Info: Setting up Data Compression Enable to " << stringEnable(b);
@ -419,7 +419,7 @@ int UDPStandardImplementation::setDataCompressionEnable(const bool b){
/***acquisition parameters***/
void UDPStandardImplementation::setShortFrameEnable(const int i){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
shortFrameEnable = i;
@ -456,7 +456,7 @@ void UDPStandardImplementation::setShortFrameEnable(const int i){
int UDPStandardImplementation::setFrameToGuiFrequency(const uint32_t i){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
FrameToGuiFrequency = i;
if(setupFifoStructure() == FAIL)
@ -469,7 +469,7 @@ int UDPStandardImplementation::setFrameToGuiFrequency(const uint32_t i){
int UDPStandardImplementation::setAcquisitionPeriod(const uint64_t i){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
acquisitionPeriod = i;
if(setupFifoStructure() == FAIL)
@ -482,7 +482,7 @@ int UDPStandardImplementation::setAcquisitionPeriod(const uint64_t i){
}
int UDPStandardImplementation::setDynamicRange(const uint32_t i){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
uint32_t oldDynamicRange = dynamicRange;
@ -536,7 +536,7 @@ int UDPStandardImplementation::setDynamicRange(const uint32_t i){
int UDPStandardImplementation::setTenGigaEnable(const bool b){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
FILE_LOG(logDEBUG) << "Info: Setting Ten Giga to " << stringEnable(b);
bool oldTenGigaEnable = tengigaEnable;
@ -618,7 +618,7 @@ int UDPStandardImplementation::setTenGigaEnable(const bool b){
/***initial functions***/
int UDPStandardImplementation::setDetectorType(const detectorType d){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
FILE_LOG(logDEBUG) << "Setting receiver type";
@ -751,7 +751,7 @@ int UDPStandardImplementation::setDetectorType(const detectorType d){
/***acquisition functions***/
void UDPStandardImplementation::resetAcquisitionCount(){
FILE_LOG(logDEBUG1) << __AT__ << " starting";
FILE_LOG(logDEBUG) << __AT__ << " starting";
totalPacketsCaught = 0;
acqStarted = false;
@ -762,7 +762,7 @@ void UDPStandardImplementation::resetAcquisitionCount(){
int UDPStandardImplementation::startReceiver(char *c){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
cout << "Starting Receiver" << endl;
@ -862,7 +862,7 @@ int UDPStandardImplementation::startReceiver(char *c){
* Post: udp sockets shut down, status is idle, semaphores destroyed
* */
void UDPStandardImplementation::stopReceiver(){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
cout << "Stopping Receiver" << endl;
@ -893,7 +893,7 @@ void UDPStandardImplementation::stopReceiver(){
int UDPStandardImplementation::shutDownUDPSockets(){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
FILE_LOG(logDEBUG) << "Info: Shutting down UDP Socket(s)";
@ -915,7 +915,7 @@ int UDPStandardImplementation::shutDownUDPSockets(){
* Post:udp sockets closed, status is transmitting
* */
void UDPStandardImplementation::startReadout(){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
FILE_LOG(logDEBUG) << "Info: Transmitting last data";
@ -943,7 +943,7 @@ void UDPStandardImplementation::startReadout(){
void UDPStandardImplementation::readFrame(char* c,char** raw, uint64_t &startAcq, uint64_t &startFrame){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
//point to gui data, to let writer thread know that gui is back for data
if (guiData == NULL){
@ -993,7 +993,7 @@ void UDPStandardImplementation::readFrame(char* c,char** raw, uint64_t &startAcq
void UDPStandardImplementation::closeFile(int i){
FILE_LOG(logDEBUG1) << __AT__ << " called for " << i ;
FILE_LOG(logDEBUG) << __AT__ << " called for " << i ;
//normal
if(!dataCompressionEnable){
@ -1054,7 +1054,7 @@ void UDPStandardImplementation::closeFile(int i){
int UDPStandardImplementation::createListeningThreads(bool destroy){
FILE_LOG(logDEBUG1) << __AT__ << " starting";
FILE_LOG(logDEBUG) << __AT__ << " starting";
//reset masks
killAllListeningThreads = false;
@ -1104,7 +1104,7 @@ int UDPStandardImplementation::createListeningThreads(bool destroy){
int UDPStandardImplementation::createWriterThreads(bool destroy){
FILE_LOG(logDEBUG1) << __AT__ << " starting";
FILE_LOG(logDEBUG) << __AT__ << " starting";
//reset masks
killAllWritingThreads = false;
@ -1157,7 +1157,7 @@ int UDPStandardImplementation::createWriterThreads(bool destroy){
void UDPStandardImplementation::setThreadPriorities(){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
struct sched_param tcp_param, listen_param, write_param;
bool rights = true;
@ -1193,7 +1193,7 @@ void UDPStandardImplementation::setThreadPriorities(){
int UDPStandardImplementation::createUDPSockets(){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
//switching ports if bottom enabled
uint32_t port[2];
@ -1247,7 +1247,7 @@ int UDPStandardImplementation::createUDPSockets(){
int UDPStandardImplementation::setupWriter(){
FILE_LOG(logDEBUG1) << __AT__ << " starting";
FILE_LOG(logDEBUG) << __AT__ << " starting";
//acquisition start call back returns enable write
cbAction = DO_EVERYTHING;
@ -1297,7 +1297,7 @@ int UDPStandardImplementation::setupWriter(){
int UDPStandardImplementation::createNewFile(){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
int index = 0;
if(packetsCaught)
@ -1370,7 +1370,7 @@ int UDPStandardImplementation::createNewFile(){
int UDPStandardImplementation::createCompressionFile(int ithread, int iframe){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
#ifdef MYROOT1
char temp[MAX_STR_LENGTH];
@ -1400,7 +1400,7 @@ int UDPStandardImplementation::createCompressionFile(int ithread, int iframe){
void* UDPStandardImplementation::startListeningThread(void* this_pointer){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
((UDPStandardImplementation*)this_pointer)->startListening();
return this_pointer;
}
@ -1408,7 +1408,7 @@ void* UDPStandardImplementation::startListeningThread(void* this_pointer){
void* UDPStandardImplementation::startWritingThread(void* this_pointer){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
((UDPStandardImplementation*)this_pointer)->startWriting();
return this_pointer;
}
@ -1419,7 +1419,7 @@ void* UDPStandardImplementation::startWritingThread(void* this_pointer){
void UDPStandardImplementation::startListening(){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
//set current thread value index
int ithread = currentThreadIndex;
@ -1433,16 +1433,18 @@ void UDPStandardImplementation::startListening(){
//split frames
int carryonBufferSize; //from previous buffer to keep frames together in a buffer
char* tempBuffer = NULL; //temporary buffer to store split frames
if(myDetectorType != EIGER){
listenSize = bufferSize * numberofJobsPerBuffer; //listen to more than 1 packet
tempBuffer = new char[onePacketSize * (packetsPerFrame - 1)]; //store maximum of 1 packets less in a frame
}
/* outer loop - loops once for each acquisition */
//infinite loop, exited only to change dynamic range, 10G parameters etc (then recreated again)
while(true){
//reset parameters before acquisition
carryonBufferSize = 0;
if(myDetectorType != EIGER){
listenSize = bufferSize * numberofJobsPerBuffer; //listen to more than 1 packet
if(tempBuffer!=NULL){delete []tempBuffer;tempBuffer=NULL;}
tempBuffer = new char[onePacketSize * (packetsPerFrame - 1)]; //store maximum of 1 packets less in a frame
}
/* inner loop - loop for each buffer */
//until mask unset (udp sockets shut down by client)
@ -1512,7 +1514,7 @@ void UDPStandardImplementation::startListening(){
int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int lSize, int cSize, char* temp){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
//listen to UDP packets
memcpy(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS, temp, cSize);
@ -1529,6 +1531,17 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int lSize, in
receivedSize = udpSocket[ithread]->ReceiveDataOnly(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS);
}
#ifdef MANUALDEBUG
eiger_packet_header_t* header = (eiger_packet_header_t*) (buffer[ithread]+HEADER_SIZE_NUM_TOT_PACKETS);
eiger_packet_footer_t* footer = (eiger_packet_footer_t*)(buffer[ithread] + footerOffset + HEADER_SIZE_NUM_TOT_PACKETS);
cprintf(GREEN,"thread:%d subframenum:%d oldpacketnum:%d new pnum:%d\n",
ithread,
(*( (unsigned int*) header->subFameNumber)),
(*( (uint8_t*) header->dynamicRange)),
(*( (uint16_t*) footer->packetNumber)));
#endif
#ifdef DEBUG
cprintf(BLUE, "Listening_Thread %d : Received bytes: %d. Expected bytes: %d\n", ithread, receivedSize, bufferSize * numberofJobsPerBuffer-cSize);
#endif
@ -1541,7 +1554,7 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int lSize, in
void UDPStandardImplementation::startFrameIndices(int ithread){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
//determine startFrameIndex
switch(myDetectorType){
@ -1578,7 +1591,7 @@ void UDPStandardImplementation::startFrameIndices(int ithread){
void UDPStandardImplementation::stopListening(int ithread, int numbytes){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
#ifdef DEBUG4
cprintf(BLUE,"Listening_Thread %d: Stop Listening\nStatus: %s\n", ithread, runStatusType(status).c_str());
@ -1657,7 +1670,7 @@ void UDPStandardImplementation::stopListening(int ithread, int numbytes){
uint32_t UDPStandardImplementation::processListeningBuffer(int ithread, int cSize, char* temp){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
int lastPacketOffset; //the offset of the last packet
uint32_t lastFrameHeader; //frame number of last packet in buffer
@ -1741,7 +1754,7 @@ uint32_t UDPStandardImplementation::processListeningBuffer(int ithread, int cSiz
void UDPStandardImplementation::startWriting(){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
//set current thread value index
int ithread = currentThreadIndex;
@ -1762,7 +1775,7 @@ void UDPStandardImplementation::startWriting(){
void UDPStandardImplementation::processWritingBuffer(int ithread){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
//variable definitions
char* wbuf[numberofListeningThreads]; //buffer popped from FIFO
@ -1829,7 +1842,7 @@ void UDPStandardImplementation::processWritingBuffer(int ithread){
void UDPStandardImplementation::processWritingBufferPacketByPacket(int ithread){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
//variable definitions
char* packetBuffer[numberofListeningThreads]; //buffer popped from FIFO
@ -2133,7 +2146,7 @@ void UDPStandardImplementation::processWritingBufferPacketByPacket(int ithread){
void UDPStandardImplementation::waitWritingBufferForNextAcquisition(int ithread){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
//in case they are not closed already
closeFile();
@ -2190,7 +2203,7 @@ void UDPStandardImplementation::waitWritingBufferForNextAcquisition(int ithread)
bool UDPStandardImplementation::popAndCheckEndofAcquisition(int ithread, char* wbuffer[], bool ready[], uint32_t nP[],char* toFree[],int toFreeOffset[]){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
bool endofAcquisition = true;
for(int i=0; i<numberofListeningThreads; ++i){
@ -2239,7 +2252,7 @@ bool UDPStandardImplementation::popAndCheckEndofAcquisition(int ithread, char* w
void UDPStandardImplementation::stopWriting(int ithread, char* wbuffer[]){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
cprintf(GREEN,"Info: Writing_Thread %d: End of Acquisition\n",ithread);
@ -2302,7 +2315,7 @@ void UDPStandardImplementation::stopWriting(int ithread, char* wbuffer[]){
void UDPStandardImplementation::handleWithoutDataCompression(int ithread, char* wbuffer[],uint32_t npackets){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
//get frame number (eiger already gets it when it does packet to packet processing)
@ -2362,7 +2375,7 @@ void UDPStandardImplementation::handleWithoutDataCompression(int ithread, char*
void UDPStandardImplementation::writeFileWithoutCompression(char* wbuffer[],uint32_t numpackets){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
//create headers for eiger
@ -2505,7 +2518,7 @@ void UDPStandardImplementation::createHeaders(char* wbuffer[]){
void UDPStandardImplementation::copyFrameToGui(char* buffer[]){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
//random read (gui not ready)
@ -2565,7 +2578,7 @@ void UDPStandardImplementation::copyFrameToGui(char* buffer[]){
void UDPStandardImplementation::handleDataCompression(int ithread, char* wbuffer[], uint64_t &nf){
FILE_LOG(logDEBUG1) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " called";
//frame number
uint64_t tempframenumber = ((uint32_t)(*((uint32_t*)(wbuffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS))));

View File

@ -64,7 +64,7 @@ slsReceiverTCPIPInterface::slsReceiverTCPIPInterface(int &success, UDPInterface*
strcpy(socket->thisClientIP,"none1");
strcpy(mess,"dummy message");
function_table();
#ifdef VERBOSE
#ifdef VERYVERBOSE
cout << "Function table assigned." << endl;
#endif
}
@ -124,7 +124,7 @@ int slsReceiverTCPIPInterface::start(){
cout << "Could not create TCP Server thread" << endl;
return FAIL;
}
//#ifdef VERBOSE
//#ifdef VERYVERBOSE
FILE_LOG(logDEBUG) << "TCP Server thread created successfully." << endl;
//#endif
return OK;
@ -160,7 +160,7 @@ void slsReceiverTCPIPInterface::startTCPServer(){
int v=OK;
while(1) {
#ifdef VERBOSE
#ifdef VERYVERBOSE
cout<< endl;
#endif
#ifdef VERY_VERBOSE
@ -254,7 +254,7 @@ int slsReceiverTCPIPInterface::function_table(){
flist[F_ENABLE_RECEIVER_TEN_GIGA] = &slsReceiverTCPIPInterface::enable_tengiga;
#ifdef VERBOSE
#ifdef VERYVERBOSE
for (int i=0;i<numberOfFunctions;i++)
cout << "function " << i << "located at " << flist[i] << endl;
#endif
@ -269,22 +269,22 @@ int slsReceiverTCPIPInterface::function_table(){
int slsReceiverTCPIPInterface::decode_function(){
ret = FAIL;
int n,fnum;
#ifdef VERBOSE
#ifdef VERYVERBOSE
cout << "receive data" << endl;
#endif
n = socket->ReceiveDataOnly(&fnum,sizeof(fnum));
if (n <= 0) {
#ifdef VERBOSE
#ifdef VERYVERBOSE
cout << "ERROR reading from socket " << n << ", " << fnum << endl;
#endif
return FAIL;
}
#ifdef VERBOSE
#ifdef VERYVERBOSE
else
cout << "size of data received " << n <<endl;
#endif
#ifdef VERBOSE
#ifdef VERYVERBOSE
cout << "calling function fnum = "<< fnum << hex << ":"<< flist[fnum] << endl;
#endif
@ -372,7 +372,7 @@ int slsReceiverTCPIPInterface::set_detector_type(){
}
}
//#ifdef VERBOSE
//#ifdef VERYVERBOSE
if(ret!=FAIL)
FILE_LOG(logDEBUG) << "detector type " << dr;
else
@ -433,7 +433,7 @@ int slsReceiverTCPIPInterface::set_file_name() {
ret = FAIL;
}
}
#ifdef VERBOSE
#ifdef VERYVERBOSE
if(ret!=FAIL)
cout << "file name:" << retval << endl;
else
@ -505,7 +505,7 @@ int slsReceiverTCPIPInterface::set_file_dir() {
}
}
#ifdef VERBOSE
#ifdef VERYVERBOSE
if(ret!=FAIL)
cout << "file path:" << retval << endl;
else
@ -571,7 +571,7 @@ int slsReceiverTCPIPInterface::set_file_index() {
ret = FAIL;
}
}
#ifdef VERBOSE
#ifdef VERYVERBOSE
if(ret!=FAIL)
cout << "file index:" << retval << endl;
else
@ -644,7 +644,7 @@ int slsReceiverTCPIPInterface::set_frame_index() {
}
}
}
#ifdef VERBOSE
#ifdef VERYVERBOSE
if(ret!=FAIL)
cout << "frame index:" << retval << endl;
else
@ -1130,7 +1130,7 @@ int slsReceiverTCPIPInterface::moench_read_frame(){
/**send garbage with -1 index to try again*/
if (raw == NULL){
startAcquisitionIndex = -1;
#ifdef VERBOSE
#ifdef VERYVERBOSE
cout<<"data not ready for gui yet"<<endl;
#endif
}
@ -1154,7 +1154,7 @@ int slsReceiverTCPIPInterface::moench_read_frame(){
while (iPacket < (int)numPackets){
#ifdef VERBOSE
#ifdef VERYVERBOSE
printf("iPacket:%d\n",iPacket);cout << endl;
#endif
//if missing packets, dont send to gui
@ -1179,7 +1179,7 @@ int slsReceiverTCPIPInterface::moench_read_frame(){
x = packetIndex / 10;
y = packetIndex % 10;
#ifdef VERBOSE
#ifdef VERYVERBOSE
cout<<"x:"<<x<<" y:"<<y<<endl;
#endif
//copy 16 times 80 bytes
@ -1221,7 +1221,7 @@ int slsReceiverTCPIPInterface::moench_read_frame(){
}
#ifdef VERBOSE
#ifdef VERYVERBOSE
cout << "fName:" << fName << endl;
cout << "acquisitionIndex:" << acquisitionIndex << endl;
cout << "frameIndex:" << frameIndex << endl;
@ -1318,7 +1318,7 @@ int slsReceiverTCPIPInterface::gotthard_read_frame(){
/**send garbage with -1 index to try again*/
if (raw == NULL){
startAcquisitionIndex = -1;
#ifdef VERBOSE
#ifdef VERYVERBOSE
cout<<"data not ready for gui yet"<<endl;
#endif
}else{
@ -1326,7 +1326,7 @@ int slsReceiverTCPIPInterface::gotthard_read_frame(){
bindex = (uint32_t)(*((uint32_t*)raw));
pindex = (bindex & GOTTHARD_SHORT_PACKET_INDEX_MASK);
index = ((bindex & GOTTHARD_SHORT_FRAME_INDEX_MASK) >> GOTTHARD_SHORT_FRAME_INDEX_OFFSET);
#ifdef VERBOSE
#ifdef VERYVERBOSE
cout << "index:" << hex << index << endl;
#endif
}else{
@ -1336,7 +1336,7 @@ int slsReceiverTCPIPInterface::gotthard_read_frame(){
bindex2 = ((uint32_t)(*((uint32_t*)((char*)(raw+onebuffersize)))))+1;
pindex2 =(bindex2 & GOTTHARD_PACKET_INDEX_MASK);
index2 =((bindex2 & GOTTHARD_FRAME_INDEX_MASK) >> GOTTHARD_FRAME_INDEX_OFFSET);
#ifdef VERBOSE
#ifdef VERYVERBOSE
cout << "index1:" << hex << index << endl;
cout << "index2:" << hex << index << endl;
#endif
@ -1398,7 +1398,7 @@ int slsReceiverTCPIPInterface::gotthard_read_frame(){
}
}
#ifdef VERBOSE
#ifdef VERYVERBOSE
if(frameIndex!=-1){
cout << "fName:" << fName << endl;
cout << "acquisitionIndex:" << acquisitionIndex << endl;
@ -1493,7 +1493,7 @@ int slsReceiverTCPIPInterface::propix_read_frame(){
/**send garbage with -1 index to try again*/
if (raw == NULL){
startAcquisitionIndex = -1;
#ifdef VERBOSE
#ifdef VERYVERBOSE
cout<<"data not ready for gui yet"<<endl;
#endif
}else{
@ -1503,7 +1503,7 @@ int slsReceiverTCPIPInterface::propix_read_frame(){
bindex2 = ((uint32_t)(*((uint32_t*)((char*)(raw+onebuffersize)))))+1;
pindex2 =(bindex2 & PROPIX_PACKET_INDEX_MASK);
index2 =((bindex2 & PROPIX_FRAME_INDEX_MASK) >> PROPIX_FRAME_INDEX_OFFSET);
#ifdef VERBOSE
#ifdef VERYVERBOSE
cout << "index1:" << hex << index << endl;
cout << "index2:" << hex << index << endl;
#endif
@ -1552,7 +1552,7 @@ int slsReceiverTCPIPInterface::propix_read_frame(){
}
}
#ifdef VERBOSE
#ifdef VERYVERBOSE
if(frameIndex!=-1){
cout << "fName:" << fName << endl;
cout << "acquisitionIndex:" << acquisitionIndex << endl;
@ -1652,7 +1652,7 @@ int slsReceiverTCPIPInterface::eiger_read_frame(){
/**send garbage with -1 index to try again*/
else if(!receiverBase->getFramesCaught()){
startAcquisitionIndex=-1;
#ifdef VERBOSE
#ifdef VERYVERBOSE
cout<<"haven't caught any frame yet"<<endl;
#endif
}
@ -1665,7 +1665,7 @@ int slsReceiverTCPIPInterface::eiger_read_frame(){
/**send garbage with -1 index to try again*/
if (raw == NULL){
startAcquisitionIndex = -1;
#ifdef VERBOSE
#ifdef VERYVERBOSE
cout<<"data not ready for gui yet"<<endl;
#endif
}
@ -1683,7 +1683,7 @@ int slsReceiverTCPIPInterface::eiger_read_frame(){
subframenumber = *( (uint32_t*) wbuf_header->subframenum);
}
#ifdef VERBOSE
#ifdef VERYVERBOSE
cout << "index:" << dec << index << endl;
cout << "subframenumber:" << dec << subframenumber << endl;
#endif
@ -1813,7 +1813,7 @@ int slsReceiverTCPIPInterface::eiger_read_frame(){
}
}
#ifdef VERBOSE
#ifdef VERYVERBOSE
if(frameIndex!=-1){
cout << "fName:" << fName << endl;
cout << "acquisitionIndex:" << acquisitionIndex << endl;
@ -2093,7 +2093,7 @@ int slsReceiverTCPIPInterface::set_timer() {
ret = FAIL;
}
}
#ifdef VERBOSE
#ifdef VERYVERBOSE
if(ret!=FAIL){
if(index[0] == FRAME_PERIOD)
cout << "acquisition period:" << retval << endl;
@ -2228,7 +2228,7 @@ int slsReceiverTCPIPInterface::set_detector_hostname() {
}
}
}
#ifdef VERBOSE
#ifdef VERYVERBOSE
if(ret!=FAIL)
cout << "hostname:" << retval << endl;
else
@ -2320,7 +2320,7 @@ int slsReceiverTCPIPInterface::set_dynamic_range() {
}
}
}
#ifdef VERBOSE
#ifdef VERYVERBOSE
if(ret!=FAIL)
cout << "dynamic range" << dr << endl;
else
@ -2383,7 +2383,7 @@ int slsReceiverTCPIPInterface::enable_overwrite() {
ret = FAIL;
}
}
#ifdef VERBOSE
#ifdef VERYVERBOSE
if(ret!=FAIL)
cout << "overwrite:" << retval << endl;
else
@ -2448,7 +2448,7 @@ int slsReceiverTCPIPInterface::enable_tengiga() {
tenGigaEnable = retval;
}
}
#ifdef VERBOSE
#ifdef VERYVERBOSE
if(ret!=FAIL)
cout << "10Gbe:" << val << endl;
else
@ -2749,7 +2749,7 @@ int slsReceiverTCPIPInterface::exec_command() {
// execute action if the arguments correctly arrived
if (ret==OK) {
#ifdef VERBOSE
#ifdef VERYVERBOSE
cout << "executing command " << cmd << endl;
#endif
if (lockStatus==0 || socket->differentClients==0)