diff --git a/slsDetectorSoftware/slsDetector/slsDetectorUtils.h b/slsDetectorSoftware/slsDetector/slsDetectorUtils.h index abe88f241..76f6319e9 100644 --- a/slsDetectorSoftware/slsDetector/slsDetectorUtils.h +++ b/slsDetectorSoftware/slsDetector/slsDetectorUtils.h @@ -97,10 +97,15 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing { * @param i sets, -1 gets * @returns receiver streaming out ZMQ port */ - int setReceiverDataStreamingOutPort(int i) { \ - if (i >= 0) { ostringstream ss; ss << i; string s = ss.str(); \ - setNetworkParameter(RECEIVER_STREAMING_PORT, s);} \ - return atoi(getNetworkParameter(RECEIVER_STREAMING_PORT).c_str());}; \ + int setReceiverDataStreamingOutPort(int i) { \ + if (i >= 0) { \ + ostringstream ss; ss << i; string s = ss.str(); \ + int prev_streaming = enableDataStreamingFromReceiver(); \ + setNetworkParameter(RECEIVER_STREAMING_PORT, s); \ + if (prev_streaming) { \ + enableDataStreamingFromReceiver(0); \ + enableDataStreamingFromReceiver(1);}} \ + return atoi(getNetworkParameter(RECEIVER_STREAMING_PORT).c_str());}; \ /** * Set/Get client streaming in ZMQ port @@ -108,10 +113,15 @@ class slsDetectorUtils : public slsDetectorActions, public postProcessing { * @param i sets, -1 gets * @returns client streaming in ZMQ port */ - int setClientDataStreamingInPort(int i){ \ - if (i >= 0) { ostringstream ss; ss << i; string s = ss.str(); \ - setNetworkParameter(CLIENT_STREAMING_PORT, s);} \ - return atoi(getNetworkParameter(CLIENT_STREAMING_PORT).c_str());}; \ + int setClientDataStreamingInPort(int i){ \ + if (i >= 0) { \ + ostringstream ss; ss << i; string s = ss.str(); \ + int prev_streaming = enableDataStreamingToClient()(); \ + setNetworkParameter(CLIENT_STREAMING_PORT, s); \ + if (prev_streaming) { \ + enableDataStreamingToClient(0); \ + enableDataStreamingToClient(1);}} \ + return atoi(getNetworkParameter(CLIENT_STREAMING_PORT).c_str());}; \ // string getFilePath(){return fileIO::getFilePath();};;