From b9fcbf4697d4f3f3136e0b6f9eb200e04f80ef06 Mon Sep 17 00:00:00 2001 From: l_maliakal_d Date: Wed, 9 Oct 2013 10:37:49 +0000 Subject: [PATCH] changed order to pedestal binary then accumulate, also fxed a bug in that git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@243 af1100a4-978c-4157-bff7-07162d2ba061 --- slsDetectorGui/src/qDrawPlot.cpp | 36 ++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 16 deletions(-) diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 1b571e1b3..c08f1cc65 100644 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -991,19 +991,21 @@ int qDrawPlot::GetData(detectorData *data,int fIndex){ } //pedestal or accumulate else{ + double temp;//cannot overwrite cuz of accumulate for(unsigned int px=0;px<(nPixelsX*nPixelsY);px++){ - if(accumulate) - histYAxis[0][px] += data->values[px]; - else - histYAxis[0][px] = data->values[px]; + temp = data->values[px]; if(pedestal) - histYAxis[0][px] = histYAxis[0][px] - (pedestalVals[px]); + temp = data->values[px] - (pedestalVals[px]); if(binary) { - if ((histYAxis[0][px] >= binaryFrom) && (histYAxis[0][px] <= binaryTo)) - histYAxis[0][px] = 1; + if ((temp >= binaryFrom) && (temp <= binaryTo)) + temp = 1; else - histYAxis[0][px] = 0; + temp = 0; } + if(accumulate) + temp += histYAxis[0][px]; + //after all processing + histYAxis[0][px] = temp; } } } @@ -1038,19 +1040,21 @@ int qDrawPlot::GetData(detectorData *data,int fIndex){ } //pedestal or accumulate or binary else{ + double temp; for(unsigned int px=0;px<(nPixelsX*nPixelsY);px++){ - if(accumulate) - lastImageArray[px] += data->values[px]; - else - lastImageArray[px] = data->values[px]; + temp = data->values[px]; if(pedestal) - lastImageArray[px] = lastImageArray[px] - (pedestalVals[px]); + temp = data->values[px] - (pedestalVals[px]); if(binary) { - if ((lastImageArray[px] >= binaryFrom) && (lastImageArray[px] <= binaryTo)) - lastImageArray[px] = 1; + if ((temp >= binaryFrom) && (temp <= binaryTo)) + temp = 1; else - lastImageArray[px] = 0; + temp = 0; } + if(accumulate) + temp += lastImageArray[px]; + //after all processing + lastImageArray[px] = temp; } }