From 75838f77b37e9b59cc255bda6317827307902d71 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Mon, 6 Jan 2020 11:50:08 +0100 Subject: [PATCH] unregistering call back, detangling receiver streaming from callback --- slsDetectorGui/src/qDrawPlot.cpp | 3 +++ slsDetectorSoftware/slsDetectorAnalysis/postProcessing.h | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 6e9a4c848..a121319e2 100644 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -373,6 +373,9 @@ void qDrawPlot::SetupWidgetWindow(){ // callbacks // Setting the callback function to get data from detector class + if (setReceiverOnline() == slsDetectorDefs::ONLINE_FLAG) { + enableDataStreamingFromReceiver(1); + } myDet->registerDataCallback(&(GetDataCallBack),this); // also enables data streaming in client and receiver (if receiver exists) //Setting the callback function to alert when acquisition finished from detector class myDet->registerAcquisitionFinishedCallback(&(GetAcquisitionFinishedCallBack),this); diff --git a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.h b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.h index 7903688dd..43fb2f528 100644 --- a/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.h +++ b/slsDetectorSoftware/slsDetectorAnalysis/postProcessing.h @@ -239,10 +239,7 @@ s void registerDataCallback(int( *userCallback)(detectorData*, int, int, void*), void *pArg) { \ dataReady = userCallback; \ pCallbackArg = pArg; \ - if (setReceiverOnline() == slsDetectorDefs::ONLINE_FLAG) { \ - enableDataStreamingToClient(1); \ - enableDataStreamingFromReceiver(1);}}; \ - + enableDataStreamingToClient(dataReady == NULL ? 0 : 1);}; \ void registerRawDataCallback(int( *userCallback)(double*, int, void*), void *pArg) {rawDataReady = userCallback; pRawDataArg = pArg;};