diff options
author | Philipp <eltos@outlook.de> | 2023-10-18 13:32:38 +0200 |
---|---|---|
committer | Jeff Long <willcode4@gmail.com> | 2023-11-29 12:17:19 -0500 |
commit | a46e0a793fdea45b3e7277d51678198d51ed4173 (patch) | |
tree | 96ed7e605b29ce989443a6fceef7119ad11bb21e | |
parent | grc: Extend ID blacklist by Python keywords (diff) | |
download | gnuradio-a46e0a793fdea45b3e7277d51678198d51ed4173.tar.xz gnuradio-a46e0a793fdea45b3e7277d51678198d51ed4173.zip |
gr-uhd: RFNoC Rx-Streamer: Add start stream options
Signed-off-by: Philipp Niedermayer <eltos@outlook.de>
(cherry picked from commit 17db2bb59f9564bcda9b4316cd1409e88d2d95ce)
Signed-off-by: Jeff Long <willcode4@gmail.com>
-rw-r--r-- | gr-uhd/grc/uhd_rfnoc_rx_streamer.block.yml | 23 | ||||
-rw-r--r-- | gr-uhd/include/gnuradio/uhd/rfnoc_rx_streamer.h | 6 | ||||
-rw-r--r-- | gr-uhd/lib/rfnoc_rx_streamer_impl.cc | 21 | ||||
-rw-r--r-- | gr-uhd/lib/rfnoc_rx_streamer_impl.h | 4 | ||||
-rw-r--r-- | gr-uhd/python/uhd/bindings/rfnoc_rx_streamer_python.cc | 2 |
5 files changed, 48 insertions, 8 deletions
diff --git a/gr-uhd/grc/uhd_rfnoc_rx_streamer.block.yml b/gr-uhd/grc/uhd_rfnoc_rx_streamer.block.yml index 631da4d8c..b4dcfd2f6 100644 --- a/gr-uhd/grc/uhd_rfnoc_rx_streamer.block.yml +++ b/gr-uhd/grc/uhd_rfnoc_rx_streamer.block.yml @@ -15,7 +15,9 @@ templates: args=${ args }, ), ${ vlen }, - True + ${ issue_stream_cmd }, + ${ start_time_set }, + uhd.time_spec(${start_time}), ) %if use_default_adapter_id == 'False': for port, adapter_id in enumerate(${ adapter_id_list }): @@ -66,6 +68,25 @@ parameters: dtype: int_vector default: [0,] hide: ${ 'all' if use_default_adapter_id else 'none' } +- id: issue_stream_cmd + label: Start stream + dtype: bool + default: 'True' + options: ['True', 'False'] + option_labels: ["Yes", "No"] +- id: start_time_set + label: Start time + dtype: bool + default: 'False' + options: ['True', 'False'] + option_labels: ["Time spec", "Now"] + hide: ${ "part" if issue_stream_cmd else "all" } +- id: start_time + label: "Start time spec [s]" + dtype: float + default: 0 + hide: ${ "part" if issue_stream_cmd and start_time_set else "all" } + asserts: - ${ num_chans > 0 } diff --git a/gr-uhd/include/gnuradio/uhd/rfnoc_rx_streamer.h b/gr-uhd/include/gnuradio/uhd/rfnoc_rx_streamer.h index 3e186d8b7..a001f80a0 100644 --- a/gr-uhd/include/gnuradio/uhd/rfnoc_rx_streamer.h +++ b/gr-uhd/include/gnuradio/uhd/rfnoc_rx_streamer.h @@ -45,12 +45,16 @@ public: * \param vlen Vector length * \param issue_stream_cmd_on_start If true, the streamer sends a stream * command upstream. + * \param start_time_set If true, set start time spec to the stream command + * \param start_time The time spec for the stream command if start_time_set is true */ static sptr make(rfnoc_graph::sptr graph, const size_t num_chans, const ::uhd::stream_args_t& stream_args, const size_t vlen = 1, - const bool issue_stream_cmd_on_start = true); + const bool issue_stream_cmd_on_start = true, + const bool start_time_set = false, + const ::uhd::time_spec_t& start_time = ::uhd::time_spec_t(0.0)); //! Return the unique ID associated with the underlying RFNoC streamer virtual std::string get_unique_id() const = 0; diff --git a/gr-uhd/lib/rfnoc_rx_streamer_impl.cc b/gr-uhd/lib/rfnoc_rx_streamer_impl.cc index 12106660c..0b0f04078 100644 --- a/gr-uhd/lib/rfnoc_rx_streamer_impl.cc +++ b/gr-uhd/lib/rfnoc_rx_streamer_impl.cc @@ -32,10 +32,17 @@ rfnoc_rx_streamer::sptr rfnoc_rx_streamer::make(rfnoc_graph::sptr graph, const size_t num_chans, const ::uhd::stream_args_t& stream_args, const size_t vlen, - const bool issue_stream_cmd_on_start) + const bool issue_stream_cmd_on_start, + const bool start_time_set, + const ::uhd::time_spec_t& start_time) { - return gnuradio::make_block_sptr<rfnoc_rx_streamer_impl>( - graph, num_chans, stream_args, vlen, issue_stream_cmd_on_start); + return gnuradio::make_block_sptr<rfnoc_rx_streamer_impl>(graph, + num_chans, + stream_args, + vlen, + issue_stream_cmd_on_start, + start_time_set, + start_time); } @@ -43,7 +50,9 @@ rfnoc_rx_streamer_impl::rfnoc_rx_streamer_impl(rfnoc_graph::sptr graph, const size_t num_chans, const ::uhd::stream_args_t& stream_args, const size_t vlen, - const bool issue_stream_cmd_on_start) + const bool issue_stream_cmd_on_start, + const bool start_time_set, + const ::uhd::time_spec_t& start_time) : gr::sync_block( "rfnoc_rx_streamer", gr::io_signature::make(0, 0, 0), @@ -58,7 +67,9 @@ rfnoc_rx_streamer_impl::rfnoc_rx_streamer_impl(rfnoc_graph::sptr graph, d_streamer(graph->create_rx_streamer(num_chans, stream_args)), d_unique_id( std::dynamic_pointer_cast<::uhd::rfnoc::node_t>(d_streamer)->get_unique_id()), - d_issue_stream_cmd_on_start(issue_stream_cmd_on_start) + d_issue_stream_cmd_on_start(issue_stream_cmd_on_start), + d_start_time_set(start_time_set), + d_start_time(start_time) { // nop } diff --git a/gr-uhd/lib/rfnoc_rx_streamer_impl.h b/gr-uhd/lib/rfnoc_rx_streamer_impl.h index 0434e88c7..4211ed102 100644 --- a/gr-uhd/lib/rfnoc_rx_streamer_impl.h +++ b/gr-uhd/lib/rfnoc_rx_streamer_impl.h @@ -21,7 +21,9 @@ public: const size_t num_chans, const ::uhd::stream_args_t& stream_args, const size_t vlen, - const bool issue_stream_cmd_on_start); + const bool issue_stream_cmd_on_start, + const bool start_time_set, + const ::uhd::time_spec_t& start_time); ~rfnoc_rx_streamer_impl() override; std::string get_unique_id() const override { return d_unique_id; } diff --git a/gr-uhd/python/uhd/bindings/rfnoc_rx_streamer_python.cc b/gr-uhd/python/uhd/bindings/rfnoc_rx_streamer_python.cc index be4c1fde0..de1f29f6d 100644 --- a/gr-uhd/python/uhd/bindings/rfnoc_rx_streamer_python.cc +++ b/gr-uhd/python/uhd/bindings/rfnoc_rx_streamer_python.cc @@ -46,6 +46,8 @@ void bind_rfnoc_rx_streamer(py::module& m) py::arg("stream_args"), py::arg("vlen") = 1, py::arg("issue_stream_cmd_on_start") = true, + py::arg("start_time_set") = false, + py::arg("start_time") = 0, D(rfnoc_rx_streamer, make)) |