From ffd7cd1070032305dd2697f6fdd38242cf4df79b Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Thu, 21 Nov 2024 16:44:09 +0100 Subject: [PATCH] fix cmake (cannot find VERSION file) when using package as subfolder as cmake_source_dir is not same anymore, add troubleshooting doc for m3 regarding loose control board for waiting status in auto timing mode, fix m3 tests to test register write (previously was read only) (#1048) --- CMakeLists.txt | 4 ++-- docs/src/troubleshooting.rst | 8 +++++++ python/CMakeLists.txt | 2 +- .../tests/Caller/test-Caller.cpp | 24 +++++++++++++++++++ 4 files changed, 35 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9891715fc..c533aa506 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.14) project(slsDetectorPackage) # Read VERSION file into project version -set(VERSION_FILE "${CMAKE_SOURCE_DIR}/VERSION") +set(VERSION_FILE "${CMAKE_CURRENT_LIST_DIR}/VERSION") file(READ "${VERSION_FILE}" VERSION_CONTENT) string(STRIP "${VERSION_CONTENT}" PROJECT_VERSION_STRING) set(PROJECT_VERSION ${PROJECT_VERSION_STRING}) @@ -356,4 +356,4 @@ if(SLS_MASTER_PROJECT) include(cmake/package_config.cmake) endif() -install(FILES ${CMAKE_SOURCE_DIR}/VERSION DESTINATION ${CMAKE_INSTALL_PREFIX}) \ No newline at end of file +install(FILES ${CMAKE_CURRENT_LIST_DIR}/VERSION DESTINATION ${CMAKE_INSTALL_PREFIX}) \ No newline at end of file diff --git a/docs/src/troubleshooting.rst b/docs/src/troubleshooting.rst index 65214846b..041f34b02 100644 --- a/docs/src/troubleshooting.rst +++ b/docs/src/troubleshooting.rst @@ -394,6 +394,14 @@ Missing first frame or next frame after a delay Connect the data link from the Module directly to receiver pc or to a private network. +Mythen3 +-------- + +Detector status is waiting even in auto timing mode +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +Check if the control board or the flat band cable is connected properly. If not, connect them properly and try again. + + Jungfrau --------- diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt index e47777e4b..d36dc23af 100755 --- a/python/CMakeLists.txt +++ b/python/CMakeLists.txt @@ -64,7 +64,7 @@ configure_file( scripts/test_virtual.py ${CMAKE_BINARY_DIR}/test_virtual.py ) -configure_file( ${CMAKE_SOURCE_DIR}/VERSION +configure_file( ${CMAKE_CURRENT_LIST_DIR}/../VERSION ${CMAKE_BINARY_DIR}/bin/slsdet/VERSION ) diff --git a/slsDetectorSoftware/tests/Caller/test-Caller.cpp b/slsDetectorSoftware/tests/Caller/test-Caller.cpp index b9aa56e36..2ef8699f6 100644 --- a/slsDetectorSoftware/tests/Caller/test-Caller.cpp +++ b/slsDetectorSoftware/tests/Caller/test-Caller.cpp @@ -3319,6 +3319,12 @@ TEST_CASE("reg", "[.cmdcall]") { auto det_type = det.getDetectorType().squash(); if (det_type != defs::EIGER) { uint32_t addr = 0x64; + if (det_type == defs::MYTHEN3) { + addr = 0x80; + } + if (det_type == defs::GOTTHARD2) { + addr = 0x20; + } std::string saddr = ToStringHex(addr); auto prev_val = det.readRegister(addr); { @@ -3369,6 +3375,12 @@ TEST_CASE("setbit", "[.cmdcall]") { auto det_type = det.getDetectorType().squash(); if (det_type != defs::EIGER) { uint32_t addr = 0x64; + if (det_type == defs::MYTHEN3) { + addr = 0x80; + } + if (det_type == defs::GOTTHARD2) { + addr = 0x20; + } std::string saddr = ToStringHex(addr); auto prev_val = det.readRegister(addr); { @@ -3393,6 +3405,12 @@ TEST_CASE("clearbit", "[.cmdcall]") { auto det_type = det.getDetectorType().squash(); if (det_type != defs::EIGER) { uint32_t addr = 0x64; + if (det_type == defs::MYTHEN3) { + addr = 0x80; + } + if (det_type == defs::GOTTHARD2) { + addr = 0x20; + } std::string saddr = ToStringHex(addr); auto prev_val = det.readRegister(addr); { @@ -3417,6 +3435,12 @@ TEST_CASE("getbit", "[.cmdcall]") { auto det_type = det.getDetectorType().squash(); if (det_type != defs::EIGER) { uint32_t addr = 0x64; + if (det_type == defs::MYTHEN3) { + addr = 0x80; + } + if (det_type == defs::GOTTHARD2) { + addr = 0x20; + } std::string saddr = ToStringHex(addr); auto prev_val = det.readRegister(addr); {