From f1b31100db8e5abb2fb50d3b034f24c38e49c1cc Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 3 Sep 2021 17:34:28 +0200 Subject: [PATCH] wip --- .../slsDetectorServer/src/slsDetectorServer_funcs.c | 8 -------- slsDetectorSoftware/src/DetectorImpl.cpp | 10 +++++++--- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 11af81222..f03319a5c 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -3725,14 +3725,6 @@ int program_fpga(int file_des) { LOG(logDEBUG1, ("Program size is: %lld\n", (long long unsigned int)filesize)); - // checksum - uint16_t checksum = 0; - if (receiveData(file_des, &checksum, sizeof(filesize), INT32) < 0) - return printSocketReadError(); - LOG(logINFOBLUE, - ("checksum: %d\n", checksum)); - - // open file and allocate memory for part program FILE *fd = NULL; ret = startCopyingFPGAProgram(&fd, filesize, mess); diff --git a/slsDetectorSoftware/src/DetectorImpl.cpp b/slsDetectorSoftware/src/DetectorImpl.cpp index 7fa266ff4..5e0dd9b1d 100644 --- a/slsDetectorSoftware/src/DetectorImpl.cpp +++ b/slsDetectorSoftware/src/DetectorImpl.cpp @@ -1323,11 +1323,15 @@ std::vector DetectorImpl::readProgrammingFile(const std::string &fname, } } // Swap bits from source and write to dest + int oldProgress = 0; while (!feof(src)) { // print progress - printf("%d%%\r", (int)(((double)(dstFilePos) / srcSize) * 100)); - fflush(stdout); - + int progress = (int)(((double)(dstFilePos) / srcSize) * 100); + if (oldProgress != progress) { + printf("%d%%\r", ); + fflush(stdout); + oldProgress = progress; + } // pof: exit early to discard footer if (isPof && dstFilePos >= pofFooterOfst) { break;