mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-09 03:20:42 +02:00
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:
parent
bb12fe77d3
commit
6a49d8a6df
@ -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));
|
||||||
n = controlSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP));
|
|
||||||
#ifdef VERBOSE
|
#ifdef VERBOSE
|
||||||
cout << "Updating detector last modighfied by " << lastClientIP << std::endl;// commented out by dhanya for now
|
cout << "Updating detector last modified by " << lastClientIP << std::endl;
|
||||||
#endif
|
#endif
|
||||||
break;
|
n = controlSocket->ReceiveDataOnly(&nm,sizeof(nm));
|
||||||
default:
|
thisDetector->nMod[X]=nm;
|
||||||
n = controlSocket->ReceiveDataOnly(lastClientIP,sizeof(lastClientIP));
|
n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
|
||||||
#ifdef VERBOSE
|
thisDetector->nMod[Y]=nm;
|
||||||
cout << "Updating detector last modified by " << lastClientIP << std::endl;
|
thisDetector->nMods=thisDetector->nMod[Y]*thisDetector->nMod[X];
|
||||||
#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( &nm,sizeof(nm));
|
||||||
thisDetector->dynamicRange=nm;
|
thisDetector->dynamicRange=nm;
|
||||||
|
|
||||||
n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
|
n = controlSocket->ReceiveDataOnly( &nm,sizeof(nm));
|
||||||
thisDetector->dataBytes=nm;
|
thisDetector->dataBytes=nm;
|
||||||
//t=setSettings(GET_SETTINGS);
|
//t=setSettings(GET_SETTINGS);
|
||||||
n = controlSocket->ReceiveDataOnly( &t,sizeof(t));
|
n = controlSocket->ReceiveDataOnly( &t,sizeof(t));
|
||||||
thisDetector->currentSettings=t;
|
thisDetector->currentSettings=t;
|
||||||
//thr=getThresholdEnergy();
|
|
||||||
n = controlSocket->ReceiveDataOnly( &thr,sizeof(thr));
|
|
||||||
thisDetector->currentThresholdEV=thr;
|
|
||||||
//retval=setFrames(tns);
|
|
||||||
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
|
||||||
thisDetector->timerValue[FRAME_NUMBER]=retval;
|
|
||||||
// retval=setExposureTime(tns);
|
|
||||||
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
|
||||||
thisDetector->timerValue[ACQUISITION_TIME]=retval;
|
|
||||||
|
|
||||||
//retval=setPeriod(tns);
|
if(thisDetector->myDetectorType!= GOTTHARD){
|
||||||
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
//thr=getThresholdEnergy();
|
||||||
thisDetector->timerValue[FRAME_PERIOD]=retval;
|
n = controlSocket->ReceiveDataOnly( &thr,sizeof(thr));
|
||||||
//retval=setDelay(tns);
|
thisDetector->currentThresholdEV=thr;
|
||||||
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
}
|
||||||
thisDetector->timerValue[DELAY_AFTER_TRIGGER]=retval;
|
|
||||||
// retval=setGates(tns);
|
//retval=setFrames(tns);
|
||||||
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||||
thisDetector->timerValue[GATES_NUMBER]=retval;
|
thisDetector->timerValue[FRAME_NUMBER]=retval;
|
||||||
//retval=setProbes(tns);
|
// retval=setExposureTime(tns);
|
||||||
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||||
thisDetector->timerValue[PROBES_NUMBER]=retval;
|
thisDetector->timerValue[ACQUISITION_TIME]=retval;
|
||||||
//retval=setTrains(tns);
|
|
||||||
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
//retval=setPeriod(tns);
|
||||||
thisDetector->timerValue[CYCLES_NUMBER]=retval;
|
n = controlSocket->ReceiveDataOnly( &retval,sizeof(int64_t));
|
||||||
}
|
thisDetector->timerValue[FRAME_PERIOD]=retval;
|
||||||
return OK;
|
//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;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user