From 9617da3ad979082406176265a0268c4ee72c8063 Mon Sep 17 00:00:00 2001 From: "J.A. de Jong - ASCEE / Redu-Sone" Date: Thu, 25 May 2023 11:41:16 -0700 Subject: [PATCH] Updated libs. Some comments and tests on cmake with msys2. --- scripts/configure_cmake_msys2.sh | 4 ++-- scripts/install_msys2_builddeps.sh | 2 +- src/lasp/device/lasp_rtaudiodaq.cpp | 4 ++-- src/lasp/device/lasp_streammgr.cpp | 5 ++++- test/CMakeLists.txt | 8 ++++---- test/test_smgr.cpp | 8 ++++---- third_party/DebugTrace-cpp | 2 +- third_party/uldaq | 2 +- 8 files changed, 19 insertions(+), 16 deletions(-) diff --git a/scripts/configure_cmake_msys2.sh b/scripts/configure_cmake_msys2.sh index 4bbc051..9f7c37a 100644 --- a/scripts/configure_cmake_msys2.sh +++ b/scripts/configure_cmake_msys2.sh @@ -1,7 +1,7 @@ #!/bin/bash # -cmake . -G"Ninja" -DLASP_HAS_ULDAQ=OFF -DPython3_ROOT_DIR=C:\Users\User\AppData\Local\Programs\Python\Python310 -arch=urcr64 +cmake . -G"Ninja" -DLASP_HAS_ULDAQ=OFF #-DPython3_ROOT_DIR=C:\\winpython\\python-3.10.9.amd64 +arch=ucrt64 #arch=mingw64 files_to_cpy="libfftw3-3.dll libgcc_s_seh-1.dll libgfortran-5.dll libgomp-1.dll libopenblas.dll libquadmath-0.dll libstdc++-6.dll libwinpthread-1.dll" diff --git a/scripts/install_msys2_builddeps.sh b/scripts/install_msys2_builddeps.sh index 3bea6b7..70bab8b 100644 --- a/scripts/install_msys2_builddeps.sh +++ b/scripts/install_msys2_builddeps.sh @@ -10,7 +10,7 @@ arch=mingw-w64-ucrt-x86_64 pacman -S ${PACMAN_OPTIONS} make -deps="gcc make toolchain ccache cmake openblas pybind11 fftw" +deps="gcc ninja ccache cmake openblas fftw" for dep in $deps; do pacman -S ${PACMAN_OPTIONS} ${arch}-${dep} done diff --git a/src/lasp/device/lasp_rtaudiodaq.cpp b/src/lasp/device/lasp_rtaudiodaq.cpp index 7c0742c..074720d 100644 --- a/src/lasp/device/lasp_rtaudiodaq.cpp +++ b/src/lasp/device/lasp_rtaudiodaq.cpp @@ -244,8 +244,8 @@ public: &myerrorcallback); if (nFramesPerBlock_copy != nFramesPerBlock) { - throw rte("Got different number of frames per block back from RtAudio " - "backend. I do not know what to do."); + throw rte(string("Got different number of frames per block back from RtAudio " + "backend: ") + std::to_string(nFramesPerBlock_copy) + ". I do not know what to do."); } } diff --git a/src/lasp/device/lasp_streammgr.cpp b/src/lasp/device/lasp_streammgr.cpp index 42adf4c..473daea 100644 --- a/src/lasp/device/lasp_streammgr.cpp +++ b/src/lasp/device/lasp_streammgr.cpp @@ -333,10 +333,13 @@ void StreamMgr::startStream(const DaqConfiguration &config) { d fs = daq->samplerate(); /// Create input filters _inputFilters.clear(); - /// No input filter for monitor channel. + + /// No input filter for monitor channel, which comes as the first input channel + /// In the list if (config.monitorOutput && devinfo->hasInternalOutputMonitor) { _inputFilters.push_back(nullptr); } + for (auto &ch : daq->inchannel_config) { if (ch.enabled) { if (ch.digitalHighPassCutOn < 0) { diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index b19ead6..5e0dea3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -1,8 +1,8 @@ -include_directories(SYSTEM - ${PROJECT_SOURCE_DIR}/third_party/armadillo-code/include) -add_executable(test_daq test_daq.cpp) +include_directories(SYSTEM ../third_party/armadillo-code/include) +#add_executable(test_daq test_daq.cpp) add_executable(test_smgr test_smgr.cpp) + include_directories(../src/lasp/device ../src/lasp/dsp ../src/lasp) include_directories(../third_party/gsl-lite/include) -target_link_libraries(test_daq lasp_device_lib lasp_dsp_lib) +#target_link_libraries(test_daq lasp_device_lib lasp_dsp_lib) target_link_libraries(test_smgr lasp_device_lib lasp_dsp_lib) diff --git a/test/test_smgr.cpp b/test/test_smgr.cpp index 9e300c3..fe14b34 100644 --- a/test/test_smgr.cpp +++ b/test/test_smgr.cpp @@ -16,16 +16,16 @@ bool inCallback(const DaqData& d) { int main(int argc, const char **const argv) { StreamMgr& mgr = StreamMgr::getInstance(); - std::vector devs = mgr.getDeviceInfo(); + DeviceInfoList devs = mgr.getDeviceInfo(); DeviceInfo *mon_device = nullptr; for (auto &d : devs) { - - string name_lower = d.device_name; + + string name_lower = d->device_name; transform(name_lower.begin(), name_lower.end(), name_lower.begin(), ::tolower); if (name_lower.find("monitor") != string::npos) { - mon_device = &d; + mon_device = d.get(); } } diff --git a/third_party/DebugTrace-cpp b/third_party/DebugTrace-cpp index 43d5ff1..9b143ea 160000 --- a/third_party/DebugTrace-cpp +++ b/third_party/DebugTrace-cpp @@ -1 +1 @@ -Subproject commit 43d5ff136438b6f3461b529b3231d55be77094e0 +Subproject commit 9b143ea40a34d6268d671ea54cd0ba80396b6363 diff --git a/third_party/uldaq b/third_party/uldaq index 1d84041..6e5940e 160000 --- a/third_party/uldaq +++ b/third_party/uldaq @@ -1 +1 @@ -Subproject commit 1d8404159c0fb6d2665461b80acca5bbef5c610a +Subproject commit 6e5940eae0d44df49ff64fc7dedd49f86db56cd0