Merge branch 'master' of gitorious.psi.ch:sls_det_software/sls_receiver_software

This commit is contained in:
2015-04-15 10:16:44 +02:00
9 changed files with 432 additions and 178 deletions

View File

@ -249,45 +249,47 @@ class RestHelper {
* @return
*/
int n=0;
int n = 0;
int code = -1;
while(n<n_connection_tries){
req.setContentType("application/json");
//without this you need to tell the lenght: http://pocoproject.org/forum/viewtopic.php?f=12&t=5741&p=10019&hilit=post+json#p10019
// request.setContentLength(my_string.length());
req.setChunkedTransferEncoding(true);
try {
//istringstream rs(request_body);
//req.read(rs);
//cout << " --- " << rs << endl;
if (request_body == "")
session->sendRequest( (req) );
else{
ostream &os = session->sendRequest( req ) ;
os << request_body;
}
HTTPResponse res;
istream &is = session->receiveResponse(res);
StreamCopier::copyToString(is, *answer);
code = res.getStatus();
if (code != 200){
FILE_LOG(logERROR) << "HTTP ERROR " << res.getStatus() << ": " << res.getReason() ;
code = -1;
}
else
code = 0;
return code;
}
catch (exception& e){
FILE_LOG(logERROR) << "Exception connecting to "<< full_hostname << ": "<< e.what() << ", sleeping 5 seconds (" << n << "/"<<n_connection_tries << ")";
sleep(5);
}
n+=1;
while(n < n_connection_tries){
req.setContentType("application/json");
//without this you need to tell the lenght: http://pocoproject.org/forum/viewtopic.php?f=12&t=5741&p=10019&hilit=post+json#p10019
// request.setContentLength(my_string.length());
req.setChunkedTransferEncoding(true);
try {
//istringstream rs(request_body);
//req.read(rs);
//cout << " --- " << rs << endl;
if (request_body == "")
session->sendRequest( (req) );
else{
ostream &os = session->sendRequest( req ) ;
os << request_body;
}
HTTPResponse res;
istream &is = session->receiveResponse(res);
StreamCopier::copyToString(is, *answer);
code = res.getStatus();
if (code != 200){
FILE_LOG(logERROR) << "HTTP ERROR " << res.getStatus() << ": " << res.getReason() ;
code = -1;
}
else
code = 0;
return code;
}
catch (exception& e){
FILE_LOG(logERROR) << "Exception connecting to "<< full_hostname << ": "<< e.what() << ", sleeping 5 seconds (" << n << "/"<<n_connection_tries << ")";
sleep(5);
}
n+=1;
}
throw std::string("Cannot connect to the REST server! Please check...");
std::cout << "Hostname: " << full_hostname << std::endl;
FILE_LOG(logERROR) << "Cannot connect to the REST server host " << full_hostname << "! Please check..." ;
throw std::runtime_error("Cannot connect to the REST server! Please check...");
//return code;
}

View File

@ -67,6 +67,11 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
//Frame indices and numbers caught
/**
* Returns the frame index at start of entire acquisition (including all scans)
*/
uint32_t getStartAcquisitionIndex();
/**
* Returns current Frame Index Caught for an entire acquisition (including all scans)
*/
@ -288,9 +293,11 @@ class UDPBaseImplementation : protected virtual slsReceiverDefs, public UDPInter
* @param c pointer to current file name
* @param raw address of pointer, pointing to current frame to send to gui
* @param fnum frame number for eiger as it is not in the packet
* @param fstartind is the start index of the acquisition
* @param startAcquisitionIndex is the start index of the acquisition
* @param startFrameIndex is the start index of the scan
*/
void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &fstartind);
void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &startAcquisitionIndex, uint32_t &startFrameIndex);
/**
* Closes all files
* @param ithr thread index
@ -479,13 +486,22 @@ protected:
unsigned char fnum[4];
unsigned char header_after[24];
} eiger_image_header;
/** structure of an eiger image header*/
typedef struct
{
unsigned char header_before[19];
unsigned char fnum[4];
unsigned char header_after[25];
} eiger_image_header32;
/** structure of an eiger image header*/
typedef struct
{
unsigned char num1[4];
unsigned char num2[4];
unsigned char num2[2];
unsigned char num3[1];
unsigned char num4[1];
} eiger_packet_header;
/** max number of listening threads */

View File

@ -240,6 +240,11 @@ class UDPInterface {
*/
virtual int getFramesCaught() = 0;
/**
* Returns the frame index at start of entire acquisition (including all scans)
*/
virtual uint32_t getStartAcquisitionIndex()=0;
/**
* Returns current Frame Index Caught for an entire acquisition (including all scans)
*/
@ -328,9 +333,10 @@ class UDPInterface {
* @param c pointer to current file name
* @param raw address of pointer, pointing to current frame to send to gui
* @param fnum frame number for eiger as it is not in the packet
* @param fstartind is the start index of the acquisition
* @param startAcquisitionIndex is the start index of the acquisition
* @param startFrameIndex is the start index of the scan
*/
virtual void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &fstartind ) = 0;
virtual void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &startAcquisitionIndex, uint32_t &startFrameIndex)=0;
/** set status to transmitting and
* when fifo is empty later, sets status to run_finished

View File

@ -89,6 +89,11 @@ class UDPRESTImplementation : protected virtual slsReceiverDefs, public UDPBaseI
//Frame indices and numbers caught
/**
* Returns the frame index at start of entire acquisition (including all scans)
*/
uint32_t getStartAcquisitionIndex();
/**
* Returns current Frame Index Caught for an entire acquisition (including all scans)
*/
@ -300,8 +305,10 @@ class UDPRESTImplementation : protected virtual slsReceiverDefs, public UDPBaseI
* @param c pointer to current file name
* @param raw address of pointer, pointing to current frame to send to gui
* @param fnum frame number for eiger as it is not in the packet
* @param startAcquisitionIndex is the start index of the acquisition
* @param startFrameIndex is the start index of the scan
*/
void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &fstartind);
void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &startAcquisitionIndex, uint32_t &startFrameIndex);
/**
* Closes all files

View File

@ -68,6 +68,11 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
//Frame indices and numbers caught
/**
* Returns the frame index at start of entire acquisition (including all scans)
*/
//uint32_t getStartAcquisitionIndex();
/**
* Returns current Frame Index Caught for an entire acquisition (including all scans)
*/
@ -290,8 +295,11 @@ class UDPStandardImplementation: private virtual slsReceiverDefs, public UDPBase
* @param c pointer to current file name
* @param raw address of pointer, pointing to current frame to send to gui
* @param fnum frame number for eiger as it is not in the packet
* @param startAcquisitionIndex is the start index of the acquisition
* @param startFrameIndex is the start index of the scan
*/
void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &fstartind);
void readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &startAcquisitionIndex, uint32_t &startFrameIndex);
/**
* Closes all files
* @param ithr thread index

View File

@ -155,6 +155,8 @@ int UDPBaseImplementation::getFramesCaught(){ FILE_LOG(logDEBUG) << __AT__ << "
int UDPBaseImplementation::getTotalFramesCaught(){ FILE_LOG(logDEBUG) << __AT__ << " starting";return (totalPacketsCaught/packetsPerFrame);}
uint32_t UDPBaseImplementation::getStartAcquisitionIndex(){ FILE_LOG(logDEBUG) << __AT__ << " starting";return startAcquisitionIndex;}
uint32_t UDPBaseImplementation::getStartFrameIndex(){ FILE_LOG(logDEBUG) << __AT__ << " starting";return startFrameIndex;}
uint32_t UDPBaseImplementation::getFrameIndex(){ FILE_LOG(logDEBUG) << __AT__ << " starting";
@ -642,36 +644,33 @@ void UDPBaseImplementation::setupFifoStructure(){ FILE_LOG(logDEBUG) << __AT__ <
/** acquisition functions */
void UDPBaseImplementation::readFrame(char* c,char** raw, uint32_t &fnum, uint32_t& fstartind){
FILE_LOG(logDEBUG) << __AT__ << " starting";
//point to gui data
if (guiData == NULL)
guiData = latestData;
//copy data and filename
strcpy(c,guiFileName);
fnum = guiFrameNumber;
fstartind = getStartFrameIndex();
//could not get gui data
if(!guiDataReady){
*raw = NULL;
}
//data ready, set guidata to receive new data
else{
*raw = guiData;
guiData = NULL;
pthread_mutex_lock(&dataReadyMutex);
guiDataReady = 0;
pthread_mutex_unlock(&dataReadyMutex);
if((nFrameToGui) && (writerthreads_mask)){
/*if(nFrameToGui){*/
//release after getting data
sem_post(&smp);
}
}
void UDPBaseImplementation::readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &startAcquisitionIndex, uint32_t &startFrameIndex){
FILE_LOG(logDEBUG) << __AT__ << " called";
//point to gui data
if (guiData == NULL){
guiData = latestData;
}
//copy data and filename
strcpy(c,guiFileName);
fnum = guiFrameNumber;
startAcquisitionIndex = getStartAcquisitionIndex();
startFrameIndex = getStartFrameIndex();
//could not get gui data
if(!guiDataReady){
*raw = NULL;
}
//data ready, set guidata to receive new data
else{
*raw = guiData;
guiData = NULL;
if((nFrameToGui) && (writerthreads_mask)){
//release after getting data
sem_post(&smp);
}
}
}
@ -688,7 +687,7 @@ void UDPBaseImplementation::copyFrameToGui(char* startbuf[], uint32_t fnum, char
pthread_mutex_unlock(&dataReadyMutex);
}
//random read or nth frame read, gui needs data now
//random read or nth frame read, gui needs data now or it is the first frame
else{
/*
//nth frame read, block current process if the guireader hasnt read it yet

View File

@ -87,7 +87,9 @@ int UDPRESTImplementation::get_rest_state(RestHelper * rest, string *rest_state)
};
void UDPRESTImplementation::initialize_REST(){
FILE_LOG(logDEBUG) << __AT__ << " called";
FILE_LOG(logDEBUG) << __AT__ << " REST status is initialized: " << isInitialized;
if (rest_hostname.empty()) {
FILE_LOG(logDEBUG) << __AT__ <<"can't initialize with empty string or NULL for detectorHostname";
@ -104,9 +106,12 @@ void UDPRESTImplementation::initialize_REST(){
try{
rest->init(rest_hostname, rest_port);
code = get_rest_state(rest, &answer);
std::cout << "AAAAAAAa " << answer << std::endl;
if (code != 0){
throw answer;
FILE_LOG(logERROR) << __AT__ << " REST state returned: " << answer;
throw;
}
else{
isInitialized = true;
@ -133,11 +138,19 @@ void UDPRESTImplementation::initialize_REST(){
ss >> test;
test = "{\"path\":\"" + string( getFilePath() ) + "\"}";
code = rest->post_json("state/initialize", &answer, test);
FILE_LOG(logDEBUG) << __AT__ << "state/configure got " << code;
code = rest->get_json("state", &answer);
FILE_LOG(logDEBUG) << __AT__ << "state got " << code << " " << answer << "\n";
FILE_LOG(logDEBUG) << __AT__ << " state got " << code << " " << answer << "\n";
if (answer != "INITIALIZED"){
test = "{\"path\":\"" + string( getFilePath() ) + "\"}";
code = rest->post_json("state/initialize", &answer, test);
}
else{
test = "{\"path\":\"" + string( getFilePath() ) + "\"}";
code = rest->post_json("state/configure", &answer, test);
}
FILE_LOG(logDEBUG) << __AT__ << " state/configure got " << code;
code = rest->get_json("state", &answer);
FILE_LOG(logDEBUG) << __AT__ << " state got " << code << " " << answer << "\n";
/*
@ -187,6 +200,11 @@ int UDPRESTImplementation::getTotalFramesCaught(){
return (totalPacketsCaught/packetsPerFrame);
}
uint32_t UDPRESTImplementation::getStartAcquisitionIndex(){
FILE_LOG(logDEBUG) << __AT__ << " called";
return startAcquisitionIndex;
}
uint32_t UDPRESTImplementation::getStartFrameIndex(){
FILE_LOG(logDEBUG) << __AT__ << " called";
return startFrameIndex;
@ -577,16 +595,19 @@ void UDPRESTImplementation::setupFifoStructure(){
/** acquisition functions */
void UDPRESTImplementation::readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &fstartind){
void UDPRESTImplementation::readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &startAcquisitionIndex, uint32_t &startFrameIndex){
FILE_LOG(logDEBUG) << __AT__ << " called";
//point to gui data
if (guiData == NULL)
if (guiData == NULL){
guiData = latestData;
}
//copy data and filename
strcpy(c,guiFileName);
fnum = guiFrameNumber;
fstartind = getStartFrameIndex();
startAcquisitionIndex = getStartAcquisitionIndex();
startFrameIndex = getStartFrameIndex();
//could not get gui data
if(!guiDataReady){
@ -596,12 +617,7 @@ void UDPRESTImplementation::readFrame(char* c,char** raw, uint32_t &fnum, uint32
else{
*raw = guiData;
guiData = NULL;
pthread_mutex_lock(&dataReadyMutex);
guiDataReady = 0;
pthread_mutex_unlock(&dataReadyMutex);
if((nFrameToGui) && (writerthreads_mask)){
/*if(nFrameToGui){*/
//release after getting data
sem_post(&smp);
}
@ -1169,10 +1185,8 @@ int UDPRESTImplementation::startReceiver(char message[]){
initialize_REST();
FILE_LOG(logDEBUG) << __FILE__ << "::" << __func__ << " initialized";
// #ifdef VERBOSE
cout << "Starting Receiver" << endl;
//#endif
std::string answer;
int code;
//char *intStr = itoa(a);
@ -1184,17 +1198,21 @@ int UDPRESTImplementation::startReceiver(char message[]){
stringstream ss2;
ss2 << getNumberOfFrames();
string str_n = ss2.str();
cout << "Starting Receiver" << endl;
std::string request_body = "{\"settings\": {\"bit_depth\": " + str_dr + ", \"nimages\": " + str_n + "}}";
//std::string request_body = "{\"settings\": {\"nimages\":1, \"scanid\":999, \"bit_depth\":16}}";
FILE_LOG(logDEBUG) << __FILE__ << "::" << " sending this configuration body: " << request_body;
code = rest->post_json("state/configure", &answer, request_body);
code = rest->get_json("state", &answer);
FILE_LOG(logDEBUG) << __FILE__ << "::" << " got: " << answer;
code = rest->post_json("state/open", &answer);
code = rest->get_json("state", &answer);
//code = rest->post_json("state/open", &answer);
//code = rest->get_json("state", &answer);
status = slsReceiverDefs::RUNNING;
status = RUNNING;
//reset listening thread variables
/*

View File

@ -352,6 +352,8 @@ int UDPStandardImplementation::setDetectorType(detectorType det){ FILE_LOG(logD
//int UDPStandardImplementation::getTotalFramesCaught(){return (totalPacketsCaught/packetsPerFrame);}
//uint32_t UDPStandardImplementation::getStartAcquisitionIndex(){return startAcquisitionIndex;}
//uint32_t UDPStandardImplementation::getStartFrameIndex(){return startFrameIndex;}
/*
@ -868,32 +870,34 @@ void UDPStandardImplementation::setupFifoStructure(){
/** acquisition functions */
void UDPStandardImplementation::readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &fstartind){
void UDPStandardImplementation::readFrame(char* c,char** raw, uint32_t &fnum, uint32_t &startAcquisitionIndex, uint32_t &startFrameIndex){
FILE_LOG(logDEBUG) << __AT__ << " called";
//point to gui data
if (guiData == NULL){
guiData = latestData;
#ifdef VERY_VERY_DEBUG
cout <<"gui data not null anymore" << endl;
cout << "gui data not null anymore" << endl;
#endif
}
//copy data and filename
strcpy(c,guiFileName);
fnum = guiFrameNumber;
fstartind = getStartFrameIndex();
startAcquisitionIndex = getStartAcquisitionIndex();
startFrameIndex = getStartFrameIndex();
//could not get gui data
if(!guiDataReady){
#ifdef VERY_VERY_DEBUG
cout<<"gui data not ready"<<endl;
cout << "gui data not ready" << endl;
#endif
*raw = NULL;
}
//data ready, set guidata to receive new data
else{
#ifdef VERY_VERY_DEBUG
cout<<"gui data ready"<<endl;
cout << "gui data ready" << endl;
#endif
*raw = guiData;
guiData = NULL;
@ -903,14 +907,14 @@ void UDPStandardImplementation::readFrame(char* c,char** raw, uint32_t &fnum, ui
pthread_mutex_unlock(&dataReadyMutex);*/
if((nFrameToGui) && (writerthreads_mask)){
#ifdef VERY_VERY_DEBUG
cout<<"gonna post"<<endl;
cout << "gonna post" << endl;
#endif
/*if(nFrameToGui){*/
//release after getting data
sem_post(&smp);
}
#ifdef VERY_VERY_DEBUG
cout<<"done post"<<endl;
cout << "done post" << endl;
#endif
}
}
@ -921,25 +925,31 @@ void UDPStandardImplementation::readFrame(char* c,char** raw, uint32_t &fnum, ui
void UDPStandardImplementation::copyFrameToGui(char* startbuf[], uint32_t fnum, char* buf){
FILE_LOG(logDEBUG) << __AT__ << " called";
#ifdef VERY_VERY_DEBUG
cout << "copyframe" << endl;
#endif
//random read when gui not ready , also command line doesnt have nthframetogui
//else guidata always null as guidataready is always 1 after 1st frame, and seccond data never gets copied
if((!nFrameToGui) && (!guiData)){
#ifdef VERY_VERY_DEBUG
cout << "doing nothing" << endl;
#endif
pthread_mutex_lock(&dataReadyMutex);
guiDataReady=0;
pthread_mutex_unlock(&dataReadyMutex);
}
//random read or nth frame read, gui needs data now
//random read or nth frame read, gui needs data now or it is the first frame
else{
//cout <<"gui needs data now"<<endl;
/*
//nth frame read, block current process if the guireader hasnt read it yet
if(nFrameToGui)
sem_wait(&smp);
*/
#ifdef VERY_VERY_DEBUG
cout << "gui needs data now or 1st frame" << endl;
#endif
pthread_mutex_lock(&dataReadyMutex);
guiDataReady=0;
#ifdef VERY_VERY_DEBUG
cout << "guidataready is 0, copying data" << endl;
#endif
//eiger
if(startbuf != NULL){
int offset = 0;
@ -954,8 +964,7 @@ void UDPStandardImplementation::copyFrameToGui(char* startbuf[], uint32_t fnum,
for(int i=1000;i<1010;i=i+2)
//cout<<"startbuf:"<<dec<<i<<hex<<":\t0x"<<htonl((uint32_t)(*((uint32_t*)(startbuf[1] + HEADER_SIZE_NUM_TOT_PACKETS+ EIGER_HEADER_LENGTH+8+ i))))<<endl;
cout<<"startbuf:"<<dec<<i<<hex<<":\t0x"<<((uint16_t)(*((uint16_t*)(startbuf[1] + 2+ 48+ j*1040+8+ i))))<<endl;
*/
*/
guiFrameNumber = fnum;
}else//other detectors
@ -965,12 +974,18 @@ void UDPStandardImplementation::copyFrameToGui(char* startbuf[], uint32_t fnum,
strcpy(guiFileName,savefilename);
guiDataReady=1;
pthread_mutex_unlock(&dataReadyMutex);
#ifdef VERY_VERY_DEBUG
cout << "guidataready = 1" << endl;
#endif
//nth frame read, block current process if the guireader hasnt read it yet
if(nFrameToGui){
//cout<<"waiting after copying"<<endl;
#ifdef VERY_VERY_DEBUG
cout<<"waiting after copying"<<endl;
#endif
sem_wait(&smp);
//cout<<"done waiting"<<endl;
#ifdef VERY_VERY_DEBUG
cout<<"done waiting"<<endl;
#endif
}
}
@ -1693,9 +1708,9 @@ int UDPStandardImplementation::startListening(){
expected = maxBufferSize - carryonBufferSize;
}
//#ifdef VERDEBUG
#ifdef EIGER_DEBUG
cout << ithread << " *** rc:" << dec << rc << ". expected:" << dec << expected << endl;
//#endif
#endif
/*
//start indices for each start of scan/acquisition - eiger does it before
@ -1845,12 +1860,13 @@ int UDPStandardImplementation::startWriting(){
thread_started = 1;
int totalheader = HEADER_SIZE_NUM_TOT_PACKETS + EIGER_HEADER_LENGTH;
int numpackets, nf;
uint32_t tempframenum;
char* wbuf[numListeningThreads];//interleaved
char *d=new char[bufferSize*numListeningThreads];
int xmax=0,ymax=0;
int ret,i;
int ret,i,j;
int packetsPerThread = packetsPerFrame/numListeningThreads;
while(1){
@ -1871,7 +1887,8 @@ int UDPStandardImplementation::startWriting(){
}
}
//so that the first frame is always copied
guiData = latestData;
while((1<<ithread)&writerthreads_mask){
@ -1896,25 +1913,30 @@ int UDPStandardImplementation::startWriting(){
//last dummy packet
if(numpackets == 0xFFFF){
//#ifdef VERYDEBUG
#ifdef VERYDEBUG
cout << "**LAST dummy packet" << endl;
//#endif
#endif
stopWriting(ithread,wbuf);
continue;
}
//#ifdef VERYDEBUG
#ifdef VERYDEBUG
else cout <<"**NOT a dummy packet"<<endl;
//#endif
#endif
//for progress
if(myDetectorType == EIGER){
tempframenum = htonl(*(unsigned int*)((eiger_image_header *)((char*)(wbuf[ithread] + HEADER_SIZE_NUM_TOT_PACKETS)))->fnum);
if(dynamicRange != 32)
tempframenum += (startFrameIndex-1); //eiger frame numbers start at 1, so need to -1
tempframenum = htonl(*(unsigned int*)((eiger_image_header *)((char*)(wbuf[ithread] + HEADER_SIZE_NUM_TOT_PACKETS)))->fnum);
else
tempframenum = ((tempframenum / EIGER_32BIT_INITIAL_CONSTANT) + startFrameIndex)-1;//eiger 32 bit mode is a multiple of 17c. +startframeindex for scans
tempframenum = htonl(*(unsigned int*)((eiger_image_header32 *)((char*)(wbuf[ithread] + HEADER_SIZE_NUM_TOT_PACKETS)))->fnum);
tempframenum += (startFrameIndex-1); //eiger frame numbers start at 1, so need to -1
//tempframenum = ((tempframenum / EIGER_32BIT_INITIAL_CONSTANT) + startFrameIndex)-1;//eiger 32 bit mode is a multiple of 17c. +startframeindex for scans
}else if ((myDetectorType == GOTTHARD) && (shortFrame == -1))
tempframenum = (((((uint32_t)(*((uint32_t*)(wbuf[ithread] + HEADER_SIZE_NUM_TOT_PACKETS))))+1)& (frameIndexMask)) >> frameIndexOffset);
else
@ -1928,10 +1950,10 @@ int UDPStandardImplementation::startWriting(){
currframenum = tempframenum;
pthread_mutex_unlock(&progress_mutex);
}
//#ifdef VERYDEBUG
#ifdef VERYDEBUG
if(myDetectorType == EIGER)
cout << endl <<ithread << " tempframenum:" << dec << tempframenum << " curframenum:" << currframenum << endl;
//#endif
#endif
//without datacompression: write datacall back, or write data, free fifo
@ -1942,8 +1964,53 @@ int UDPStandardImplementation::startWriting(){
/* for eiger 32 bit mode, currframenum like gotthard, does not start from 0 or 1 */
rawDataReadyCallBack(currframenum, wbuf[i], numpackets * onePacketSize, sfilefd, guiData,pRawDataReady);
}else if (numpackets > 0){
for(i=0;i<numListeningThreads;++i)
writeToFile_withoutCompression(wbuf[i], numpackets,currframenum);
for(j=0;j<numListeningThreads;++j){
#ifdef WRITE_HEADERS
if (myDetectorType == EIGER){
//overwriting frame number in header
for (i = 0; i < packetsPerFrame; i++)
(*(uint32_t*)(((eiger_packet_header *)((char*)(wbuf[j] + totalheader + EIGER_ONE_GIGA_ONE_PACKET_SIZE*i)))->num1)) = currframenum;
//for 32 bit,port number needs to be changed and packet number reconstructed
if(dynamicRange == 32){
for (i = 0; i < packetsPerFrame/4; i++){
//new packet number that has space for 16 bit
(*(uint16_t*)(((eiger_packet_header *)((char*)(wbuf[j] + totalheader + EIGER_ONE_GIGA_ONE_PACKET_SIZE*i)))->num2))
= ((*(uint8_t*)(((eiger_packet_header *)((char*)(wbuf[j] + totalheader + EIGER_ONE_GIGA_ONE_PACKET_SIZE*i)))->num4)));
//new port number as its the same everywhere for 32 bit!!
if(!j) (*(uint8_t*)(((eiger_packet_header *)((char*)(wbuf[j] + totalheader + EIGER_ONE_GIGA_ONE_PACKET_SIZE*i)))->num3)) = 0x00;
#ifdef VERYDEBUG
cprintf(RED, "%d - 0x%x - %d - %d\n", i,
(*(uint8_t*)(((eiger_packet_header *)((char*)(wbuf[j] + totalheader +i*EIGER_ONE_GIGA_ONE_PACKET_SIZE)))->num3)),
(*(uint8_t*)(((eiger_packet_header *)((char*)(wbuf[j] + totalheader +i*EIGER_ONE_GIGA_ONE_PACKET_SIZE)))->num4)),
(*(uint16_t*)(((eiger_packet_header *)((char*)(wbuf[j] + totalheader +i*EIGER_ONE_GIGA_ONE_PACKET_SIZE)))->num2)));
#endif
}
for (i = packetsPerFrame/4; i < packetsPerFrame/2; i++){
//new packet number that has space for 16 bit
(*(uint16_t*)(((eiger_packet_header *)((char*)(wbuf[j] + totalheader + EIGER_ONE_GIGA_ONE_PACKET_SIZE*i)))->num2))
= ((*(uint8_t*)(((eiger_packet_header *)((char*)(wbuf[j] + totalheader + EIGER_ONE_GIGA_ONE_PACKET_SIZE*i)))->num4))+(packetsPerFrame/4));
//new port number as its the same everywhere for 32 bit!!
if(!j) (*(uint8_t*)(((eiger_packet_header *)((char*)(wbuf[j] + totalheader + EIGER_ONE_GIGA_ONE_PACKET_SIZE*i)))->num3)) = 0x00;
#ifdef VERYDEBUG
cprintf(RED, "%d -0x%x - %d - %d\n", i,
(*(uint8_t*)(((eiger_packet_header *)((char*)(wbuf[j] + totalheader +i*EIGER_ONE_GIGA_ONE_PACKET_SIZE)))->num3)),
(*(uint8_t*)(((eiger_packet_header *)((char*)(wbuf[j] + totalheader +i*EIGER_ONE_GIGA_ONE_PACKET_SIZE)))->num4)),
(*(uint16_t*)(((eiger_packet_header *)((char*)(wbuf[j] + totalheader +i*EIGER_ONE_GIGA_ONE_PACKET_SIZE)))->num2)));
#endif
}
}
}
#endif
writeToFile_withoutCompression(wbuf[j], numpackets,currframenum);
}
#ifdef VERYDEBUG
cout << "written everyting" << endl;
#endif
@ -1969,7 +2036,8 @@ int UDPStandardImplementation::startWriting(){
}
else{
//copy to gui
if(numpackets == packetsPerFrame * numJobsPerThread){ //only full frames
if(numpackets >= packetsPerFrame){//min 1 frame, but neednt be
//if(numpackets == packetsPerFrame * numJobsPerThread){ //only full frames
copyFrameToGui(NULL,-1,wbuf[0]+HEADER_SIZE_NUM_TOT_PACKETS);
#ifdef VERYVERBOSE
cout << ithread << " finished copying" << endl;
@ -2053,9 +2121,13 @@ int UDPStandardImplementation::startWriting(){
void UDPStandardImplementation::startFrameIndices(int ithread){
FILE_LOG(logDEBUG) << __AT__ << " called";
if (myDetectorType == EIGER)
if (myDetectorType == EIGER){
//add currframenum later in this method for scans
startFrameIndex = htonl(*(unsigned int*)((eiger_image_header *)((char*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS)))->fnum);
if(dynamicRange == 32)
startFrameIndex = htonl(*(unsigned int*)((eiger_image_header32 *)((char*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS)))->fnum);
else
startFrameIndex = htonl(*(unsigned int*)((eiger_image_header *)((char*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS)))->fnum);
}
//gotthard has +1 for frame number and not a short frame
else if ((myDetectorType == GOTTHARD) && (shortFrame == -1))
startFrameIndex = (((((uint32_t)(*((uint32_t*)(buffer[ithread] + HEADER_SIZE_NUM_TOT_PACKETS))))+1)
@ -2108,12 +2180,20 @@ int i;
exit(-1);
}
//free buffer
if(rc <= 0){
cout << ithread << "Discarding empty frame/ End of acquisition" << endl;
fifoFree[ithread]->push(buffer[ithread]);
#ifdef FIFO_DEBUG
cprintf(BLUE,"%d listener empty buffer pushed into fifofree %x\n", ithread, (void*)(buffer[ithread]));
#endif
}
//push the last buffer into fifo
if(rc > 0){
else{
//eiger (incomplete frames) - throw away
if((myDetectorType == EIGER) && (rc < (bufferSize * numJobsPerThread)) ){
if(rc == 266240)
cout << ithread << " Start of detector: Received test frame of 266240 bytes." << endl;
cprintf(GREEN, "%d Start of detector: Received test frame of 266240 bytes.\n",ithread);
cout << ithread << "Discarding incomplete frame" << endl;
fifoFree[ithread]->push(buffer[ithread]);
#ifdef FIFO_DEBUG
@ -2135,14 +2215,6 @@ int i;
#endif
}
}
//free buffer
else{
cout << ithread << "Discarding empty frame" << endl;
fifoFree[ithread]->push(buffer[ithread]);
#ifdef FIFO_DEBUG
cprintf(BLUE,"%d listener empty buffer pushed into fifofree %x\n", ithread, (void*)(buffer[ithread]));
#endif
}
@ -2252,8 +2324,13 @@ void UDPStandardImplementation::stopWriting(int ithread, char* wbuffer[]){
//report
cprintf(GREEN, "Status: Run Finished\n");
cprintf(GREEN, "Total Packets Caught:%d\n", totalPacketsCaught);
cprintf(GREEN, "Total Frames Caught:%d\n",(totalPacketsCaught/packetsPerFrame));
if(!totalPacketsCaught){
cprintf(RED, "Total Packets Caught:%d\n", totalPacketsCaught);
cprintf(RED, "Total Frames Caught:%d\n",(totalPacketsCaught/packetsPerFrame));
}else{
cprintf(GREEN, "Total Packets Caught:%d\n", totalPacketsCaught);
cprintf(GREEN, "Total Frames Caught:%d\n",(totalPacketsCaught/packetsPerFrame));
}
//acquisition end
if (acquisitionFinishedCallBack)
acquisitionFinishedCallBack((totalPacketsCaught/packetsPerFrame), pAcquisitionFinished);
@ -2281,8 +2358,52 @@ void UDPStandardImplementation::writeToFile_withoutCompression(char* buf,int num
if((enableFileWrite) && (sfilefd)){
offset = HEADER_SIZE_NUM_TOT_PACKETS;
if(myDetectorType == EIGER)
if(myDetectorType == EIGER){
offset += EIGER_HEADER_LENGTH;
#ifdef WRITE_HEADERS
#ifdef VERY_DEBUG
int k = 0;
if(dynamicRange != 32){
cprintf(RED, "\np1 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf + offset+k*1040)))->num1)));
cprintf(RED, "p1:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf + offset+k*1040)))->num3)));
cprintf(RED, "p0 num:%d - %d\n", k, (*(uint8_t*)(((eiger_packet_header *)((char*)(buf + offset+k*1040)))->num4)));
k = 1;
cprintf(RED, "p2 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf + offset +k*1040)))->num1)));
cprintf(RED, "p2:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf + offset +k*1040)))->num3)));
cprintf(RED, "p1 num:%d - %d\n", k,(*(uint8_t*)(((eiger_packet_header *)((char*)(buf + offset +k*1040)))->num4)));
k = 2;
cprintf(RED, "p3 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf + offset + k*1040)))->num1)));
cprintf(RED, "p3:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf + offset +k*1040)))->num3)));
cprintf(RED, "p2 num:%d - %d\n", k,(*(uint8_t*)(((eiger_packet_header *)((char*)(buf + offset +k*1040)))->num4)));
}else{
k = 0;
cprintf(RED, "\np1 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf + offset+k*1040)))->num1)));
cprintf(RED, "p1:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf + offset+k*1040)))->num3)));
cprintf(RED, "p0 num:%d - %d\n", k, (*(uint16_t*)(((eiger_packet_header *)((char*)(buf + offset+k*1040)))->num2)));
k = 1;
cprintf(RED, "p2 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf + offset +k*1040)))->num1)));
cprintf(RED, "p2:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf + offset +k*1040)))->num3)));
cprintf(RED, "p1 num:%d - %d\n", k, (*(uint16_t*)(((eiger_packet_header *)((char*)(buf + offset +k*1040)))->num2)));
k = 2;
cprintf(RED, "p3 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf + offset + k*1040)))->num1)));
cprintf(RED, "p3:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf + offset +k*1040)))->num3)));
cprintf(RED, "p2 num:%d - %d\n", k, (*(uint16_t*)(((eiger_packet_header *)((char*)(buf + offset +k*1040)))->num2)));
k = 256;
cprintf(RED, "p257 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf + offset + k*1040)))->num1)));
cprintf(RED, "p257:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf + offset +k*1040)))->num3)));
cprintf(RED, "p256 num:%d - %d\n", k, (*(uint16_t*)(((eiger_packet_header *)((char*)(buf + offset +k*1040)))->num2)));
k = 512;
cprintf(RED, "p513 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf + offset + k*1040)))->num1)));
cprintf(RED, "p513:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf + offset +k*1040)))->num3)));
cprintf(RED, "p512 num:%d - %d\n", k, (*(uint16_t*)(((eiger_packet_header *)((char*)(buf + offset +k*1040)))->num2)));
k = 768;
cprintf(RED, "p769 fnum:0x%x\n", (*(unsigned int*)(((eiger_packet_header *)((char*)(buf + offset + k*1040)))->num1)));
cprintf(RED, "p769:0x%x\n", (*(uint8_t*)(((eiger_packet_header *)((char*)(buf + offset +k*1040)))->num3)));
cprintf(RED, "p768 num:%d - %d\n", k,(*(uint16_t*)(((eiger_packet_header *)((char*)(buf + offset +k*1040)))->num2)));
}
#endif
#endif
}
while(numpackets > 0){
//for progress and packet loss calculation(new files)

View File

@ -977,7 +977,9 @@ int slsReceiverTCPIPInterface::read_frame(){
int slsReceiverTCPIPInterface::moench_read_frame(){
ret=OK;
char fName[MAX_STR_LENGTH]="";
int arg = -1,i;
int acquisitionIndex = -1;
int frameIndex= -1;
int i;
int bufferSize = MOENCH_BUFFER_SIZE;
@ -990,7 +992,8 @@ int slsReceiverTCPIPInterface::moench_read_frame(){
char* raw = new char[bufferSize];
uint32_t startIndex=0;
uint32_t startAcquisitionIndex=0;
uint32_t startFrameIndex=0;
uint32_t index = 0,bindex = 0, offset=0;
strcpy(mess,"Could not read frame\n");
@ -1001,18 +1004,18 @@ int slsReceiverTCPIPInterface::moench_read_frame(){
/**send garbage with -1 index to try again*/
if(!receiverBase->getFramesCaught()){
arg = -1;
startAcquisitionIndex = -1;
cout<<"haven't caught any frame yet"<<endl;
}
else{
ret = OK;
/*startIndex=receiverBase->getStartFrameIndex();*/
receiverBase->readFrame(fName,&raw,index,startIndex);
receiverBase->readFrame(fName,&raw,index,startAcquisitionIndex,startFrameIndex);
/**send garbage with -1 index to try again*/
if (raw == NULL){
arg = -1;
startAcquisitionIndex = -1;
#ifdef VERBOSE
cout<<"data not ready for gui yet"<<endl;
#endif
@ -1044,7 +1047,7 @@ int slsReceiverTCPIPInterface::moench_read_frame(){
bindex = (*((uint32_t*)(((char*)origVal)+packetOffset)));
if (bindex == 0xFFFFFFFF){
cout << "Missing Packet,Not sending to gui" << endl;
index = startIndex - 1;
index = startAcquisitionIndex - 1;
break;//use continue and change index above if you want to display missing packets with 0 value anyway in gui
}
@ -1088,16 +1091,28 @@ int slsReceiverTCPIPInterface::moench_read_frame(){
//check if same frame number
}
arg = index - startIndex;
acquisitionIndex = index-startAcquisitionIndex;
if(acquisitionIndex == -1)
startFrameIndex = -1;
else
frameIndex = index-startFrameIndex;
#ifdef VERY_VERY_DEBUG
cout << "acquisitionIndex calculated is:" << acquisitionIndex << endl;
cout << "frameIndex calculated is:" << frameIndex << endl;
cout << "index:" << index << endl;
cout << "startAcquisitionIndex:" << startAcquisitionIndex << endl;
cout << "startFrameIndex:" << startFrameIndex << endl;
#endif
}
}
#ifdef VERBOSE
cout << "\nstartIndex:" << startIndex << endl;
cout << "fName:" << fName << endl;
cout << "index:" << arg << endl;
if(retval==NULL)cout<<"retval is null"<<endl;
cout << "acquisitionIndex:" << acquisitionIndex << endl;
cout << "frameIndex:" << frameIndex << endl;
cout << "startAcquisitionIndex:" << startAcquisitionIndex << endl;
cout << "startFrameIndex:" << startFrameIndex << endl;
#endif
#endif
@ -1115,7 +1130,8 @@ int slsReceiverTCPIPInterface::moench_read_frame(){
}
else{
socket->SendDataOnly(fName,MAX_STR_LENGTH);
socket->SendDataOnly(&arg,sizeof(arg));
socket->SendDataOnly(&acquisitionIndex,sizeof(acquisitionIndex));
socket->SendDataOnly(&frameIndex,sizeof(frameIndex));
socket->SendDataOnly(retval,MOENCH_DATA_BYTES);
}
//return ok/fail
@ -1135,7 +1151,9 @@ int slsReceiverTCPIPInterface::moench_read_frame(){
int slsReceiverTCPIPInterface::gotthard_read_frame(){
ret=OK;
char fName[MAX_STR_LENGTH]="";
int arg = -1,i;
int acquisitionIndex = -1;
int frameIndex= -1;
int i;
//retval is a full frame
@ -1161,7 +1179,8 @@ int slsReceiverTCPIPInterface::gotthard_read_frame(){
uint32_t index=0,index2=0;
uint32_t pindex=0,pindex2=0;
uint32_t bindex=0,bindex2=0;
uint32_t startIndex=0;
uint32_t startAcquisitionIndex=0;
uint32_t startFrameIndex=0;
strcpy(mess,"Could not read frame\n");
@ -1173,16 +1192,16 @@ int slsReceiverTCPIPInterface::gotthard_read_frame(){
/**send garbage with -1 index to try again*/
if(!receiverBase->getFramesCaught()){
arg=-1;
startAcquisitionIndex=-1;
cout<<"haven't caught any frame yet"<<endl;
}else{
ret = OK;
/*startIndex=receiverBase->getStartFrameIndex();*/
receiverBase->readFrame(fName,&raw,index,startIndex);
receiverBase->readFrame(fName,&raw,index,startAcquisitionIndex,startFrameIndex);
/**send garbage with -1 index to try again*/
if (raw == NULL){
arg = -1;
startAcquisitionIndex = -1;
#ifdef VERBOSE
cout<<"data not ready for gui yet"<<endl;
#endif
@ -1216,7 +1235,7 @@ int slsReceiverTCPIPInterface::gotthard_read_frame(){
if(bindex != 0xFFFFFFFF)
memcpy((((char*)retval)+(GOTTHARD_SHORT_DATABYTES*shortFrame)),((char*) origVal)+4, GOTTHARD_SHORT_DATABYTES);
else{
index = startIndex - 1;
index = startAcquisitionIndex - 1;
cout << "Missing Packet,Not sending to gui" << endl;
}
}
@ -1247,14 +1266,29 @@ int slsReceiverTCPIPInterface::gotthard_read_frame(){
}*/
}
arg = (index - startIndex);
acquisitionIndex = index-startAcquisitionIndex;
if(acquisitionIndex == -1)
startFrameIndex = -1;
else
frameIndex = index-startFrameIndex;
#ifdef VERY_VERY_DEBUG
cout << "acquisitionIndex calculated is:" << acquisitionIndex << endl;
cout << "frameIndex calculated is:" << frameIndex << endl;
cout << "index:" << index << endl;
cout << "startAcquisitionIndex:" << startAcquisitionIndex << endl;
cout << "startFrameIndex:" << startFrameIndex << endl;
#endif
}
}
#ifdef VERBOSE
if(arg!=-1){
if(frameIndex!=-1){
cout << "fName:" << fName << endl;
cout << "findex:" << arg << endl;
cout << "acquisitionIndex:" << acquisitionIndex << endl;
cout << "frameIndex:" << frameIndex << endl;
cout << "startAcquisitionIndex:" << startAcquisitionIndex << endl;
cout << "startFrameIndex:" << startFrameIndex << endl;
}
#endif
@ -1275,7 +1309,8 @@ int slsReceiverTCPIPInterface::gotthard_read_frame(){
}
else{
socket->SendDataOnly(fName,MAX_STR_LENGTH);
socket->SendDataOnly(&arg,sizeof(arg));
socket->SendDataOnly(&acquisitionIndex,sizeof(acquisitionIndex));
socket->SendDataOnly(&frameIndex,sizeof(frameIndex));
socket->SendDataOnly(retval,GOTTHARD_DATA_BYTES);
}
@ -1297,7 +1332,9 @@ int slsReceiverTCPIPInterface::gotthard_read_frame(){
int slsReceiverTCPIPInterface::eiger_read_frame(){
ret=OK;
char fName[MAX_STR_LENGTH]="";
int arg = -1,i;
int acquisitionIndex = -1;
int frameIndex= -1;
int i;
uint32_t index=0;
int frameSize = EIGER_ONE_GIGA_ONE_PACKET_SIZE * packetsPerFrame;
@ -1309,7 +1346,8 @@ int slsReceiverTCPIPInterface::eiger_read_frame(){
char* raw = new char[frameSize];
char* origVal = new char[frameSize];
char* retval = new char[dataSize];
uint32_t startIndex=0;
uint32_t startAcquisitionIndex=0;
uint32_t startFrameIndex=0;
strcpy(mess,"Could not read frame\n");
@ -1320,7 +1358,7 @@ int slsReceiverTCPIPInterface::eiger_read_frame(){
/**send garbage with -1 index to try again*/
if(!receiverBase->getFramesCaught()){
arg=-1;
startAcquisitionIndex=-1;
#ifdef VERBOSE
cout<<"haven't caught any frame yet"<<endl;
#endif
@ -1329,13 +1367,13 @@ int slsReceiverTCPIPInterface::eiger_read_frame(){
else{
ret = OK;
/** read a frame */
receiverBase->readFrame(fName,&raw,index,startIndex);
receiverBase->readFrame(fName,&raw,index,startAcquisitionIndex,startFrameIndex);
#ifdef VERBOSE
cout << "index:" << dec << index << endl;
#endif
/**send garbage with -1 index to try again*/
if (raw == NULL){
arg = -1;
startAcquisitionIndex = -1;
#ifdef VERBOSE
cout<<"data not ready for gui yet"<<endl;
#endif
@ -1450,6 +1488,19 @@ int slsReceiverTCPIPInterface::eiger_read_frame(){
}
}
/*
int inum = 0;
//dr = 16, hence uint16_t
for(inum = 0; inum < 2; inum++)
cprintf(YELLOW,"before htonl %d,0 :%d\n",inum,((uint8_t)(*((uint8_t*)((char*)(retval+(inum*(dynamicrange/8))))))));
for(inum = 254; inum < 258; inum++)
cprintf(YELLOW,"before htonl %d,0 :%d\n",inum,((uint8_t)(*((uint8_t*)((char*)(retval+(inum*(dynamicrange/8))))))));
for(inum = 0; inum < 2; inum++)
cprintf(YELLOW,"before htonl %d,2 :%d\n",inum,((uint8_t)(*((uint8_t*)((char*)(retval+((2048+inum)*(dynamicrange/8))))))));
for(inum = 254; inum < 258; inum++)
cprintf(YELLOW,"before htonl %d,2 :%d\n",inum,((uint8_t)(*((uint8_t*)((char*)(retval+((2048+inum)*(dynamicrange/8))))))));
*/
//64 bit htonl cuz of endianness
for(i=0;i<(1024*(16*dynamicrange)*2)/8;i++){
@ -1463,19 +1514,44 @@ int slsReceiverTCPIPInterface::eiger_read_frame(){
(*(((uint64_t*)retval)+i)) = temp;
*/
}
arg = index-startIndex;
/*
//dr = 16, hence uint16_t
for(inum = 0; inum < 2; inum++)
cprintf(MAGENTA,"after htonl %d,0 :%d\n",inum,((uint8_t)(*((uint8_t*)((char*)(retval+(inum*(dynamicrange/8))))))));
for(inum = 254; inum < 258; inum++)
cprintf(MAGENTA,"after htonl %d,0 :%d\n",inum,((uint8_t)(*((uint8_t*)((char*)(retval+(inum*(dynamicrange/8))))))));
for(inum = 0; inum < 2; inum++)
cprintf(MAGENTA,"after htonl %d,2 :%d\n",inum,((uint8_t)(*((uint8_t*)((char*)(retval+((2048+inum)*(dynamicrange/8))))))));
for(inum = 254; inum < 258; inum++)
cprintf(MAGENTA,"after htonl %d,2 :%d\n",inum,((uint8_t)(*((uint8_t*)((char*)(retval+((2048+inum)*(dynamicrange/8))))))));
*/
acquisitionIndex = index-startAcquisitionIndex;
if(acquisitionIndex == -1)
startFrameIndex = -1;
else
frameIndex = index-startFrameIndex;
#ifdef VERY_VERY_DEBUG
cout << "arg calculated is:"<<arg<<endl;
cout <<"index:"<<index<<" startindex:"<<startIndex<<endl;
cout << "acquisitionIndex calculated is:" << acquisitionIndex << endl;
cout << "frameIndex calculated is:" << frameIndex << endl;
cout << "index:" << index << endl;
cout << "startAcquisitionIndex:" << startAcquisitionIndex << endl;
cout << "startFrameIndex:" << startFrameIndex << endl;
#endif
}
}
#ifdef VERBOSE
//if(arg!=-1){
if(frameIndex!=-1){
cout << "fName:" << fName << endl;
cout << "findex:" << dec << arg << endl;
//}
cout << "acquisitionIndex:" << acquisitionIndex << endl;
cout << "frameIndex:" << frameIndex << endl;
cout << "startAcquisitionIndex:" << startAcquisitionIndex << endl;
cout << "startFrameIndex:" << startFrameIndex << endl;
}
#endif
@ -1495,7 +1571,8 @@ int slsReceiverTCPIPInterface::eiger_read_frame(){
}
else{
socket->SendDataOnly(fName,MAX_STR_LENGTH);
socket->SendDataOnly(&arg,sizeof(arg));
socket->SendDataOnly(&acquisitionIndex,sizeof(acquisitionIndex));
socket->SendDataOnly(&frameIndex,sizeof(frameIndex));
socket->SendDataOnly(retval,dataSize);
}