From 364f4a99b65efe4c4e225354f425034227552b9b Mon Sep 17 00:00:00 2001 From: Frank Osterfeld Date: Tue, 23 Apr 2024 12:00:14 +0200 Subject: [PATCH] Update to graph-prototype API changes --- CMakeLists.txt | 2 +- blocklib/picoscope/Picoscope.hpp | 2 +- blocklib/timing/src/test-timing.cpp | 7 ++++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cd054dc..16adff1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ set(ENABLE_TESTING OFF) FetchContent_Declare( graph-prototype GIT_REPOSITORY https://github.com/fair-acc/graph-prototype.git - GIT_TAG 3cb5c2aff7046bc3760ccd8f8b701cbde361ecfd # main as of 2024-04-05 + GIT_TAG c96c8ec1898a508f0e522ad91e50080c867659bd # main as of 2024-04-23 ) FetchContent_Declare( diff --git a/blocklib/picoscope/Picoscope.hpp b/blocklib/picoscope/Picoscope.hpp index 1fb2557..5473066 100644 --- a/blocklib/picoscope/Picoscope.hpp +++ b/blocklib/picoscope/Picoscope.hpp @@ -296,7 +296,7 @@ struct Picoscope : public gr::Block, gr::Supported if (const auto errors_available = ps_state.errors.reader.available(); errors_available > 0) { auto errors = ps_state.errors.reader.get(errors_available); - std::ignore = ps_state.errors.reader.consume(errors_available); + std::ignore = errors.consume(errors.size()); return { 0, 0, ERROR }; } diff --git a/blocklib/timing/src/test-timing.cpp b/blocklib/timing/src/test-timing.cpp index 6331b22..e89b636 100644 --- a/blocklib/timing/src/test-timing.cpp +++ b/blocklib/timing/src/test-timing.cpp @@ -213,7 +213,8 @@ void drawSnoopedEventTableRow(const Timing::Event &evt, Timing &timing) { void showTimingEventTable(Timing &timing) { static gr::BufferReader auto event_reader = timing.snooped.new_reader(); if (ImGui::Button("clear")) { - std::ignore = event_reader.consume(event_reader.available()); + auto ignored = event_reader.get(); + std::ignore = ignored.consume(ignored.size()); } ImGui::SameLine(); ImGui::Dummy({50,5});ImGui::SameLine(); auto [id_filter, mask] = TimingGroupFilterDropdown(); @@ -262,7 +263,7 @@ void showTimingEventTable(Timing &timing) { drawSnoopedEventTableRow(evt, timing); } if (data.size() > event_reader.buffer().size() / 2) { - std::ignore = event_reader.consume(data.size() - event_reader.buffer().size() / 2); + std::ignore = data.consume(data.size() - event_reader.buffer().size() / 2); } } } @@ -656,7 +657,7 @@ class TimePlot { events.pushBack({eventtime, static_cast(event.eventNo)}); } } - std::ignore = snoopReader.consume(newEvents.size()); // consume processed events + std::ignore = newEvents.consume(newEvents.size()); // consume processed events } void display(Timing &timing) const {