diff --git a/slsDetectorSoftware/eigerDetectorServer/Beb.cxx b/slsDetectorSoftware/eigerDetectorServer/Beb.cxx index 436aaed89..aa358e9e0 100644 --- a/slsDetectorSoftware/eigerDetectorServer/Beb.cxx +++ b/slsDetectorSoftware/eigerDetectorServer/Beb.cxx @@ -377,7 +377,7 @@ bool Beb::SendMultiReadRequest(unsigned int beb_number, unsigned int left_right, else if(left_right == 3) send_data[0] = 0x000c0000; else return 0; - packet_size/=2; + //packet_size/=2; if(dst_number>0x3f) return 0; if(packet_size>0x3ff) return 0; if(npackets==0||npackets>0x100) return 0; diff --git a/slsDetectorSoftware/eigerDetectorServer/EigerBackEndFunctions.c b/slsDetectorSoftware/eigerDetectorServer/EigerBackEndFunctions.c index be7a87aad..b10301b00 100644 --- a/slsDetectorSoftware/eigerDetectorServer/EigerBackEndFunctions.c +++ b/slsDetectorSoftware/eigerDetectorServer/EigerBackEndFunctions.c @@ -123,7 +123,13 @@ int EigerSetupTableEntryLeft(int ipad, long long int macad, long long int detect (unsigned int)((macad>>8)&0xFF), (unsigned int)((macad>>0)&0xFF)); - +/* + if(((detectormacadd>>40)&0xFF)<9) + sprintf(src_mac,"0%s",detectormacadd); + if(((macad>>40)&0xFF)<9) + sprintf(dst_mac,"0%s",macad); +*/ + strcpy(src_mac,"00:aa:bb:cc:dd:ee"); printf("Seting up Table Entry Left:\n"); printf("src_port:%d\n",src_port); printf("dst_port:%d\n",dst_port); @@ -132,8 +138,10 @@ int EigerSetupTableEntryLeft(int ipad, long long int macad, long long int detect printf("src_mac:%s\n",src_mac); printf("dst_mac:%s\n\n",dst_mac); + + eiger_back_ret_val=0; - eiger_back_message_length = sprintf(eiger_back_message,"setuptableentry %d %d %d %s %s %d %s %s %d",1,0,0,src_mac,src_ip,src_port,dst_mac,dst_ip,dst_port); + eiger_back_message_length = sprintf(eiger_back_message,"setuptableentry %d %d %d %s %s %d %s %s %d",34,0,0,src_mac,src_ip,src_port,dst_mac,dst_ip,dst_port); return EigerBackSendCMD(); } @@ -158,7 +166,7 @@ int EigerSetupTableEntryRight(int ipad, long long int macad, long long int detec (unsigned int)((macad>>8)&0xFF), (unsigned int)((macad>>0)&0xFF)); - + strcpy(src_mac,"00:aa:bb:cc:dd:ee"); printf("Seting up Table Entry Right:\n"); printf("src_port:%d\n",src_port); printf("dst_port:%d\n",dst_port); @@ -168,7 +176,7 @@ int EigerSetupTableEntryRight(int ipad, long long int macad, long long int detec printf("dst_mac:%s\n\n",dst_mac); eiger_back_ret_val=0; - eiger_back_message_length = sprintf(eiger_back_message,"setuptableentry %d %d %d %s %s %d %s %s %d",1,0,32,src_mac,src_ip,src_port,dst_mac,dst_ip,dst_port); + eiger_back_message_length = sprintf(eiger_back_message,"setuptableentry %d %d %d %s %s %d %s %s %d",34,0,32,src_mac,src_ip,src_port,dst_mac,dst_ip,dst_port); return EigerBackSendCMD(); } @@ -176,10 +184,25 @@ int EigerSetupTableEntryRight(int ipad, long long int macad, long long int detec int RequestImages(){ + printf("Going to request images\n"); eiger_back_ret_val=0; eiger_back_message_length = sprintf(eiger_back_message,"requestimages %d",0); return EigerBackSendCMD(); } +int SetDestinationParameters(int i){ + SetLeftDestinationParameters(i); + return SetRightDestinationParameters(i); +} +int SetLeftDestinationParameters(int i){ + eiger_back_ret_val=0; + eiger_back_message_length = sprintf(eiger_back_message,"setdstparameters %d %d %d",0,1,i); + return EigerBackSendCMD(); +} +int SetRightDestinationParameters(int i){ + eiger_back_ret_val=0; + eiger_back_message_length = sprintf(eiger_back_message,"setdstparameters %d %d %d",0,32,i); + return EigerBackSendCMD(); +} diff --git a/slsDetectorSoftware/eigerDetectorServer/FebControl.cxx b/slsDetectorSoftware/eigerDetectorServer/FebControl.cxx index 13a73a585..92e72e81d 100644 --- a/slsDetectorSoftware/eigerDetectorServer/FebControl.cxx +++ b/slsDetectorSoftware/eigerDetectorServer/FebControl.cxx @@ -813,8 +813,10 @@ bool FebControl::AcquisitionInProgress(){ for(unsigned int i=1;iGetTopLeftAddress(),status_reg_r)&&GetDAQStatusRegister(modules[i]->GetTopRightAddress(),status_reg_l))){ - for(int i=0;i<100;i++) cout<<"Waring trouble reading status register. Returning zero to avoid inifite loops, this could cause trouble!"<GetTopLeftAddress(),status_reg_r)&&GetDAQStatusRegister(modules[i]->GetTopRightAddress(),status_reg_l))){*/ + if(!(GetDAQStatusRegister(modules[i]->GetTopLeftAddress(),status_reg_r)||GetDAQStatusRegister(modules[i]->GetTopRightAddress(),status_reg_l))){ + for(int i=0;i<2;i++) cout<<"Waring trouble reading status register. Returning zero to avoid inifite loops, this could cause trouble!"<timewait2?timewait1:timewait2; + /*RequestImages();done inside startacqusition *//** polling should be done in server */ + printf("status:%d\n",EigerRunStatus()); + /*while(EigerRunStatus())*/ + printf("going to randomly wait for %f us\n",tempframes*(t/1000)); + for(i=0;i= 0){ printf(" Setting number of frames: %d\n",(unsigned int)val); EigerSetNumberOfExposures((unsigned int)val); + SetDestinationParameters(val); + tempframes = val; }return EigerGetNumberOfExposures(); case ACQUISITION_TIME: if(val >= 0){ printf(" Setting exp time: %fs\n",val/(1E9)); EigerSetExposureTime(val/(1E9)); + timewait1 = val; }return (EigerGetExposureTime()*(1E9)); case FRAME_PERIOD: if(val >= 0){ printf(" Setting acq period: %fs\n",val/(1E9)); EigerSetExposurePeriod(val/(1E9)); + timewait2 = val; }return (EigerGetExposurePeriod()*(1E9)); /* case DELAY_AFTER_TRIGGER: if(val >= 0) diff --git a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp index ce0dcbc3c..3493d8e28 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetectorCommand.cpp @@ -999,7 +999,9 @@ string slsDetectorCommand::cmdData(int narg, char *args[], int action) { myDet->setThreadedProcessing(0); myDet->setOnline(ONLINE_FLAG); myDet->readAll(); - myDet->processData(1); + //processdata in receiver is useful only for gui purposes + if(myDet->setReceiverOnline()==OFFLINE_FLAG) + myDet->processData(1); myDet->setThreadedProcessing(b); return string(""); } @@ -1031,7 +1033,9 @@ string slsDetectorCommand::cmdFrame(int narg, char *args[], int action) { myDet->setThreadedProcessing(0); myDet->setOnline(ONLINE_FLAG); myDet->readFrame(); - myDet->processData(1); + //processdata in receiver is useful only for gui purposes + if(myDet->setReceiverOnline()==OFFLINE_FLAG) + myDet->processData(1); myDet->setThreadedProcessing(b); return string("ok"); } @@ -4012,10 +4016,11 @@ string slsDetectorCommand::cmdReceiver(int narg, char *args[], int action) { else if(!strcasecmp(args[1],"stop")){ myDet->startReceiverReadout(); runStatus s = myDet->getReceiverStatus(); - while((s != RUN_FINISHED)&&(s != IDLE)) + while(s != RUN_FINISHED){ usleep(50000); - if(s != IDLE) - myDet->stopReceiver(); + s = myDet->getReceiverStatus(); + } + myDet->stopReceiver(); } else return helpReceiver(narg, args, action);