mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 12:57:13 +02:00
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:
@ -1 +0,0 @@
|
||||
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv4.0.0.0
|
1
serverBin/gotthardDetectorServerv4.0.0.1
Symbolic link
1
serverBin/gotthardDetectorServerv4.0.0.1
Symbolic link
@ -0,0 +1 @@
|
||||
../slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv4.0.0.1
|
@ -2,4 +2,4 @@
|
||||
#define APIRECEIVER 0x180718
|
||||
#define APIEIGER 0x180820
|
||||
#define APIJUNGFRAU 0x180820
|
||||
#define APIGOTTHARD 0x180820
|
||||
#define APIGOTTHARD 0x180918
|
||||
|
@ -31,6 +31,7 @@ versioning:
|
||||
$(PROGS): $(OBJS)
|
||||
# echo $(OBJS)
|
||||
$(CC) $(CFLAGS) -o $@ $^ $(LDLIBS_$@) $(LDFLAGS_$@)
|
||||
rm gotthardDetectorServer.gdb
|
||||
|
||||
|
||||
install: $(PROGS)
|
||||
|
@ -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){
|
||||
|
||||
startReceiver(1);
|
||||
|
||||
#ifdef DDEBUG
|
||||
printf("Chip of Intrst Reg:%x\n",bus_r(CHIP_OF_INTRST_REG));
|
||||
|
@ -1,9 +1,9 @@
|
||||
Path: slsDetectorsPackage/slsDetectorSoftware/gotthardDetectorServer
|
||||
URL: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repository Root: origin git@github.com:slsdetectorgroup/slsDetectorPackage.git
|
||||
Repsitory UUID: 63c130a3806b47332b1532ab00f9f344c5839e0e
|
||||
Revision: 236
|
||||
Branch: 4.0.0-rc
|
||||
Repsitory UUID: 255931bbde2721a1d7ddf3422ba9ee79ec7655f5
|
||||
Revision: 237
|
||||
Branch: 4.0.0
|
||||
Last Changed Author: Dhanya_Thattil
|
||||
Last Changed Rev: 3986
|
||||
Last Changed Date: 2018-08-20 11:38:13.000000002 +0200 ./server_funcs.h
|
||||
Last Changed Rev: 4000
|
||||
Last Changed Date: 2018-09-18 17:37:25.000000002 +0200 ./server_funcs.c
|
||||
|
@ -1,6 +1,6 @@
|
||||
#define GITURL "git@github.com:slsdetectorgroup/slsDetectorPackage.git"
|
||||
#define GITREPUUID "63c130a3806b47332b1532ab00f9f344c5839e0e"
|
||||
#define GITREPUUID "255931bbde2721a1d7ddf3422ba9ee79ec7655f5"
|
||||
#define GITAUTH "Dhanya_Thattil"
|
||||
#define GITREV 0x3986
|
||||
#define GITDATE 0x20180820
|
||||
#define GITBRANCH "4.0.0-rc"
|
||||
#define GITREV 0x4000
|
||||
#define GITDATE 0x20180918
|
||||
#define GITBRANCH "4.0.0"
|
||||
|
Binary file not shown.
Binary file not shown.
BIN
slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv4.0.0.1
Executable file
BIN
slsDetectorSoftware/gotthardDetectorServer/gotthardDetectorServerv4.0.0.1
Executable file
Binary file not shown.
@ -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
|
||||
if(adc!=-1){
|
||||
@ -2495,10 +2495,14 @@ ROI* setROI(int n, ROI arg[], int *retvalsize, int *ret){
|
||||
rois[0].ymin=-1;
|
||||
rois[0].ymax=-1;
|
||||
nROI = 1;
|
||||
printf("\tActual xmin:%d xmax:%d\n",rois[0].xmin,rois[0].xmax);
|
||||
}else
|
||||
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;
|
||||
if(n!=nROI)
|
||||
*ret=FAIL;
|
||||
@ -2508,9 +2512,11 @@ ROI* setROI(int n, ROI arg[], int *retvalsize, int *ret){
|
||||
}
|
||||
|
||||
//#ifdef VERBOSE
|
||||
printf("Rois:\n");
|
||||
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);
|
||||
if (nROI) {
|
||||
printf("Rois:\n");
|
||||
for( i=0;i<nROI;i++)
|
||||
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
|
||||
*retvalsize = nROI;
|
||||
return rois;
|
||||
|
@ -47,8 +47,8 @@
|
||||
#define DEFAULT_PHASE_SHIFT 120
|
||||
#define DEFAULT_IP_PACKETSIZE 0x0522
|
||||
#define DEFAULT_UDP_PACKETSIZE 0x050E
|
||||
#define ADC1_IP_PACKETSIZE 256*2+14+20
|
||||
#define ADC1_UDP_PACKETSIZE 256*2+4+8+2
|
||||
#define ADC1_IP_PACKETSIZE (256*2+14+20)
|
||||
#define ADC1_UDP_PACKETSIZE (256*2+4+8+2)
|
||||
|
||||
#ifdef VIRTUAL
|
||||
#define DEBUGOUT
|
||||
|
@ -103,6 +103,7 @@ int init_detector( int b) {
|
||||
setSynchronization(GET_SYNCHRONIZATION_MODE);
|
||||
startReceiver(0);
|
||||
setMasterSlaveConfiguration();
|
||||
setADC(-1);
|
||||
}
|
||||
strcpy(mess,"dummy message");
|
||||
strcpy(lastClientIP,"none");
|
||||
@ -2341,9 +2342,9 @@ int set_roi(int file_des) {
|
||||
ret=FAIL;
|
||||
}
|
||||
//#ifdef VERBOSE
|
||||
printf("Setting ROI to:");
|
||||
printf("\n\nSetting ROI: nroi=%d\n",nroi);
|
||||
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
|
||||
}
|
||||
/* execute action if the arguments correctly arrived*/
|
||||
|
@ -3949,7 +3949,7 @@ int slsDetector::readAllNoWait() {
|
||||
int slsDetector::configureMAC() {
|
||||
int i;
|
||||
int ret=FAIL;
|
||||
int fnum=F_CONFIGURE_MAC,fnum2=F_RECEIVER_SHORT_FRAME;
|
||||
int fnum=F_CONFIGURE_MAC;
|
||||
char mess[MAX_STR_LENGTH]="";
|
||||
char arg[6][50];memset(arg,0,sizeof(char)*6*50);
|
||||
int retval=-1;
|
||||
@ -4150,24 +4150,19 @@ int slsDetector::configureMAC() {
|
||||
setErrorMask((getErrorMask())|(COULD_NOT_CONFIGURE_MAC));
|
||||
}
|
||||
else if (thisDetector->myDetectorType==GOTTHARD){
|
||||
//set frames per file - only for gotthard
|
||||
pthread_mutex_lock(&ms);
|
||||
if(retval==-1)
|
||||
setFramesPerFile(MAX_FRAMES_PER_FILE);
|
||||
else
|
||||
setFramesPerFile(SHORT_MAX_FRAMES_PER_FILE);
|
||||
pthread_mutex_unlock(&ms);
|
||||
//connect to receiver
|
||||
|
||||
// update roi in update receiver
|
||||
if(thisDetector->receiverOnlineFlag==ONLINE_FLAG){
|
||||
int fnum=F_RECEIVER_SHORT_FRAME;
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Sending adc val to receiver " << retval << std::endl;
|
||||
#endif
|
||||
if (connectData() == OK){
|
||||
ret=thisReceiver->sendInt(fnum2,retval,retval);
|
||||
ret=thisReceiver->sendInt(fnum,retval,retval);
|
||||
disconnectData();
|
||||
}
|
||||
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
|
||||
if(ret!=FAIL){
|
||||
if(ret==FAIL){
|
||||
setErrorMask((getErrorMask())|(COULDNOT_SET_ROI));
|
||||
} else {
|
||||
for(int i=0;i<retvalsize;++i)
|
||||
thisDetector->roiLimits[i]=retval[i];
|
||||
thisDetector->nROI = retvalsize;
|
||||
}
|
||||
|
||||
//#ifdef VERBOSE
|
||||
#ifdef VERBOSE
|
||||
for(int j=0;j<thisDetector->nROI;++j)
|
||||
cout<<"get"<< roiLimits[j].xmin<<"\t"<<roiLimits[j].xmax<<"\t"
|
||||
<<roiLimits[j].ymin<<"\t"<<roiLimits[j].ymax<<endl;
|
||||
//#endif
|
||||
cout<<"ROI [" <<j<<"] ("<< roiLimits[j].xmin<<"\t"<<roiLimits[j].xmax<<"\t"
|
||||
<<roiLimits[j].ymin<<"\t"<<roiLimits[j].ymax<<")"<<endl;
|
||||
#endif
|
||||
|
||||
// update receiver
|
||||
if (thisDetector->myDetectorType == GOTTHARD)
|
||||
configureMAC();
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
@ -9044,11 +9038,6 @@ int slsDetector::stopReceiver() {
|
||||
int ret = FAIL;
|
||||
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) {
|
||||
#ifdef VERBOSE
|
||||
std::cout << "Stopping Receiver " << std::endl;
|
||||
|
@ -4464,6 +4464,9 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) {
|
||||
|
||||
myDet->setOnline(ONLINE_FLAG);
|
||||
|
||||
if (cmd == "roi")
|
||||
myDet->setReceiverOnline(ONLINE_FLAG);
|
||||
|
||||
if (action==PUT_ACTION) {
|
||||
if (cmd=="maxmod")
|
||||
return string("cannot put!");
|
||||
@ -4481,10 +4484,10 @@ string slsDetectorCommand::cmdDetectorSize(int narg, char *args[], int action) {
|
||||
ROI allroi[val];
|
||||
pos=2;
|
||||
for(i=0;i<val;++i){
|
||||
if ((!sscanf(args[++pos],"%d",&allroi[i].xmin)) ||
|
||||
(!sscanf(args[++pos],"%d",&allroi[i].xmax)) ||
|
||||
(!sscanf(args[++pos],"%d",&allroi[i].ymin)) ||
|
||||
(!sscanf(args[++pos],"%d",&allroi[i].ymax)) )
|
||||
if ((!sscanf(args[pos++],"%d",&allroi[i].xmin)) ||
|
||||
(!sscanf(args[pos++],"%d",&allroi[i].xmax)) ||
|
||||
(!sscanf(args[pos++],"%d",&allroi[i].ymin)) ||
|
||||
(!sscanf(args[pos++],"%d",&allroi[i].ymax)) )
|
||||
return string("cannot parse arguments for roi");
|
||||
}
|
||||
myDet->setROI(val,allroi);
|
||||
|
Reference in New Issue
Block a user