diff --git a/CMakeLists.txt b/CMakeLists.txt index 71f95561a..bc37d79e6 100755 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -103,11 +103,11 @@ endif() if(SLS_USE_SANITIZER) - target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined -fno-omit-frame-pointer) + # target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined -fno-omit-frame-pointer) #target_compile_options(slsProjectOptions INTERFACE -fsanitize=address,undefined) - target_link_libraries(slsProjectOptions INTERFACE -fsanitize=address,undefined) - # target_compile_options(slsProjectOptions INTERFACE -fsanitize=thread) - # target_link_libraries(slsProjectOptions INTERFACE -fsanitize=thread) + # target_link_libraries(slsProjectOptions INTERFACE -fsanitize=address,undefined) + target_compile_options(slsProjectOptions INTERFACE -fsanitize=thread) + target_link_libraries(slsProjectOptions INTERFACE -fsanitize=thread) endif() #rapidjson diff --git a/python/src/DetectorPythonInterface.h b/python/src/DetectorPythonInterface.h index 58993377d..202fb2680 100755 --- a/python/src/DetectorPythonInterface.h +++ b/python/src/DetectorPythonInterface.h @@ -264,21 +264,21 @@ class DetectorPythonInterface { return det.setPatternWaitTime(level, -1, detPos); } - bool getFlippedDataX(int i) { - return det.getFlippedData(slsDetectorDefs::dimension::X, i); - } + // bool getFlippedDataX(int i) { + // return det.getFlippedData(slsDetectorDefs::dimension::X, i); + // } - bool getFlippedDataY(int i) { - return det.getFlippedData(slsDetectorDefs::dimension::Y, i); - } + // bool getFlippedDataY(int i) { + // return det.getFlippedData(slsDetectorDefs::dimension::Y, i); + // } - void setFlippedDataX(int i, bool value) { - det.setFlippedData(slsDetectorDefs::dimension::X, value, i); - } + // void setFlippedDataX(int i, bool value) { + // det.setFlippedData(slsDetectorDefs::dimension::X, value, i); + // } - void setFlippedDataY(int i, bool value) { - det.setFlippedData(slsDetectorDefs::dimension::Y, value, i); - } + // void setFlippedDataY(int i, bool value) { + // det.setFlippedData(slsDetectorDefs::dimension::Y, value, i); + // } /*** Frame and file settings ***/ void setFileName(std::string fname) { det.setFileName(fname); } @@ -520,13 +520,13 @@ class DetectorPythonInterface { det.setTimer(slsDetectorDefs::timerIndex::FRAME_NUMBER, nframes); } - std::string getTimingMode() { - return det.externalCommunicationType( - det.setExternalCommunicationMode()); - } - void setTimingMode(const std::string mode) { - det.setExternalCommunicationMode(det.externalCommunicationType(mode)); - } + // std::string getTimingMode() { + // return det.externalCommunicationType( + // det.setExternalCommunicationMode()); + // } + // void setTimingMode(const std::string mode) { + // det.setExternalCommunicationMode(det.externalCommunicationType(mode)); + // } void freeSharedMemory() { det.freeSharedMemory(); } diff --git a/python/src/main.cpp b/python/src/main.cpp index bf0ca5d39..0df93d2e2 100755 --- a/python/src/main.cpp +++ b/python/src/main.cpp @@ -183,8 +183,8 @@ PYBIND11_MODULE(_sls_detector, m) { .def("setNumberOfStorageCells", &DetectorPythonInterface::setNumberOfStorageCells) .def("getNumberOfStorageCells", &DetectorPythonInterface::getNumberOfStorageCells) - .def("getTimingMode", &DetectorPythonInterface::getTimingMode) - .def("setTimingMode", &DetectorPythonInterface::setTimingMode) + // .def("getTimingMode", &DetectorPythonInterface::getTimingMode) + // .def("setTimingMode", &DetectorPythonInterface::setTimingMode) .def("getDetectorType", &DetectorPythonInterface::getDetectorType) @@ -282,10 +282,10 @@ PYBIND11_MODULE(_sls_detector, m) { &DetectorPythonInterface::getReceiverCurrentFrameIndex) .def("getGapPixels", &DetectorPythonInterface::getGapPixels) .def("setGapPixels", &DetectorPythonInterface::setGapPixels) - .def("getFlippedDataX", &DetectorPythonInterface::getFlippedDataX) - .def("getFlippedDataY", &DetectorPythonInterface::getFlippedDataY) - .def("setFlippedDataX", &DetectorPythonInterface::setFlippedDataX) - .def("setFlippedDataY", &DetectorPythonInterface::setFlippedDataY) + // .def("getFlippedDataX", &DetectorPythonInterface::getFlippedDataX) + // .def("getFlippedDataY", &DetectorPythonInterface::getFlippedDataY) + // .def("setFlippedDataX", &DetectorPythonInterface::setFlippedDataX) + // .def("setFlippedDataY", &DetectorPythonInterface::setFlippedDataY) .def("getServerLock", &DetectorPythonInterface::getServerLock) .def("setServerLock", &DetectorPythonInterface::setServerLock) diff --git a/slsSupportLib/include/ToString.h b/slsSupportLib/include/ToString.h index 03d601fa3..750e6585a 100644 --- a/slsSupportLib/include/ToString.h +++ b/slsSupportLib/include/ToString.h @@ -19,8 +19,17 @@ namespace sls { -// std::string ToString(const std::vector &vec, -// const char delimiter = ' '); +inline std::string ToString(const std::vector &vec, + const char delimiter = ' ') { + std::ostringstream os; + if(!vec.empty()){ + auto it = vec.begin(); + os << *it++; + while(it != vec.end()) + os << delimiter << *it++; + } + return os.str(); +} /** Convert std::chrono::duration with specified output unit */ template diff --git a/slsSupportLib/tests/test-ToString.cpp b/slsSupportLib/tests/test-ToString.cpp index dfc255d48..b3119b4c5 100644 --- a/slsSupportLib/tests/test-ToString.cpp +++ b/slsSupportLib/tests/test-ToString.cpp @@ -95,4 +95,13 @@ TEST_CASE("Convert types with str method"){ sls::IpAddr addr; REQUIRE(ToString(addr) == "0.0.0.0"); REQUIRE(ToString(sls::IpAddr{}) == "0.0.0.0"); +} + +TEST_CASE("vector of strings"){ + std::vector vec{"5", "s"}; + REQUIRE(ToString(vec) == "5 s"); + + std::vector vec2{"some", "strange", "words", "75"}; + REQUIRE(ToString(vec2) == "some strange words 75"); + } \ No newline at end of file