diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c3f4eb..8cc4776 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ set(ENABLE_TESTING OFF) FetchContent_Declare( graph-prototype GIT_REPOSITORY https://github.com/fair-acc/graph-prototype.git - GIT_TAG c9b2dd33dcfaf7ab56dc6b1c42b73f46e7dfc001 # main as of 2024-02-01 + GIT_TAG 8fc3c2d5ac3bd09f7cf07212c2eb4fb15ef46371 # main as of 2024-02-20 ) FetchContent_Declare( diff --git a/blocklib/picoscope/Picoscope.hpp b/blocklib/picoscope/Picoscope.hpp index d79742b..cead451 100644 --- a/blocklib/picoscope/Picoscope.hpp +++ b/blocklib/picoscope/Picoscope.hpp @@ -301,8 +301,7 @@ struct Picoscope : public gr::Block, gr::Supported } if (ps_state.data_finished) { - std::atomic_store_explicit(&this->state, gr::lifecycle::State::STOPPED, std::memory_order_release); - this->state.notify_all(); + this->requestStop(); this->publishTag({ { gr::tag::END_OF_STREAM, true } }, 0); return { 0, 0, DONE }; } @@ -495,14 +494,14 @@ struct Picoscope : public gr::Block, gr::Supported processDriverData(std::size_t nrSamples, std::size_t offset) { std::vector triggerOffsets; - using ChannelOutputRange = decltype(ps_state.channels[0].data_writer.reserve_output_range(1)); + using ChannelOutputRange = decltype(ps_state.channels[0].data_writer.reserve(1)); std::vector channelOutputs; channelOutputs.reserve(ps_state.channels.size()); for (std::size_t channelIdx = 0; channelIdx < ps_state.channels.size(); ++channelIdx) { auto &channel = ps_state.channels[channelIdx]; - channelOutputs.push_back(channel.data_writer.reserve_output_range(nrSamples)); + channelOutputs.push_back(channel.data_writer.reserve(nrSamples)); auto &output = channelOutputs[channelIdx]; const auto driverData = std::span(channel.driver_buffer).subspan(offset, nrSamples); @@ -543,7 +542,7 @@ struct Picoscope : public gr::Block, gr::Supported if (tagsToWrite == 0) { continue; } - auto writeTags = channel.tag_writer.reserve_output_range(tagsToWrite); + auto writeTags = channel.tag_writer.reserve(tagsToWrite); if (writeSignalInfo) { // raw index is index - 1 writeTags[0].index = static_cast(ps_state.produced_worker - 1); @@ -652,7 +651,7 @@ struct Picoscope : public gr::Block, gr::Supported void reportError(Error ec) { - auto out = ps_state.errors.writer.reserve_output_range(1); + auto out = ps_state.errors.writer.reserve(1); out[0] = { ps_state.produced_worker, ec }; out.publish(1); } diff --git a/blocklib/timing/include/timing.hpp b/blocklib/timing/include/timing.hpp index 0897d60..92d9db1 100644 --- a/blocklib/timing/include/timing.hpp +++ b/blocklib/timing/include/timing.hpp @@ -124,14 +124,14 @@ class Timing { static_assert(position + bitsize <= 64); // assert that we only consider existing bits static_assert(std::numeric_limits::max() >= ((1UL << bitsize) - 1)); // make sure the data fits into the return type return static_cast((value >> position) & ((1UL << bitsize) - 1)); - }; + } template static constexpr uint64_t fromField(FieldType value) { static_assert(position + bitsize <= 64); static_assert(std::numeric_limits::max() >= ((1UL << bitsize) - 1)); return ((value & ((1UL << bitsize) - 1)) << position); - }; + } explicit Event(uint64_t timestamp = 0, uint64_t id = 1UL << 60, uint64_t param= 0, uint16_t _flags = 0, uint64_t _executed = 0) : // id