From 262140728f3bdd840dc895c6b3fadf3724ce4572 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Wed, 24 Apr 2019 13:30:57 +0200 Subject: [PATCH] receiver callback rearranging data for mythen302 --- CMakeLists.txt | 4 +- cmk.sh | 52 +++++++++++++++---------- slsReceiverSoftware/CMakeLists.txt | 17 ++++++-- slsReceiverSoftware/src/slsReceiver.cpp | 5 ++- 4 files changed, 53 insertions(+), 25 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b6eb68c3..fa26e41ce 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -4,6 +4,7 @@ set(PROJECT_VERSION 5.0.0) include(CheckIPOSupported) +cmake_policy(SET CMP0074 OLD) @@ -38,6 +39,7 @@ option (SLS_USE_HDF5 "HDF5 File format" OFF) option (SLS_USE_TEXTCLIENT "Text Client" OFF) option (SLS_USE_RECEIVER "Receiver" OFF) option (SLS_USE_GUI "GUI" OFF) +option (SLS_USE_MYTHEN302_CTB_RECEIVER "Mythen302 CTB Receiver" OFF) option (SLS_USE_TESTS "TESTS" ON) option (SLS_USE_INTEGRATION_TESTS "Integration Tests" ON) option(SLS_USE_SANITIZER "Sanitizers for debugging" OFF) @@ -137,6 +139,7 @@ if (SLS_USE_TEXTCLIENT) add_subdirectory(slsDetectorSoftware) endif (SLS_USE_TEXTCLIENT) + if (SLS_USE_RECEIVER) if (SLS_USE_HDF5) find_package(HDF5 1.10 COMPONENTS CXX REQUIRED) @@ -174,4 +177,3 @@ if(SLS_MASTER_PROJECT) # Generate and install package config file and version include(cmake/package_config.cmake) endif() - diff --git a/cmk.sh b/cmk.sh index 183aef922..e52a92275 100755 --- a/cmk.sh +++ b/cmk.sh @@ -8,6 +8,7 @@ RECEIVER=0 GUI=0 DEBUG=0 PYTHON=0 +SPECIAL_RECEIVER_TYPE=0 CLEAN=0 @@ -16,7 +17,7 @@ CMAKE_PRE="" CMAKE_POST="" usage() { echo -e " -Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [-h] [-d ] [-j] +Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [-h] [-d ] [-j] [-s] -[no option]: only make -c: Clean -b: Builds/Rebuilds CMake files normal mode @@ -28,6 +29,7 @@ Usage: $0 [-c] [-b] [-p] [e] [t] [r] [g] [-h] [-d ] [-j] -g: Build/Rebuilds only gui -j: Number of threads to compile through -e: Debug mode + -s: Special Receiver Type (1-Mythen302) Rebuild when you switch to a new build and compile in parallel: ./cmk.sh -bj5 @@ -63,7 +65,7 @@ For rebuilding only certain sections " ; exit 1; } -while getopts ":bpchd:j:trge" opt ; do +while getopts ":bpchd:j:trges:" opt ; do case $opt in b) echo "Building of CMake files Required" @@ -109,7 +111,11 @@ while getopts ":bpchd:j:trge" opt ; do e) echo "Compiling Options: Debug" DEBUG=1 - ;; + ;; + s) + echo "Special Receiver Type: $OPTARG" + SPECIAL_RECEIVER_TYPE=$OPTARG + ;; \?) echo "Invalid option: -$OPTARG" usage @@ -123,30 +129,36 @@ while getopts ":bpchd:j:trge" opt ; do esac done +#special receiver type +if [ $SPECIAL_RECEIVER_TYPE -eq 1 ]; then + CMAKE_POST+=" -DSLS_USE_MYTHEN302_CTB_RECEIVER=ON " + echo "Enabling Compile Option: Mythen302 CTB Receiver" +fi +#python if [ $PYTHON -eq 1 ]; then - CMAKE_POST+=" -DSLS_USE_PYTHON=ON " - echo "Enabling Compile Option: Python" + CMAKE_POST+=" -DSLS_USE_PYTHON=ON " + echo "Enabling Compile Option: Python" fi if [ $TEXTCLIENT -eq 0 ] && [ $RECEIVER -eq 0 ] && [ $GUI -eq 0 ]; then - #CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON -DSLS_USE_RECEIVER=ON -DSLS_USE_GUI=ON " - CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON -DSLS_USE_RECEIVER=ON -DSLS_USE_GUI=OFF " - echo "Enabling Compile Option: TextClient, Receiver and GUI" + #CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON -DSLS_USE_RECEIVER=ON -DSLS_USE_GUI=ON " + CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON -DSLS_USE_RECEIVER=ON -DSLS_USE_GUI=OFF " + echo "Enabling Compile Option: TextClient, Receiver and GUI" else - if [ $TEXTCLIENT -eq 1 ]; then - CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON " - echo "Enabling Compile Option: TextClient" - fi - if [ $RECEIVER -eq 1 ]; then - CMAKE_POST+=" -DSLS_USE_RECEIVER=ON " - echo "Enabling Compile Option: Receiver" - fi - if [ $GUI -eq 1 ]; then - CMAKE_POST+=" -DSLS_USE_GUI=ON " - echo "Enabling Compile Option: GUI" - fi + if [ $TEXTCLIENT -eq 1 ]; then + CMAKE_POST+=" -DSLS_USE_TEXTCLIENT=ON " + echo "Enabling Compile Option: TextClient" + fi + if [ $RECEIVER -eq 1 ]; then + CMAKE_POST+=" -DSLS_USE_RECEIVER=ON " + echo "Enabling Compile Option: Receiver" + fi + if [ $GUI -eq 1 ]; then + CMAKE_POST+=" -DSLS_USE_GUI=ON " + echo "Enabling Compile Option: GUI" + fi fi diff --git a/slsReceiverSoftware/CMakeLists.txt b/slsReceiverSoftware/CMakeLists.txt index f02689010..b5234358b 100755 --- a/slsReceiverSoftware/CMakeLists.txt +++ b/slsReceiverSoftware/CMakeLists.txt @@ -61,9 +61,20 @@ set_target_properties(slsReceiverShared PROPERTIES PUBLIC_HEADER "${PUBLICHEADERS}" ) -add_executable(slsReceiver - src/main.cpp -) + +if (SLS_USE_MYTHEN302_CTB_RECEIVER) + add_executable(slsReceiver + src/mainCustomized.cpp + ) + add_definitions( + -DMYTHEN302 + ) +else() + add_executable(slsReceiver + src/main.cpp + ) +endif (SLS_USE_MYTHEN302_CTB_RECEIVER) + set_target_properties(slsReceiver PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin ) diff --git a/slsReceiverSoftware/src/slsReceiver.cpp b/slsReceiverSoftware/src/slsReceiver.cpp index ea400b5c2..c35018127 100755 --- a/slsReceiverSoftware/src/slsReceiver.cpp +++ b/slsReceiverSoftware/src/slsReceiver.cpp @@ -44,13 +44,16 @@ slsReceiver::slsReceiver(int argc, char *argv[]): int c = 0; while ( c != -1 ){ - c = getopt_long (argc, argv, "hvf:t:", long_options, &option_index); + c = getopt_long (argc, argv, "hvf:t:o:", long_options, &option_index); // Detect the end of the options. if (c == -1) break; switch(c){ + // reserved for ctb receiver users + case 'o': + break; case 't': sscanf(optarg, "%d", &tcpip_port_no);