From 0771461c01293bd580a3b6aaa8ba4656e7d3ca02 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Mon, 13 Jan 2025 16:46:01 +0100 Subject: [PATCH] CLI: added empty dbit list option 'none' (#1069) * cli: added 'none' to the rx_dbitlist command to be able to set the dbit list to an empty list --- slsDetectorSoftware/include/sls/Detector.h | 3 ++- slsDetectorSoftware/src/CallerSpecial.cpp | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index 04abc8dba..565967345 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -1749,7 +1749,8 @@ class Detector { Result> getRxDbitList(Positions pos = {}) const; /** [CTB] list contains the set of digital signal bits (0-63) to save, must - * be non repetitive */ + * be non repetitive. Note: data will be rearranged according to signal bits + */ void setRxDbitList(const std::vector &list, Positions pos = {}); /** [CTB] */ diff --git a/slsDetectorSoftware/src/CallerSpecial.cpp b/slsDetectorSoftware/src/CallerSpecial.cpp index fc0a2bfa3..341980859 100644 --- a/slsDetectorSoftware/src/CallerSpecial.cpp +++ b/slsDetectorSoftware/src/CallerSpecial.cpp @@ -1020,10 +1020,16 @@ std::string Caller::slowadc(int action) { std::string Caller::rx_dbitlist(int action) { std::ostringstream os; if (action == defs::HELP_ACTION) { - os << "[all] or [i0] [i1] [i2]... \n\t[Ctb] List of digital signal " - "bits read out. If all is used instead of a list, all digital " - "bits (64) enabled. Each element in list can be 0 - 63 and must " - "be non repetitive." + os << "[all] or [none] or [i0] [i1] [i2]... \n\t[Ctb] List of digital " + "signal bits enabled and rearranged according to the signals " + "(all samples of each signal is put together). If 'all' is used " + "instead of a list, all digital bits (64) enabled. Each element " + "in list can be 0 - 63 and must be non repetitive. The option " + "'none' will still spit out all data as is from the detector, " + "but without rearranging it. Please note that when using the " + "receiver list, the data size will be bigger if the number of " + "samples is not divisible by 8 as every signal bit is padded to " + "the next byte when combining all the samples in the receiver." << '\n'; } else if (action == defs::GET_ACTION) { if (!args.empty()) { @@ -1041,7 +1047,9 @@ std::string Caller::rx_dbitlist(int action) { for (unsigned int i = 0; i < 64; ++i) { t[i] = i; } - } else { + } + // 'none' option already covered as t is empty by default + else if (args[0] != "none") { unsigned int ntrim = args.size(); t.resize(ntrim); for (unsigned int i = 0; i < ntrim; ++i) {