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
This commit is contained in:
maliakal_d 2025-01-13 16:46:01 +01:00 committed by GitHub
parent ed6686d4a7
commit 0771461c01
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 6 deletions

View File

@ -1749,7 +1749,8 @@ class Detector {
Result<std::vector<int>> getRxDbitList(Positions pos = {}) const; Result<std::vector<int>> getRxDbitList(Positions pos = {}) const;
/** [CTB] list contains the set of digital signal bits (0-63) to save, must /** [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<int> &list, Positions pos = {}); void setRxDbitList(const std::vector<int> &list, Positions pos = {});
/** [CTB] */ /** [CTB] */

View File

@ -1020,10 +1020,16 @@ std::string Caller::slowadc(int action) {
std::string Caller::rx_dbitlist(int action) { std::string Caller::rx_dbitlist(int action) {
std::ostringstream os; std::ostringstream os;
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[all] or [i0] [i1] [i2]... \n\t[Ctb] List of digital signal " os << "[all] or [none] or [i0] [i1] [i2]... \n\t[Ctb] List of digital "
"bits read out. If all is used instead of a list, all digital " "signal bits enabled and rearranged according to the signals "
"bits (64) enabled. Each element in list can be 0 - 63 and must " "(all samples of each signal is put together). If 'all' is used "
"be non repetitive." "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'; << '\n';
} else if (action == defs::GET_ACTION) { } else if (action == defs::GET_ACTION) {
if (!args.empty()) { if (!args.empty()) {
@ -1041,7 +1047,9 @@ std::string Caller::rx_dbitlist(int action) {
for (unsigned int i = 0; i < 64; ++i) { for (unsigned int i = 0; i < 64; ++i) {
t[i] = 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(); unsigned int ntrim = args.size();
t.resize(ntrim); t.resize(ntrim);
for (unsigned int i = 0; i < ntrim; ++i) { for (unsigned int i = 0; i < ntrim; ++i) {