From 7b1f935da2b3cf3e3eca33067f00fc696d1be6d6 Mon Sep 17 00:00:00 2001 From: Dhanya Maliakal Date: Tue, 5 Dec 2017 14:49:20 +0100 Subject: [PATCH] allowing to read adcs/temp during acquire --- .../slsDetector/slsDetector.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/slsDetectorSoftware/slsDetector/slsDetector.cpp b/slsDetectorSoftware/slsDetector/slsDetector.cpp index bb079a9d7..8c91f7d40 100644 --- a/slsDetectorSoftware/slsDetector/slsDetector.cpp +++ b/slsDetectorSoftware/slsDetector/slsDetector.cpp @@ -1550,6 +1550,7 @@ int slsDetector::connectStop() { return OK; else{ std::cout << "cannot connect to stop server" << endl; + setErrorMask((getErrorMask())|(CANNOT_CONNECT_TO_DETECTOR)); return FAIL; } } @@ -2573,22 +2574,23 @@ dacs_t slsDetector::getADC(dacIndex index, int imod){ std::cout<< "Getting ADC "<< index << " of module " << imod << std::endl; #endif if (thisDetector->onlineFlag==ONLINE_FLAG) { - if (connectControl() == OK){ - controlSocket->SendDataOnly(&fnum,sizeof(fnum)); - controlSocket->SendDataOnly(arg,sizeof(arg)); - controlSocket->ReceiveDataOnly(&ret,sizeof(ret)); + if (connectStop() == OK){ + stopSocket->SendDataOnly(&fnum,sizeof(fnum)); + stopSocket->SendDataOnly(arg,sizeof(arg)); + stopSocket->ReceiveDataOnly(&ret,sizeof(ret)); if (ret!=FAIL) { - controlSocket->ReceiveDataOnly(&retval,sizeof(retval)); + stopSocket->ReceiveDataOnly(&retval,sizeof(retval)); if (adcs) { *(adcs+index+imod*thisDetector->nAdcs)=retval; } } else { - controlSocket->ReceiveDataOnly(mess,sizeof(mess)); + stopSocket->ReceiveDataOnly(mess,sizeof(mess)); 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) - updateDetector(); + updateDetector();*/ } } #ifdef VERBOSE