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

@ -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;