Skip to content

Commit

Permalink
Update to latest graph-prototype and gr-digitizers
Browse files Browse the repository at this point in the history
  • Loading branch information
frankosterfeld committed Jan 18, 2024
1 parent 61e8a09 commit 4d178b4
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 17 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/build_cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,29 @@ jobs:
sudo apt update
sudo apt install -y libx11-dev libgl1-mesa-dev libsdl2-dev
- 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
# Temporary dependency, until we rely on the plugin system to load gr-digitizers blocks at runtime
- name: Install picoscope libraries
run: |
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: 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

0 comments on commit 4d178b4

Please sign in to comment.