updated the updatedetector function for gotthard

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@149 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d 2012-03-16 15:23:34 +00:00
parent bb12fe77d3
commit 6a49d8a6df

View File

@ -2773,65 +2773,66 @@ detectorSettings slsDetector::setSettings( detectorSettings isettings, int imod)
int slsDetector::updateDetectorNoWait() { int slsDetector::updateDetectorNoWait() {
// int ret=OK; // int ret=OK;
enum detectorSettings t; enum detectorSettings t;
int thr, n, nm; int thr, n, nm;
// int it; // int it;
int64_t retval;// tns=-1; int64_t retval;// tns=-1;
char lastClientIP[INET_ADDRSTRLEN]; char lastClientIP[INET_ADDRSTRLEN];
switch(thisDetector->myDetectorType){
case GOTTHARD:
n = controlSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP));
#ifdef VERBOSE
cout << "Updating detector last modighfied by " << lastClientIP << std::endl;// commented out by dhanya for now
#endif
break;
default:
n = controlSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP));
#ifdef VERBOSE
cout << "Updating detector last modified by " << lastClientIP << std::endl;
#endif
n = controlSocket->ReceiveDataOnly(&nm,sizeof(nm));
thisDetector->nMod[X]=nm;
n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
thisDetector->nMod[Y]=nm;
thisDetector->nMods=thisDetector->nMod[Y]*thisDetector->nMod[X];
n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm)); n = controlSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP));
thisDetector->dynamicRange=nm; #ifdef VERBOSE
cout << "Updating detector last modified by " << lastClientIP << std::endl;
n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm)); #endif
thisDetector->dataBytes=nm; n = controlSocket->ReceiveDataOnly(&nm,sizeof(nm));
//t=setSettings(GET_SETTINGS); thisDetector->nMod[X]=nm;
n = controlSocket->ReceiveDataOnly( &t,sizeof(t)); n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
thisDetector->currentSettings=t; thisDetector->nMod[Y]=nm;
//thr=getThresholdEnergy(); thisDetector->nMods=thisDetector->nMod[Y]*thisDetector->nMod[X];
n = controlSocket->ReceiveDataOnly( &thr,sizeof(thr));
thisDetector->currentThresholdEV=thr; n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
//retval=setFrames(tns); thisDetector->dynamicRange=nm;
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
thisDetector->timerValue[FRAME_NUMBER]=retval; n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
// retval=setExposureTime(tns); thisDetector->dataBytes=nm;
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t)); //t=setSettings(GET_SETTINGS);
thisDetector->timerValue[ACQUISITION_TIME]=retval; n = controlSocket->ReceiveDataOnly( &t,sizeof(t));
thisDetector->currentSettings=t;
//retval=setPeriod(tns);
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t)); if(thisDetector->myDetectorType!= GOTTHARD){
thisDetector->timerValue[FRAME_PERIOD]=retval; //thr=getThresholdEnergy();
//retval=setDelay(tns); n = controlSocket->ReceiveDataOnly( &thr,sizeof(thr));
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t)); thisDetector->currentThresholdEV=thr;
thisDetector->timerValue[DELAY_AFTER_TRIGGER]=retval; }
// retval=setGates(tns);
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t)); //retval=setFrames(tns);
thisDetector->timerValue[GATES_NUMBER]=retval; n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
//retval=setProbes(tns); thisDetector->timerValue[FRAME_NUMBER]=retval;
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t)); // retval=setExposureTime(tns);
thisDetector->timerValue[PROBES_NUMBER]=retval; n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
//retval=setTrains(tns); thisDetector->timerValue[ACQUISITION_TIME]=retval;
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
thisDetector->timerValue[CYCLES_NUMBER]=retval; //retval=setPeriod(tns);
} n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
return OK; thisDetector->timerValue[FRAME_PERIOD]=retval;
//retval=setDelay(tns);
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
thisDetector->timerValue[DELAY_AFTER_TRIGGER]=retval;
// retval=setGates(tns);
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
thisDetector->timerValue[GATES_NUMBER]=retval;
//retval=setProbes(tns);
if(thisDetector->myDetectorType!= GOTTHARD){
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
thisDetector->timerValue[PROBES_NUMBER]=retval;
}
//retval=setTrains(tns);
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
thisDetector->timerValue[CYCLES_NUMBER]=retval;
return OK;
} }