From 8e773c97dd8b9bfe896438e2520fa25d37c27cef Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 27 Nov 2020 14:19:38 +0100 Subject: [PATCH] pattern load and save works --- .../slsDetectorServer/src/slsDetectorServer_funcs.c | 5 ++--- slsDetectorSoftware/src/Pattern.cpp | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 156fb405c..0d9e7fa42 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -7653,15 +7653,14 @@ int get_pattern(int file_des) { LOG(logDEBUG, ("retval pattern word (printing every 10 words that are not 0\n")); for (int i = 0; i < MAX_PATTERN_LENGTH; ++i) { - int retval = readPatternWord(i); - if (retval == -1) { + pat->word[i] = readPatternWord(i); + if ((int64_t)pat->word[i] == -1) { ret = FAIL; sprintf(mess, "could not read pattern word for address 0x%x\n", i); LOG(logERROR, (mess)); break; } - pat->word[i] = retval; // debug print if ((i % 10 == 0) && pat->word[i] != 0) { LOG(logDEBUG, diff --git a/slsDetectorSoftware/src/Pattern.cpp b/slsDetectorSoftware/src/Pattern.cpp index 46dfe461a..aade2548c 100644 --- a/slsDetectorSoftware/src/Pattern.cpp +++ b/slsDetectorSoftware/src/Pattern.cpp @@ -174,8 +174,8 @@ void Pattern::save(const std::string &fname) { std::ostringstream os; // pattern word for (uint32_t i = pat->limits[0]; i <= pat->limits[1]; ++i) { - output_file << "patword [" << ToStringHex(i, 4) << ", " - << ToStringHex(pat->word[i], 16) << "]" << std::endl; + output_file << "patword " << ToStringHex(i, 4) << " " + << ToStringHex(pat->word[i], 16) << std::endl; } // patioctrl