mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-20 02:40:03 +02:00
npoints added to the final data and status and timer left available on the stop socket
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@12 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
parent
aeade907d0
commit
2cfbc846b9
@ -497,10 +497,16 @@ string mythenDetector::executeLine(int narg, char *args[], int action) {
|
|||||||
if (action==PUT_ACTION) {
|
if (action==PUT_ACTION) {
|
||||||
sscanf(args[1],"%d",&ival);
|
sscanf(args[1],"%d",&ival);
|
||||||
setThresholdEnergy(ival);
|
setThresholdEnergy(ival);
|
||||||
|
|
||||||
}
|
}
|
||||||
sprintf(answer,"%d",getThresholdEnergy());
|
sprintf(answer,"%d",getThresholdEnergy());
|
||||||
return string(answer);
|
return string(answer);
|
||||||
|
} else if (var=="vthreshold") {
|
||||||
|
if (action==PUT_ACTION) {
|
||||||
|
sscanf(args[1],"%f",&fval);
|
||||||
|
setDAC(fval, THRESHOLD);
|
||||||
|
}
|
||||||
|
sprintf(answer,"%f",setDAC(-1,THRESHOLD));
|
||||||
|
return string(answer);
|
||||||
}
|
}
|
||||||
//timers
|
//timers
|
||||||
|
|
||||||
@ -508,7 +514,6 @@ string mythenDetector::executeLine(int narg, char *args[], int action) {
|
|||||||
if (action==PUT_ACTION) {
|
if (action==PUT_ACTION) {
|
||||||
sscanf(args[1],"%f",&fval);// in seconds!
|
sscanf(args[1],"%f",&fval);// in seconds!
|
||||||
setTimer(ACQUISITION_TIME,fval*1E+9);
|
setTimer(ACQUISITION_TIME,fval*1E+9);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(answer,"%f",(float)setTimer(ACQUISITION_TIME)*1E-9);
|
sprintf(answer,"%f",(float)setTimer(ACQUISITION_TIME)*1E-9);
|
||||||
@ -2219,9 +2224,9 @@ void* mythenDetector::processData(int delflag) {
|
|||||||
delete [] ang;
|
delete [] ang;
|
||||||
} else {
|
} else {
|
||||||
if (thisDetector->correctionMask!=0)
|
if (thisDetector->correctionMask!=0)
|
||||||
thisData=new detectorData(ffcdata,ffcerr,NULL,thisDetector->progressIndex+1,(createFileName().append(".dat")).c_str());
|
thisData=new detectorData(ffcdata,ffcerr,NULL,thisDetector->progressIndex+1,(createFileName().append(".dat")).c_str(),thisDetector->nChans*thisDetector->nChips*thisDetector->nMods);
|
||||||
else
|
else
|
||||||
thisData=new detectorData(ffcdata,ffcerr,NULL,thisDetector->progressIndex+1,(createFileName().append(".raw")).c_str());
|
thisData=new detectorData(ffcdata,ffcerr,NULL,thisDetector->progressIndex+1,(createFileName().append(".raw")).c_str(),thisDetector->nChans*thisDetector->nChips*thisDetector->nMods);
|
||||||
finalDataQueue.push(thisData);
|
finalDataQueue.push(thisData);
|
||||||
#ifdef ACQVERBOSE
|
#ifdef ACQVERBOSE
|
||||||
std::cout<< "------------------------------------pushing final data queue " << finalDataQueue.size() << std::endl;
|
std::cout<< "------------------------------------pushing final data queue " << finalDataQueue.size() << std::endl;
|
||||||
@ -2341,3 +2346,65 @@ void* startProcessDataNoDelete(void *n) {
|
|||||||
pthread_exit(NULL);
|
pthread_exit(NULL);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int mythenDetector::getRunStatus(){
|
||||||
|
int fnum=F_GET_RUN_STATUS;
|
||||||
|
int retval;
|
||||||
|
int ret=FAIL;
|
||||||
|
char mess[100];
|
||||||
|
#ifdef VERBOSE
|
||||||
|
std::cout<< "MYTHEN Getting status "<< std::endl;
|
||||||
|
#endif
|
||||||
|
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||||
|
if (stopSocket) {
|
||||||
|
if (stopSocket->Connect()>=0) {
|
||||||
|
stopSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||||
|
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||||
|
if (ret!=OK) {
|
||||||
|
stopSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||||
|
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||||
|
} else
|
||||||
|
stopSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||||
|
stopSocket->Disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return retval;
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
int64_t mythenDetector::getTimeLeft(timerIndex index){
|
||||||
|
|
||||||
|
|
||||||
|
int fnum=F_GET_TIME_LEFT;
|
||||||
|
int64_t retval;
|
||||||
|
char mess[100];
|
||||||
|
int ret=OK;
|
||||||
|
|
||||||
|
#ifdef VERBOSE
|
||||||
|
std::cout<< "MYTHEN Getting timer "<< index << std::endl;
|
||||||
|
#endif
|
||||||
|
if (thisDetector->onlineFlag==ONLINE_FLAG) {
|
||||||
|
if (stopSocket) {
|
||||||
|
if (stopSocket->Connect()>=0) {
|
||||||
|
stopSocket->SendDataOnly(&fnum,sizeof(fnum));
|
||||||
|
stopSocket->SendDataOnly(&index,sizeof(index));
|
||||||
|
stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
|
||||||
|
if (ret!=OK) {
|
||||||
|
stopSocket->ReceiveDataOnly(mess,sizeof(mess));
|
||||||
|
std::cout<< "Detector returned error: " << mess << std::endl;
|
||||||
|
} else {
|
||||||
|
stopSocket->ReceiveDataOnly(&retval,sizeof(retval));
|
||||||
|
//thisDetector->timerValue[index]=retval;
|
||||||
|
}
|
||||||
|
stopSocket->Disconnect();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#ifdef VERBOSE
|
||||||
|
std::cout<< "Time left is "<< retval << std::endl;
|
||||||
|
#endif
|
||||||
|
return retval;
|
||||||
|
|
||||||
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user