allowing to read adcs/temp during acquire

This commit is contained in:
Dhanya Maliakal 2017-12-05 14:49:20 +01:00
parent ce1ec97571
commit 7b1f935da2

View File

@ -1550,6 +1550,7 @@ int slsDetector::connectStop() {
return OK; return OK;
else{ else{
std::cout << "cannot connect to stop server" << endl; std::cout << "cannot connect to stop server" << endl;
setErrorMask((getErrorMask())|(CANNOT_CONNECT_TO_DETECTOR));
return FAIL; return FAIL;
} }
} }
@ -2573,22 +2574,23 @@ dacs_t slsDetector::getADC(dacIndex index, int imod){
std::cout<< "Getting ADC "<< index << " of module " << imod << std::endl; std::cout<< "Getting ADC "<< index << " of module " << imod << std::endl;
#endif #endif
if (thisDetector->onlineFlag==ONLINE_FLAG) { if (thisDetector->onlineFlag==ONLINE_FLAG) {
if (connectControl() == OK){ if (connectStop() == OK){
controlSocket->SendDataOnly(&fnum,sizeof(fnum)); stopSocket->SendDataOnly(&fnum,sizeof(fnum));
controlSocket->SendDataOnly(arg,sizeof(arg)); stopSocket->SendDataOnly(arg,sizeof(arg));
controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); stopSocket->ReceiveDataOnly(&ret,sizeof(ret));
if (ret!=FAIL) { if (ret!=FAIL) {
controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); stopSocket->ReceiveDataOnly(&retval,sizeof(retval));
if (adcs) { if (adcs) {
*(adcs+index+imod*thisDetector->nAdcs)=retval; *(adcs+index+imod*thisDetector->nAdcs)=retval;
} }
} else { } else {
controlSocket->ReceiveDataOnly(mess,sizeof(mess)); stopSocket->ReceiveDataOnly(mess,sizeof(mess));
std::cout<< "Detector returned error: " << mess << std::endl; std::cout<< "Detector returned error: " << mess << std::endl;
} }
disconnectControl(); disconnectStop();
/*commented out to allow adc read during acquire, also not required
if (ret==FORCE_UPDATE) if (ret==FORCE_UPDATE)
updateDetector(); updateDetector();*/
} }
} }
#ifdef VERBOSE #ifdef VERBOSE