Skip to content

Commit

Permalink
Move acquisition interface to own lib
Browse files Browse the repository at this point in the history
  • Loading branch information
frankosterfeld committed Oct 22, 2023
1 parent dc166eb commit 6cf5e1e
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 176 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set(BUILD_DIR ${CMAKE_BINARY_DIR}/CMakeExternals/Build)
set(INSTALL_DIR ${CMAKE_BINARY_DIR}/CMakeExternals/Install)


add_subdirectory(src/acquisition)
add_subdirectory(src/ui)

ExternalProject_Add( ui-wasm
Expand Down
8 changes: 4 additions & 4 deletions src/service/acquisition/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
add_library(od_acquisition INTERFACE acqWorker.hpp daq_api.hpp)
target_include_directories(od_acquisition INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/.)
target_link_libraries(od_acquisition INTERFACE majordomo disruptor project_options project_warnings)
add_library(od_acquisition_worker INTERFACE acqWorker.hpp)
target_include_directories(od_acquisition_worker INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/.)
target_link_libraries(od_acquisition_worker INTERFACE od_acquisition majordomo disruptor project_options project_warnings)

add_subdirectory(test)
add_subdirectory(test)
2 changes: 1 addition & 1 deletion src/service/acquisition/acqWorker.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef OPENDIGITIZER_SERVICE_ACQWORKER_H
#define OPENDIGITIZER_SERVICE_ACQWORKER_H

#include "daq_api.hpp"
#include <daq_api.hpp>
#include <majordomo/Worker.hpp>
#include <ranges>
#include <string_view>
Expand Down
81 changes: 0 additions & 81 deletions src/service/acquisition/daq_api.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion src/service/acquisition/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
add_executable(acqWorkerTest acqWorker_test.cpp)
target_include_directories(acqWorkerTest INTERFACE ../include)
target_link_libraries(acqWorkerTest PRIVATE fmt ut od_acquisition client zmq)
target_link_libraries(acqWorkerTest PRIVATE fmt ut od_acquisition_worker client zmq)
7 changes: 3 additions & 4 deletions src/service/gnuradio/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

add_library(od_gnuradio INTERFACE GnuRadioWorker.hpp)
target_include_directories(od_gnuradio INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/.)
target_link_libraries(od_gnuradio INTERFACE majordomo disruptor gr-basic yaml-cpp::yaml-cpp project_options project_warnings)
add_library(od_gnuradio_worker INTERFACE GnuRadioWorker.hpp)
target_include_directories(od_gnuradio_worker INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/.)
target_link_libraries(od_gnuradio_worker INTERFACE od_acquisition majordomo disruptor gr-basic yaml-cpp::yaml-cpp project_options project_warnings)

add_subdirectory(test)
3 changes: 2 additions & 1 deletion src/service/gnuradio/GnuRadioWorker.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
#ifndef OPENDIGITIZER_SERVICE_GNURADIOWORKER_H
#define OPENDIGITIZER_SERVICE_GNURADIOWORKER_H

#include "daq_api.hpp"
#include <daq_api.hpp>

#include <majordomo/Worker.hpp>

#include <gnuradio-4.0/basic/DataSink.hpp>
Expand Down
81 changes: 0 additions & 81 deletions src/service/gnuradio/daq_api.hpp

This file was deleted.

2 changes: 1 addition & 1 deletion src/service/gnuradio/test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmrc_add_resource_library(GNURADIO_WORKER_TEST_ASSETS ALIAS assets::grc NAMESPACE gnuradioWorkerTestFilesystem simple-counter.grc)

add_executable(GnuRadioWorkerTest GnuRadioWorker_test.cpp)
target_link_libraries(GnuRadioWorkerTest PRIVATE fmt ut od_gnuradio client zmq assets::grc)
target_link_libraries(GnuRadioWorkerTest PRIVATE fmt ut od_gnuradio_worker client zmq assets::grc)
9 changes: 7 additions & 2 deletions src/ui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ if (EMSCRIPTEN)
target_link_libraries(
${outputFileName}
PRIVATE
function2::function2
implot
plf_colony
app_header
Expand All @@ -106,6 +107,10 @@ if (EMSCRIPTEN)
COMMENT start a python server serving the webassembly app
DEPENDS ${outputFileName}
)

# TODO should be pulled via linking od_acquisition, but that's outside the source folder (src/ui) for the ui-wasm build
target_include_directories(${target_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../acquisition) #for daq_api.hpp

else () # native build

set(target_name "opendigitizer-ui")
Expand All @@ -118,6 +123,8 @@ else () # native build
target_link_libraries(
${target_name}
PRIVATE
od_acquisition
function2::function2
SDL2
implot
imgui-node-editor
Expand All @@ -134,5 +141,3 @@ else () # native build
target_compile_definitions(${target_name} PRIVATE BLOCKS_DIR="${GNURADIO_PREFIX}/share/gnuradio/grc/blocks/")
endif()

target_link_libraries(${target_name} PRIVATE function2::function2)
target_include_directories(${target_name} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../service/acquisition) #for daq_api.hpp
2 changes: 2 additions & 0 deletions src/ui/flowgraph/remotedatasource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@

#include "../app.h"

using namespace opendigitizer::acq;

namespace DigitizerUi {

class RemoteBlockType : public BlockType {
Expand Down

0 comments on commit 6cf5e1e

Please sign in to comment.