Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest graph-prototype #144

Merged
merged 2 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 24 additions & 1 deletion .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,30 @@ jobs:
sudo apt update
sudo apt install -y libx11-dev libgl1-mesa-dev libsdl2-dev

# Temporary dependency, until we rely on the plugin system to load gr-digitizers blocks at runtime
# Temporary dependencies for gr-digitizers (should become runtime dependency)
- name: "Install timing system dependencies: etherbone"
shell: bash
run: |
git clone --branch v2.1.3 --depth=1 https://ohwr.org/project/etherbone-core.git
cd etherbone-core/api
touch ChangeLog # add an empty changelog file which is required by autotools
sed -e "s%AC_MSG_ERROR%AC_MSG_NOTICE%g" -i configure.ac
autoreconf -i
./configure
make -j
sudo make install

- name: "Install timing system dependencies: saftlib"
shell: bash
run: |
sudo apt-get -y install libsigc++-2.0-dev libxslt1-dev libboost-all-dev
git clone --branch v3.0.3 --depth=1 https://github.com/GSI-CS-CO/saftlib.git
cd saftlib
./autogen.sh
./configure
make
sudo make install

- name: Install picoscope libraries
run: |
# https://www.picotech.com/downloads/linux
Expand Down
2 changes: 1 addition & 1 deletion cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ FetchContent_Declare(
FetchContent_Declare(
graph-prototype
GIT_REPOSITORY https://github.com/fair-acc/graph-prototype.git
GIT_TAG 953501708db91ecda21805b6e2dd8af1da50399c
GIT_TAG 7d22e962c7f67fee95fd98c38bdb32ccde78d616
)

FetchContent_Declare(
Expand Down
2 changes: 0 additions & 2 deletions src/service/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ if(OPENDIGITIZER_ENABLE_TESTING)
EXECUTABLE_ARGS
"--output-on-failure"
DEPENDENCIES
qa_BlockScalingOffset
qa_GnuRadioWorker # TODO prevent qa_BlockScalingOffset (gr-digitizers) from being run and remove it here
EXCLUDE
"$CMAKE_BUILD_DIR/*"
Expand All @@ -79,7 +78,6 @@ if(OPENDIGITIZER_ENABLE_TESTING)
EXECUTABLE_ARGS
"--output-on-failure"
DEPENDENCIES
qa_BlockScalingOffset
qa_GnuRadioWorker
EXCLUDE
"$CMAKE_BUILD_DIR/*"
Expand Down
2 changes: 1 addition & 1 deletion src/service/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ include(FetchContent)
FetchContent_Declare(
gr-digitizers
GIT_REPOSITORY https://github.com/fair-acc/gr-digitizers.git
GIT_TAG fe402e92b7e4cfc8ffc745f2349ab26b941fc8b9 # latest dev-prototype as of 2023-11-09
GIT_TAG 68b8bfc2880a4eac9ce978458be63729d9d88c01 # latest dev-prototype as of 2014-01-18
)

FetchContent_MakeAvailable(gr-digitizers)
3 changes: 1 addition & 2 deletions src/service/gnuradio/test/CountSource.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ struct CountSource : public gr::Block<CountSource<T>> {
}
}
if (!_pending_tags.empty() && _pending_tags[0].index == static_cast<gr::Tag::signed_index_type>(_produced)) {
this->output_tags()[0] = { 0, _pending_tags[0].map };
this->publishTag(_pending_tags[0].map, 0);
_pending_tags.pop_front();
this->forwardTags();
}

const auto subspan = std::span(output.begin(), output.end()).first(n);
Expand Down
4 changes: 1 addition & 3 deletions src/service/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,7 @@ struct TestSource : public gr::Block<TestSource<T>> {
}

if (_produced == 0 && n > 0) {
auto &tag = this->output_tags()[0];
tag = { 0, { { std::string(gr::tag::SIGNAL_MIN.key()), -0.3f }, { std::string(gr::tag::SIGNAL_MAX.key()), 0.3f } } };
this->forwardTags();
this->publishTag({ { std::string(gr::tag::SIGNAL_MIN.key()), -0.3f }, { std::string(gr::tag::SIGNAL_MAX.key()), 0.3f } }, 0);
}

const auto edgeLength = static_cast<std::size_t>(sample_rate / 200.f);
Expand Down
2 changes: 1 addition & 1 deletion src/ui/cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ FetchContent_Declare(
FetchContent_Declare(
graph-prototype
GIT_REPOSITORY https://github.com/fair-acc/graph-prototype.git
GIT_TAG 953501708db91ecda21805b6e2dd8af1da50399c
GIT_TAG 7d22e962c7f67fee95fd98c38bdb32ccde78d616
)

FetchContent_MakeAvailable(imgui implot imgui-node-editor yaml-cpp stb opencmw-cpp plf_colony graph-prototype)
Expand Down
14 changes: 5 additions & 9 deletions src/ui/flowgraph/datasource.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,13 @@ struct SineSource : public gr::Block<SineSource<T>> {
thread.join();
}

std::make_signed_t<std::size_t>
available_samples(const SineSource & /*d*/) noexcept {
std::lock_guard lock(mutex);
const auto ret = std::make_signed_t<std::size_t>(samples.size());
return ret > 0 ? ret : -1;
}

T processOne() {
std::lock_guard guard(mutex);

T v = samples.front();
assert(!samples.empty());
if (samples.size() == 1) {
this->requestStop();
}
T v = samples.front();
samples.pop_front();
return v;
}
Expand Down