-
Notifications
You must be signed in to change notification settings - Fork 3
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
Refactor Picoscope implementation #147
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
This fixes the build with gcc14. Signed-off-by: Magnus Groß <magnus.gross@kdab.com>
This restricts the possible output types to: - std::int16_t - float - gr::UncertainValue<float> Signed-off-by: Magnus Groß <magnus.gross@kdab.com>
This allows the Block to be extended with support for various Picoscope models. Furthermore, this ports the custom work implementation to processBulk() and implements the inclusion of timing messages received over the message port. Fixes #113 Signed-off-by: Magnus Groß <magnus.gross@kdab.com>
Signed-off-by: Magnus Groß <magnus.gross@kdab.com>
a747b06
to
667fda2
Compare
I have updated to latest graph-prototype, but it looks like there is still an unnecessary copy-constructor that causes the build to fail. diff --git a/core/include/gnuradio-4.0/BlockModel.hpp b/core/include/gnuradio-4.0/BlockModel.hpp
index 44f209d..d0a2aff 100644
--- a/core/include/gnuradio-4.0/BlockModel.hpp
+++ b/core/include/gnuradio-4.0/BlockModel.hpp
@@ -353,7 +353,7 @@ public:
~BlockWrapper() override = default;
- explicit BlockWrapper(property_map initParameter = {}) : _block(std::move(initParameter)) {
+ explicit BlockWrapper(property_map initParameter = {}) : _block{{std::move(initParameter)}} {
initMessagePorts();
_dynamicPortsLoader = std::bind(&BlockWrapper::dynamicPortLoader, this);
} |
The syntax is a bit weird:
because this implies that you create a map in a map... 🤔 |
Not quite, I agree the syntax is a bit confusing, but this is to force list-initialization instead of copy-initialization according to [dcl.init.aggr] section 8.5.1 clause 2:
So the extra I was also a bit confused by this behaviour, but you can test it empirically: Without the patch applied the build fails, because the constructor is ill-formed. With the patch applied, everything works. I hope that explains it. :) |
@RalphSteinhagen I have pushed an alternative commit f615266, that works around this fishy behaviour by redefining the |
This is needed as a workaround for very fishy behaviour, where GNURadio tries to use an ill-formed copy-constructor. Alternatively the BlockWrapper constructor could be patched to use _block{{std::move(initParameter)}}, which forces direct list-initialization. Signed-off-by: Magnus Groß <magnus.gross@kdab.com>
5b520ee
to
f615266
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for the PR!
Overall, the changes look good.
I made a few minor updates and pushed them directly to your branch:
- Changed
sample_rate
tofloat
(which triggered some other modifications). - Replaced custom sink with
TagSink
. - Removed
requestStop
andpublishEOS
in theprocessBulk
function; just returnDONE
. - Updated the
processBulk signature
. - Add support to store UncertainValue samples for TagMonitor and TagSink Add support to store UncertainValue samples for TagMonitor and TagSink gnuradio4#363
The streaming mode is functioning without problems.
However, there are two issues that need further investigation (but not for this PR):
- In
RapidBlock
mode, there's a data race when publishing the EOS tag. - In
RapidBlock
mode, whennCaptures > 1
, the output data is overwritten afterpublish()
. The offset is not taken into account.
The PR can be merged.
Quality Gate failedFailed conditions |
As discussed, this implements all of the following items:
int16_t
,float
andgr::UncertainValue<float>
work()
implementation and port Picoscope to useprocessBulk()
BlockingIO
is now chosen at compile-time, based on whether the acquisition mode is streaming or rapidBlock