start and stop receiver for eiger doesnt include transmitting stage. set timer sends to anz type of receiver the num frames and acq period

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@796 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d
2014-03-20 10:23:19 +00:00
parent b6d18131e8
commit 1607ddb096
5 changed files with 77 additions and 67 deletions

View File

@ -3536,56 +3536,46 @@ int64_t slsDetector::setTimer(timerIndex index, int64_t t){
//send acquisiton period/frame number to receiver
switch(thisDetector->myDetectorType){
case EIGER:
if(index != FRAME_NUMBER)
return thisDetector->timerValue[index];
break;
//for gotthard and moench, mythen returns anyway because of no rxr
default:
if(index != FRAME_PERIOD)
return thisDetector->timerValue[index];
break;
}
if((ret != FAIL) && (t != -1)){
if(setReceiverOnline(ONLINE_FLAG)==ONLINE_FLAG){
int64_t args[2];
args[1] = retval;
if(index==FRAME_NUMBER)
args[0] = FRAME_NUMBER;
else{
args[0] = FRAME_PERIOD;
//if acquisition period is zero, then #frames/buffer depends on exposure time and not acq period
if(!retval)
args[1] = timerValue[ACQUISITION_TIME];
}
if((index==FRAME_NUMBER)||(index==FRAME_PERIOD))
{
if((ret != FAIL) && (t != -1)){
if(setReceiverOnline(ONLINE_FLAG)==ONLINE_FLAG){
int64_t args[2];
args[1] = retval;
if(index==FRAME_NUMBER){
#ifdef VERBOSE
if(index==FRAME_PERIOD)
std::cout << "Sending/Getting acquisition period to/from receiver " << retval << std::endl;
else
std::cout << "Sending/Getting number of frames to/from receiver " << retval << std::endl;
std::cout << "Sending/Getting number of frames to/from receiver " << retval << std::endl;
#endif
if (connectData() == OK)
ret=thisReceiver->sendIntArray(fnum,ut,args);
if((ut != retval)|| (ret==FAIL)){
ret = FAIL;
if(index==FRAME_PERIOD){
cout << "ERROR:Acquisition Period in receiver set incorrectly to " << ut << " instead of " << retval << endl;
setErrorMask((getErrorMask())|(RECEIVER_ACQ_PERIOD_NOT_SET));
}else{
cout << "ERROR:Number of Frames in receiver set incorrectly to " << ut << " instead of " << retval << endl;
setErrorMask((getErrorMask())|(RECEIVER_FRAME_NUM_NOT_SET));
args[0] = FRAME_NUMBER;
}else{
#ifdef VERBOSE
std::cout << "Sending/Getting acquisition period to/from receiver " << retval << std::endl;
#endif
args[0] = FRAME_PERIOD;
//if acquisition period is zero, then #frames/buffer depends on exposure time and not acq period
if(!retval)
args[1] = timerValue[ACQUISITION_TIME];
}
if (connectData() == OK)
ret=thisReceiver->sendIntArray(fnum,ut,args);
if((ut != retval)|| (ret==FAIL)){
ret = FAIL;
if(index==FRAME_PERIOD){
cout << "ERROR:Acquisition Period in receiver set incorrectly to " << ut << " instead of " << retval << endl;
setErrorMask((getErrorMask())|(RECEIVER_ACQ_PERIOD_NOT_SET));
}else{
cout << "ERROR:Number of Frames in receiver set incorrectly to " << ut << " instead of " << retval << endl;
setErrorMask((getErrorMask())|(RECEIVER_FRAME_NUM_NOT_SET));
}
}
if(ret==FORCE_UPDATE)
updateReceiver();
}
}
if(ret==FORCE_UPDATE)
updateReceiver();
}
}
}
return thisDetector->timerValue[index];
};

View File

@ -3975,9 +3975,11 @@ string slsDetectorCommand::cmdReceiver(int narg, char *args[], int action) {
myDet->startReceiver();
else if(!strcasecmp(args[1],"stop")){
myDet->startReceiverReadout();
while(myDet->getReceiverStatus() != RUN_FINISHED)
runStatus s = myDet->getReceiverStatus();
while((s != RUN_FINISHED)&&(s != IDLE))
usleep(50000);
myDet->stopReceiver();
if(s != IDLE)
myDet->stopReceiver();
}
else
return helpReceiver(narg, args, action);