From fd03e903c4cac0c778b72628d307015978d07722 Mon Sep 17 00:00:00 2001 From: "Timur A. Fatkhullin" Date: Fri, 13 Dec 2024 12:09:56 +0300 Subject: [PATCH] remove logging flood --- CMakeLists.txt | 5 +++++ raptor_eagle_ccd.cpp | 19 +++++++++---------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index dc218cb..83dac03 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -56,3 +56,8 @@ install(TARGETS ${RAPTOR_EAGLEV_LIB} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) +# install(TARGETS ${RAPTOR_EAGLEV_LIB} ${RAPTOR_EAGLEV_SERVER} +# LIBRARY DESTINATION "/home/obs/TMP" +# ARCHIVE DESTINATION "/home/obs/TMP" +# RUNTIME DESTINATION "/home/obs/TMP" +# ) diff --git a/raptor_eagle_ccd.cpp b/raptor_eagle_ccd.cpp index 3c2faf8..1c6c5d5 100644 --- a/raptor_eagle_ccd.cpp +++ b/raptor_eagle_ccd.cpp @@ -388,22 +388,21 @@ size_t RaptorEagleCCD::clRead(byte_seq_t& bytes) auto start_tp = std::chrono::steady_clock::now(); - // // how many byte are available - // xclibApiCall(nbytes = pxd_serialRead(_cameraUnitmap, 0, nullptr, 0), - // std::format("pxd_serialRead({}, 0, NULL, 0)", _cameraUnitmap)); + // how many byte are available + xclibApiCall(nbytes = pxd_serialRead(_cameraUnitmap, 0, nullptr, 0), + std::format("pxd_serialRead({}, 0, NULL, 0)", _cameraUnitmap)); + + logWarn("There are no bytes in Rx-buffer! Waiting for {} as timeout ...", CL_DEFAULT_TIMEOUT); // if (!nbytes) { // logWarn("There are no bytes in Rx-buffer! Nothing to do!"); // return 0; // } - do { - // how many byte are available - xclibApiCall(nbytes = pxd_serialRead(_cameraUnitmap, 0, nullptr, 0), - std::format("pxd_serialRead({}, 0, NULL, 0)", _cameraUnitmap)); - logWarn("There are no bytes in Rx-buffer! Waiting for ..."); - std::this_thread::sleep_for(std::chrono::milliseconds(1)); - } while ((std::chrono::steady_clock::now() - start_tp) <= CL_DEFAULT_TIMEOUT); + while ((std::chrono::steady_clock::now() - start_tp) <= CL_DEFAULT_TIMEOUT) { + std::this_thread::sleep_for(std::chrono::milliseconds(5)); + nbytes = pxd_serialRead(_cameraUnitmap, 0, nullptr, 0); + } if (!nbytes) { logWarn("Cameralink reading operation timeout!");