From 31a0161f42418fca36eedcf5a80649902dc0bc8b Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Tue, 30 Jul 2019 10:53:03 +0200 Subject: [PATCH] gui: fixed pedestal --- slsDetectorGui/src/qDrawPlot.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 329859343..6bcfd34b6 100755 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -679,7 +679,7 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex, uint32_t subFra resetPedestal = false; } - if (isPedestal) { + if (isPedestal && pedestalCount <= NUM_PEDESTAL_FRAMES) { // add pedestals frames if (pedestalCount < NUM_PEDESTAL_FRAMES) { for (unsigned int px = 0; px < nPixels; ++px) @@ -692,6 +692,7 @@ void qDrawPlot::GetData(detectorData *data, uint64_t frameIndex, uint32_t subFra for (unsigned int px = 0; px < nPixels; ++px) tempPedestalVals[px] = tempPedestalVals[px] / (double)NUM_PEDESTAL_FRAMES; memcpy(pedestalVals, tempPedestalVals, nPixels * sizeof(double)); + pedestalCount++; } } @@ -725,7 +726,7 @@ void qDrawPlot::Get1dData(double* rawData) { // pedestal if (isPedestal) { for (unsigned int px = 0; px < nPixelsX; ++px) { - rawData[px] =- (pedestalVals[px]); + rawData[px] -= (pedestalVals[px]); } } // accumulate @@ -757,7 +758,7 @@ void qDrawPlot::Get2dData(double* rawData) { // pedestal if (isPedestal) { for (unsigned int px = 0; px < nPixels; ++px) { - rawData[px] =- (pedestalVals[px]); + rawData[px] -= (pedestalVals[px]); } } // accumulate