-1 in getadc fixed in gui as well

This commit is contained in:
Dhanya Maliakal
2017-12-05 15:37:34 +01:00
parent 7b1f935da2
commit 7aaf95a565
3 changed files with 22 additions and 21 deletions

View File

@ -5245,8 +5245,13 @@ string slsDetectorCommand::cmdADC(int narg, char *args[], int action) {
myDet->setOnline(ONLINE_FLAG);
#ifdef DACS_INT
if (myDet->getDetectorsType() == EIGER || myDet->getDetectorsType() == JUNGFRAU)
sprintf(answer,"%.2f",(double)myDet->getADC(adc)/1000.00);
if (myDet->getDetectorsType() == EIGER || myDet->getDetectorsType() == JUNGFRAU){
int val = myDet->getADC(adc);
if (val == -1)
sprintf(answer,"%d",val);
else
sprintf(answer,"%.2f", (double)val/1000.000);
}
else sprintf(answer,"%d",myDet->getADC(adc));
#else
sprintf(answer,"%f",myDet->getADC(adc));