From 0ed7d1e9b10aae98116adc2c8e6d3815184606ed Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Wed, 2 Feb 2022 15:27:37 +0100 Subject: [PATCH] receiver suimmary print out more clear when it is deactivated and exception when trying to disable data stream in 10g mode --- .../src/slsDetectorServer_funcs.c | 6 ++++ slsReceiverSoftware/src/Implementation.cpp | 34 +++++++++---------- 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index a72de966d..dcea5b951 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -8312,6 +8312,12 @@ int set_datastream(int file_des) { ret = FAIL; sprintf(mess, "Could not %s. Invalid enable %d. \n", msg, enable); LOG(logERROR, (mess)); + } else if (enableTenGigabitEthernet(GET_FLAG) == 0) { + ret = FAIL; + sprintf(mess, + "Could not %s. Disabling is only enabled in 10g mode.\n", + enable); + LOG(logERROR, (mess)); } else { ret = setDataStream(port, enable); if (ret == FAIL) { diff --git a/slsReceiverSoftware/src/Implementation.cpp b/slsReceiverSoftware/src/Implementation.cpp index 60dbd54d9..6901a8a33 100644 --- a/slsReceiverSoftware/src/Implementation.cpp +++ b/slsReceiverSoftware/src/Implementation.cpp @@ -640,25 +640,25 @@ void Implementation::stopReceiver() { std::to_string(std::abs(mp[i])) + std::string(" (Extra)"); } + std::string summary; + if (!activated) { + summary = "\n\tDeactivated Receiver"; + } else if (!detectorDataStream[i]) { + summary = (i == 0 ? "\n\tDeactivated Left Port" + : "\n\tDeactivated Right Port"); + } else { + std::ostringstream os; + os << "\n\tMissing Packets\t\t: " << mpMessage + << "\n\tComplete Frames\t\t: " << nf + << "\n\tLast Frame Caught\t: " + << listener[i]->GetLastFrameIndexCaught(); + summary = os.str(); + } + TLogLevel lev = ((mp[i]) > 0) ? logINFORED : logINFOGREEN; - LOG(lev) << - // udp port number could be the second if selected interface is - // 2 for jungfrau - "Summary of Port " << udpPortNum[i] - << "\n\tMissing Packets\t\t: " << mpMessage - << "\n\tComplete Frames\t\t: " << nf - << "\n\tLast Frame Caught\t: " - << listener[i]->GetLastFrameIndexCaught(); - } - if (!activated) { - LOG(logINFORED) << "Deactivated Receiver"; - } - if (!detectorDataStream[0]) { - LOG(logINFORED) << "Deactivated Left Port"; - } - if (!detectorDataStream[1]) { - LOG(logINFORED) << "Deactivated Right Port"; + LOG(lev) << "Summary of Port " << udpPortNum[i] << summary; } + // callback if (acquisitionFinishedCallBack) { try {