From dd1dace504f77c93c1f4f622ae36bd909e0e6aed Mon Sep 17 00:00:00 2001 From: Alice Date: Thu, 23 Apr 2026 17:07:54 +0200 Subject: [PATCH] refactored directory structure --- CMakeLists.txt | 9 ++- slsDetectorServers/CMakeLists.txt | 2 +- .../matterhonServer/CMakeLists.txt | 36 ----------- .../matterhornServer/CMakeLists.txt | 62 +++++++++++++++++++ .../include/BaseMatterhornServer.h | 2 +- .../include/MatterhornServer.h | 0 .../include/RegisterDefs.hpp | 0 .../include/RegisterHelperStructs.hpp | 0 .../include/VirtualMatterhornServer.h | 0 .../src/MatterhornApp.cpp | 0 .../src/MatterhornServer.cpp | 0 .../src/VirtualMatterhornServer.cpp | 0 .../CMakeLists.txt | 1 + .../include/CommandLineOptions.h | 1 - .../include/DetectorServer.h | 2 +- .../include/TCPInterface.h | 0 .../src/CommandLineOptions.cpp | 0 .../src/TCPInterface.cpp | 0 18 files changed, 73 insertions(+), 42 deletions(-) delete mode 100644 slsDetectorServers/matterhonServer/CMakeLists.txt create mode 100644 slsDetectorServers/matterhornServer/CMakeLists.txt rename slsDetectorServers/{matterhonServer => matterhornServer}/include/BaseMatterhornServer.h (99%) rename slsDetectorServers/{matterhonServer => matterhornServer}/include/MatterhornServer.h (100%) rename slsDetectorServers/{matterhonServer => matterhornServer}/include/RegisterDefs.hpp (100%) rename slsDetectorServers/{matterhonServer => matterhornServer}/include/RegisterHelperStructs.hpp (100%) rename slsDetectorServers/{matterhonServer => matterhornServer}/include/VirtualMatterhornServer.h (100%) rename slsDetectorServers/{matterhonServer => matterhornServer}/src/MatterhornApp.cpp (100%) rename slsDetectorServers/{matterhonServer => matterhornServer}/src/MatterhornServer.cpp (100%) rename slsDetectorServers/{matterhonServer => matterhornServer}/src/VirtualMatterhornServer.cpp (100%) rename slsDetectorServers/{slsDetectorServer => slsDetectorServer_cpp}/CMakeLists.txt (97%) rename slsDetectorServers/{matterhonServer => slsDetectorServer_cpp}/include/CommandLineOptions.h (98%) rename slsDetectorServers/{slsDetectorServer => slsDetectorServer_cpp}/include/DetectorServer.h (99%) rename slsDetectorServers/{slsDetectorServer => slsDetectorServer_cpp}/include/TCPInterface.h (100%) rename slsDetectorServers/{matterhonServer => slsDetectorServer_cpp}/src/CommandLineOptions.cpp (100%) rename slsDetectorServers/{slsDetectorServer => slsDetectorServer_cpp}/src/TCPInterface.cpp (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3084cf68f..5b3362824 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -245,6 +245,7 @@ option(SLS_TUNE_LOCAL "tune to local machine" OFF) option(SLS_DEVEL_HEADERS "install headers for devel" OFF) option(SLS_USE_MOENCH "compile zmq and post processing for Moench" OFF) option(SLS_USE_JUNGFRAU "compile post processing for Jungfrau" OFF) +option(SLS_USE_MATTERHORN "compile matterhorn server" OFF) #Convenience option to switch off defaults when building Moench binaries only option(SLS_BUILD_ONLY_MOENCH "compile only Moench" OFF) @@ -426,11 +427,11 @@ endif() if (SLS_USE_DETECTOR OR SLS_USE_TEXTCLIENT) add_subdirectory(slsDetectorSoftware) -endif () +endif() # TODO refactor with simulators if (SLS_USE_SERVER) - add_subdirectory(slsDetectorServers/slsDetectorServer) + add_subdirectory(slsDetectorServers/slsDetectorServer_cpp) endif() if (SLS_USE_RECEIVER) @@ -442,6 +443,10 @@ if (SLS_USE_GUI) add_subdirectory(slsDetectorGui) endif (SLS_USE_GUI) +if (SLS_USE_MATTERHORN) + add_subdirectory(slsDetectorServers/matterhornServer) +endif() + if (SLS_USE_SIMULATOR) add_subdirectory(slsDetectorServers) endif (SLS_USE_SIMULATOR) diff --git a/slsDetectorServers/CMakeLists.txt b/slsDetectorServers/CMakeLists.txt index 04c13ece4..3a04f2bf9 100644 --- a/slsDetectorServers/CMakeLists.txt +++ b/slsDetectorServers/CMakeLists.txt @@ -15,5 +15,5 @@ add_subdirectory(jungfrauDetectorServer) add_subdirectory(mythen3DetectorServer) add_subdirectory(gotthard2DetectorServer) add_subdirectory(moenchDetectorServer) -add_subdirectory(matterhonServer) +add_subdirectory(matterhornServer) diff --git a/slsDetectorServers/matterhonServer/CMakeLists.txt b/slsDetectorServers/matterhonServer/CMakeLists.txt deleted file mode 100644 index 280ab64bc..000000000 --- a/slsDetectorServers/matterhonServer/CMakeLists.txt +++ /dev/null @@ -1,36 +0,0 @@ - - -# TODO: should be different executable if not simulators on !! -add_executable(matterhornDetectorServer_virtual - ${CMAKE_CURRENT_SOURCE_DIR}/src/MatterhornApp.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/VirtualMatterhornServer.cpp - #${CMAKE_CURRENT_SOURCE_DIR}/src/MatterhornServer.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/CommandLineOptions.cpp -) - -target_include_directories(matterhornDetectorServer_virtual - PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include - ${CMAKE_CURRENT_SOURCE_DIR}/../../slsSupportLib/include - ${CMAKE_CURRENT_SOURCE_DIR}/../slsDetectorServer/include -) - -target_compile_definitions(matterhornDetectorServer_virtual - PUBLIC VIRTUAL STOP_SERVER #what is this stop server should we really have a generic ServerAPP and pass compile options to create server e.g. MatterHorn? -) - -target_link_libraries(matterhornDetectorServer_virtual - PUBLIC - slsSupportStatic - slsDetectorStatic - slsServerStatic -) - -set_target_properties(matterhornDetectorServer_virtual PROPERTIES - RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin -) - -install(TARGETS matterhornDetectorServer_virtual - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -) - - diff --git a/slsDetectorServers/matterhornServer/CMakeLists.txt b/slsDetectorServers/matterhornServer/CMakeLists.txt new file mode 100644 index 000000000..e4d237e41 --- /dev/null +++ b/slsDetectorServers/matterhornServer/CMakeLists.txt @@ -0,0 +1,62 @@ + + +set(MATTERHORN_SOURCES + ${CMAKE_CURRENT_SOURCE_DIR}/src/MatterhornApp.cpp +) + +if(SLS_USE_SIMULATOR) + list(APPEND MATTERHORN_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/VirtualMatterhornServer.cpp) + + add_executable(matterhornDetectorServer_virtual ${MATTERHORN_SOURCES}) + + target_include_directories(matterhornDetectorServer_virtual + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/../../slsSupportLib/include + ${CMAKE_CURRENT_SOURCE_DIR}/../slsDetectorServer_cpp/include) + + target_link_libraries(matterhornDetectorServer_virtual + PUBLIC + slsSupportStatic + slsServerStatic) + + set_target_properties(matterhornDetectorServer_virtual PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + ) + + install(TARGETS matterhornDetectorServer_virtual + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) +else() + list(APPEND MATTERHORN_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/MatterhornServer.cpp) + + add_executable(matterhornDetectorServer ${MATTERHORN_SOURCES}) + + target_include_directories(matterhornDetectorServer + PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include + ${CMAKE_CURRENT_SOURCE_DIR}/../../slsSupportLib/include + ${CMAKE_CURRENT_SOURCE_DIR}/../slsDetectorServer_cpp/include) + + target_link_libraries(matterhornDetectorServer + PUBLIC + slsSupportStatic + #slsDetectorStatic + slsServerStatic) + + set_target_properties(matterhornDetectorServer PROPERTIES + RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin + ) + + install(TARGETS matterhornDetectorServer + RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} + ) + +endif() + + +#target_compile_definitions(matterhornDetectorServer_virtual +# PUBLIC VIRTUAL STOP_SERVER #what is this stop server should we really have a generic ServerAPP and pass compile options to create server e.g. MatterHorn? +#) + + + + diff --git a/slsDetectorServers/matterhonServer/include/BaseMatterhornServer.h b/slsDetectorServers/matterhornServer/include/BaseMatterhornServer.h similarity index 99% rename from slsDetectorServers/matterhonServer/include/BaseMatterhornServer.h rename to slsDetectorServers/matterhornServer/include/BaseMatterhornServer.h index 1965766b5..4ca5e46cc 100644 --- a/slsDetectorServers/matterhonServer/include/BaseMatterhornServer.h +++ b/slsDetectorServers/matterhornServer/include/BaseMatterhornServer.h @@ -1,7 +1,7 @@ #pragma once #include "DetectorServer.h" #include "TCPInterface.h" -#include "communication_funcs.h" +// #include "communication_funcs.h" #include "fmt/format.h" #include "sls/logger.h" #include "sls/network_utils.h" diff --git a/slsDetectorServers/matterhonServer/include/MatterhornServer.h b/slsDetectorServers/matterhornServer/include/MatterhornServer.h similarity index 100% rename from slsDetectorServers/matterhonServer/include/MatterhornServer.h rename to slsDetectorServers/matterhornServer/include/MatterhornServer.h diff --git a/slsDetectorServers/matterhonServer/include/RegisterDefs.hpp b/slsDetectorServers/matterhornServer/include/RegisterDefs.hpp similarity index 100% rename from slsDetectorServers/matterhonServer/include/RegisterDefs.hpp rename to slsDetectorServers/matterhornServer/include/RegisterDefs.hpp diff --git a/slsDetectorServers/matterhonServer/include/RegisterHelperStructs.hpp b/slsDetectorServers/matterhornServer/include/RegisterHelperStructs.hpp similarity index 100% rename from slsDetectorServers/matterhonServer/include/RegisterHelperStructs.hpp rename to slsDetectorServers/matterhornServer/include/RegisterHelperStructs.hpp diff --git a/slsDetectorServers/matterhonServer/include/VirtualMatterhornServer.h b/slsDetectorServers/matterhornServer/include/VirtualMatterhornServer.h similarity index 100% rename from slsDetectorServers/matterhonServer/include/VirtualMatterhornServer.h rename to slsDetectorServers/matterhornServer/include/VirtualMatterhornServer.h diff --git a/slsDetectorServers/matterhonServer/src/MatterhornApp.cpp b/slsDetectorServers/matterhornServer/src/MatterhornApp.cpp similarity index 100% rename from slsDetectorServers/matterhonServer/src/MatterhornApp.cpp rename to slsDetectorServers/matterhornServer/src/MatterhornApp.cpp diff --git a/slsDetectorServers/matterhonServer/src/MatterhornServer.cpp b/slsDetectorServers/matterhornServer/src/MatterhornServer.cpp similarity index 100% rename from slsDetectorServers/matterhonServer/src/MatterhornServer.cpp rename to slsDetectorServers/matterhornServer/src/MatterhornServer.cpp diff --git a/slsDetectorServers/matterhonServer/src/VirtualMatterhornServer.cpp b/slsDetectorServers/matterhornServer/src/VirtualMatterhornServer.cpp similarity index 100% rename from slsDetectorServers/matterhonServer/src/VirtualMatterhornServer.cpp rename to slsDetectorServers/matterhornServer/src/VirtualMatterhornServer.cpp diff --git a/slsDetectorServers/slsDetectorServer/CMakeLists.txt b/slsDetectorServers/slsDetectorServer_cpp/CMakeLists.txt similarity index 97% rename from slsDetectorServers/slsDetectorServer/CMakeLists.txt rename to slsDetectorServers/slsDetectorServer_cpp/CMakeLists.txt index ff0e9ff72..9060b99f2 100644 --- a/slsDetectorServers/slsDetectorServer/CMakeLists.txt +++ b/slsDetectorServers/slsDetectorServer_cpp/CMakeLists.txt @@ -1,5 +1,6 @@ set(SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/TCPInterface.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/CommandLineOptions.cpp ) add_library(slsServerObject OBJECT diff --git a/slsDetectorServers/matterhonServer/include/CommandLineOptions.h b/slsDetectorServers/slsDetectorServer_cpp/include/CommandLineOptions.h similarity index 98% rename from slsDetectorServers/matterhonServer/include/CommandLineOptions.h rename to slsDetectorServers/slsDetectorServer_cpp/include/CommandLineOptions.h index 01d8eb05d..7ec69b175 100644 --- a/slsDetectorServers/matterhonServer/include/CommandLineOptions.h +++ b/slsDetectorServers/slsDetectorServer_cpp/include/CommandLineOptions.h @@ -1,4 +1,3 @@ -#include "MatterhornServer.h" #include "sls/sls_detector_defs.h" #include #include diff --git a/slsDetectorServers/slsDetectorServer/include/DetectorServer.h b/slsDetectorServers/slsDetectorServer_cpp/include/DetectorServer.h similarity index 99% rename from slsDetectorServers/slsDetectorServer/include/DetectorServer.h rename to slsDetectorServers/slsDetectorServer_cpp/include/DetectorServer.h index 644381679..7f1a6eb89 100644 --- a/slsDetectorServers/slsDetectorServer/include/DetectorServer.h +++ b/slsDetectorServers/slsDetectorServer_cpp/include/DetectorServer.h @@ -1,6 +1,6 @@ #pragma once #include "TCPInterface.h" -#include "communication_funcs.h" +// #include "communication_funcs.h" #include "sls/logger.h" #include "sls/network_utils.h" #include "sls/sls_detector_defs.h" diff --git a/slsDetectorServers/slsDetectorServer/include/TCPInterface.h b/slsDetectorServers/slsDetectorServer_cpp/include/TCPInterface.h similarity index 100% rename from slsDetectorServers/slsDetectorServer/include/TCPInterface.h rename to slsDetectorServers/slsDetectorServer_cpp/include/TCPInterface.h diff --git a/slsDetectorServers/matterhonServer/src/CommandLineOptions.cpp b/slsDetectorServers/slsDetectorServer_cpp/src/CommandLineOptions.cpp similarity index 100% rename from slsDetectorServers/matterhonServer/src/CommandLineOptions.cpp rename to slsDetectorServers/slsDetectorServer_cpp/src/CommandLineOptions.cpp diff --git a/slsDetectorServers/slsDetectorServer/src/TCPInterface.cpp b/slsDetectorServers/slsDetectorServer_cpp/src/TCPInterface.cpp similarity index 100% rename from slsDetectorServers/slsDetectorServer/src/TCPInterface.cpp rename to slsDetectorServers/slsDetectorServer_cpp/src/TCPInterface.cpp