bugfix gotthard server and client to set roi and disable it, problem still exists with frame numbering between roi modes but can only be fixed in firmware

This commit is contained in:
2018-09-18 18:02:01 +02:00
parent 255931bbde
commit 961489edb1
15 changed files with 53 additions and 52 deletions

View File

@ -1 +0,0 @@
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv4.0.0.0

View File

@ -0,0 +1 @@
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv4.0.0.1

View File

@ -2,4 +2,4 @@
#define APIRECEIVER 0x180718 #define APIRECEIVER 0x180718
#define APIEIGER 0x180820 #define APIEIGER 0x180820
#define APIJUNGFRAU 0x180820 #define APIJUNGFRAU 0x180820
#define APIGOTTHARD 0x180820 #define APIGOTTHARD 0x180918

View File

@ -31,6 +31,7 @@ versioning:
$(PROGS): $(OBJS) $(PROGS): $(OBJS)
# echo $(OBJS) # echo $(OBJS)
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS_$@) $(LDFLAGS_$@) $(CC) $(CFLAGS) -o $@ $^ $(LDLIBS_$@) $(LDFLAGS_$@)
rm gotthardDetectorServer.gdb
install: $(PROGS) install: $(PROGS)

View File

@ -1261,6 +1261,7 @@ int setADC(int adc){
int configureMAC(int ipad,long long int macad,long long int detectormacad, int detipad, int ival, int udpport){ int configureMAC(int ipad,long long int macad,long long int detectormacad, int detipad, int ival, int udpport){
startReceiver(1);
#ifdef DDEBUG #ifdef DDEBUG
printf("Chip of Intrst Reg:%x\n",bus_r(CHIP_OF_INTRST_REG)); printf("Chip of Intrst Reg:%x\n",bus_r(CHIP_OF_INTRST_REG));

View File

@ -1,9 +1,9 @@
Path: slsDetectorsPackage/slsDetectorSoftware/gotthardDetectorServer Path: slsDetectorsPackage/slsDetectorSoftware/gotthardDetectorServer
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
Repsitory UUID: 63c130a3806b47332b1532ab00f9f344c5839e0e Repsitory UUID: 255931bbde2721a1d7ddf3422ba9ee79ec7655f5
Revision: 236 Revision: 237
Branch: 4.0.0-rc Branch: 4.0.0
Last Changed Author: Dhanya_Thattil Last Changed Author: Dhanya_Thattil
Last Changed Rev: 3986 Last Changed Rev: 4000
Last Changed Date: 2018-08-20 11:38:13.000000002 +0200 ./server_funcs.h Last Changed Date: 2018-09-18 17:37:25.000000002 +0200 ./server_funcs.c

View File

@ -1,6 +1,6 @@
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git" #define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
#define GITREPUUID "63c130a3806b47332b1532ab00f9f344c5839e0e" #define GITREPUUID "255931bbde2721a1d7ddf3422ba9ee79ec7655f5"
#define GITAUTH "Dhanya_Thattil" #define GITAUTH "Dhanya_Thattil"
#define GITREV 0x3986 #define GITREV 0x4000
#define GITDATE 0x20180820 #define GITDATE 0x20180918
#define GITBRANCH "4.0.0-rc" #define GITBRANCH "4.0.0"

View File

@ -2486,7 +2486,7 @@ ROI* setROI(int n, ROI arg[], int *retvalsize, int *ret){
} }
} }
} }
printf("\tGoing to enable adc: %d\n", adc);
//set rois for just 1 adc - take only 1st roi //set rois for just 1 adc - take only 1st roi
if(adc!=-1){ if(adc!=-1){
@ -2495,10 +2495,14 @@ ROI* setROI(int n, ROI arg[], int *retvalsize, int *ret){
rois[0].ymin=-1; rois[0].ymin=-1;
rois[0].ymax=-1; rois[0].ymax=-1;
nROI = 1; nROI = 1;
printf("\tActual xmin:%d xmax:%d\n",rois[0].xmin,rois[0].xmax);
}else }else
nROI = 0; nROI = 0;
if((arg[0].xmin!=rois[0].xmin)||(arg[0].xmax!=rois[0].xmax)||(arg[0].ymin!=rois[0].ymin)||(arg[0].ymax!=rois[0].ymax)) if((n!=0) && ((arg[0].xmin!=rois[0].xmin)||
(arg[0].xmax!=rois[0].xmax)||
(arg[0].ymin!=rois[0].ymin)||
(arg[0].ymax!=rois[0].ymax)))
*ret=FAIL; *ret=FAIL;
if(n!=nROI) if(n!=nROI)
*ret=FAIL; *ret=FAIL;
@ -2508,9 +2512,11 @@ ROI* setROI(int n, ROI arg[], int *retvalsize, int *ret){
} }
//#ifdef VERBOSE //#ifdef VERBOSE
if (nROI) {
printf("Rois:\n"); printf("Rois:\n");
for( i=0;i<nROI;i++) for( i=0;i<nROI;i++)
printf("%d\t%d\t%d\t%d\n",rois[i].xmin,rois[i].xmax,rois[i].ymin,rois[i].ymax); printf("\t%d\t%d\t%d\t%d\n\n",rois[i].xmin,rois[i].xmax,rois[i].ymin,rois[i].ymax);
}else printf("Rois: 0\n\n");
//#endif //#endif
*retvalsize = nROI; *retvalsize = nROI;
return rois; return rois;

View File

@ -47,8 +47,8 @@
#define DEFAULT_PHASE_SHIFT 120 #define DEFAULT_PHASE_SHIFT 120
#define DEFAULT_IP_PACKETSIZE 0x0522 #define DEFAULT_IP_PACKETSIZE 0x0522
#define DEFAULT_UDP_PACKETSIZE 0x050E #define DEFAULT_UDP_PACKETSIZE 0x050E
#define ADC1_IP_PACKETSIZE 256*2+14+20 #define ADC1_IP_PACKETSIZE (256*2+14+20)
#define ADC1_UDP_PACKETSIZE 256*2+4+8+2 #define ADC1_UDP_PACKETSIZE (256*2+4+8+2)
#ifdef VIRTUAL #ifdef VIRTUAL
#define DEBUGOUT #define DEBUGOUT

View File

@ -103,6 +103,7 @@ int init_detector( int b) {
setSynchronization(GET_SYNCHRONIZATION_MODE); setSynchronization(GET_SYNCHRONIZATION_MODE);
startReceiver(0); startReceiver(0);
setMasterSlaveConfiguration(); setMasterSlaveConfiguration();
setADC(-1);
} }
strcpy(mess,"dummy message"); strcpy(mess,"dummy message");
strcpy(lastClientIP,"none"); strcpy(lastClientIP,"none");
@ -2341,9 +2342,9 @@ int set_roi(int file_des) {
ret=FAIL; ret=FAIL;
} }
//#ifdef VERBOSE //#ifdef VERBOSE
printf("Setting ROI to:"); printf("\n\nSetting ROI: nroi=%d\n",nroi);
for( i=0;i<nroi;i++) for( i=0;i<nroi;i++)
printf("%d\t%d\t%d\t%d\n",arg[i].xmin,arg[i].xmax,arg[i].ymin,arg[i].ymax); printf("\t%d\t%d\t%d\t%d\n",arg[i].xmin,arg[i].xmax,arg[i].ymin,arg[i].ymax);
//#endif //#endif
} }
/* execute action if the arguments correctly arrived*/ /* execute action if the arguments correctly arrived*/

View File

@ -3949,7 +3949,7 @@ int slsDetector::readAllNoWait() {
int slsDetector::configureMAC() { int slsDetector::configureMAC() {
int i; int i;
int ret=FAIL; int ret=FAIL;
int fnum=F_CONFIGURE_MAC,fnum2=F_RECEIVER_SHORT_FRAME; int fnum=F_CONFIGURE_MAC;
char mess[MAX_STR_LENGTH]=""; char mess[MAX_STR_LENGTH]="";
char arg[6][50];memset(arg,0,sizeof(char)*6*50); char arg[6][50];memset(arg,0,sizeof(char)*6*50);
int retval=-1; int retval=-1;
@ -4150,24 +4150,19 @@ int slsDetector::configureMAC() {
setErrorMask((getErrorMask())|(COULD_NOT_CONFIGURE_MAC)); setErrorMask((getErrorMask())|(COULD_NOT_CONFIGURE_MAC));
} }
else if (thisDetector->myDetectorType==GOTTHARD){ else if (thisDetector->myDetectorType==GOTTHARD){
//set frames per file - only for gotthard
pthread_mutex_lock(&ms); // update roi in update receiver
if(retval==-1)
setFramesPerFile(MAX_FRAMES_PER_FILE);
else
setFramesPerFile(SHORT_MAX_FRAMES_PER_FILE);
pthread_mutex_unlock(&ms);
//connect to receiver
if(thisDetector->receiverOnlineFlag==ONLINE_FLAG){ if(thisDetector->receiverOnlineFlag==ONLINE_FLAG){
int fnum=F_RECEIVER_SHORT_FRAME;
#ifdef VERBOSE #ifdef VERBOSE
std::cout << "Sending adc val to receiver " << retval << std::endl; std::cout << "Sending adc val to receiver " << retval << std::endl;
#endif #endif
if (connectData() == OK){ if (connectData() == OK){
ret=thisReceiver->sendInt(fnum2,retval,retval); ret=thisReceiver->sendInt(fnum,retval,retval);
disconnectData(); disconnectData();
} }
if(ret==FAIL) if(ret==FAIL)
setErrorMask((getErrorMask())|(COULD_NOT_CONFIGURE_MAC)); setErrorMask((getErrorMask())|(COULDNOT_SET_ROI));
} }
} }
@ -6132,17 +6127,23 @@ int slsDetector::sendROI(int n,ROI roiLimits[]) {
} }
//update client //update client
if(ret!=FAIL){ if(ret==FAIL){
setErrorMask((getErrorMask())|(COULDNOT_SET_ROI));
} else {
for(int i=0;i<retvalsize;++i) for(int i=0;i<retvalsize;++i)
thisDetector->roiLimits[i]=retval[i]; thisDetector->roiLimits[i]=retval[i];
thisDetector->nROI = retvalsize; thisDetector->nROI = retvalsize;
} }
//#ifdef VERBOSE #ifdef VERBOSE
for(int j=0;j<thisDetector->nROI;++j) for(int j=0;j<thisDetector->nROI;++j)
cout<<"get"<< roiLimits[j].xmin<<"\t"<<roiLimits[j].xmax<<"\t" cout<<"ROI [" <<j<<"] ("<< roiLimits[j].xmin<<"\t"<<roiLimits[j].xmax<<"\t"
<<roiLimits[j].ymin<<"\t"<<roiLimits[j].ymax<<endl; <<roiLimits[j].ymin<<"\t"<<roiLimits[j].ymax<<")"<<endl;
//#endif #endif
// update receiver
if (thisDetector->myDetectorType == GOTTHARD)
configureMAC();
return ret; return ret;
} }
@ -9026,13 +9027,6 @@ int slsDetector::startReceiver() {
} }
} }
// tell detector to send to receiver (if start receiver failed, this is not executed)
if(((thisDetector->myDetectorType == GOTTHARD ||
thisDetector->myDetectorType == PROPIX) && ret!= FAIL))
return prepareAcquisition(); // send data to receiver for these detectors
return ret; return ret;
} }
@ -9044,11 +9038,6 @@ int slsDetector::stopReceiver() {
int ret = FAIL; int ret = FAIL;
char mess[MAX_STR_LENGTH] = ""; char mess[MAX_STR_LENGTH] = "";
if(thisDetector->myDetectorType == GOTTHARD ||
thisDetector->myDetectorType == PROPIX)
cleanupAcquisition(); // reset (send data to receiver) for these detectors,
//so back to CPU (dont care about ok/fail at this point)
if (thisDetector->receiverOnlineFlag==ONLINE_FLAG) { if (thisDetector->receiverOnlineFlag==ONLINE_FLAG) {
#ifdef VERBOSE #ifdef VERBOSE
std::cout << "Stopping Receiver " << std::endl; std::cout << "Stopping Receiver " << std::endl;

View File

@ -4464,6 +4464,9 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) {
myDet->setOnline(ONLINE_FLAG); myDet->setOnline(ONLINE_FLAG);
if (cmd == "roi")
myDet->setReceiverOnline(ONLINE_FLAG);
if (action==PUT_ACTION) { if (action==PUT_ACTION) {
if (cmd=="maxmod") if (cmd=="maxmod")
return string("cannot put!"); return string("cannot put!");
@ -4481,10 +4484,10 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) {
ROI allroi[val]; ROI allroi[val];
pos=2; pos=2;
for(i=0;i<val;++i){ for(i=0;i<val;++i){
if ((!sscanf(args[++pos],"%d",&allroi[i].xmin)) || if ((!sscanf(args[pos++],"%d",&allroi[i].xmin)) ||
(!sscanf(args[++pos],"%d",&allroi[i].xmax)) || (!sscanf(args[pos++],"%d",&allroi[i].xmax)) ||
(!sscanf(args[++pos],"%d",&allroi[i].ymin)) || (!sscanf(args[pos++],"%d",&allroi[i].ymin)) ||
(!sscanf(args[++pos],"%d",&allroi[i].ymax)) ) (!sscanf(args[pos++],"%d",&allroi[i].ymax)) )
return string("cannot parse arguments for roi"); return string("cannot parse arguments for roi");
} }
myDet->setROI(val,allroi); myDet->setROI(val,allroi);