From 587af5f61c38de305518cc24987f6a50b9cbc8be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Cebri=C3=A1n=20Juan?= Date: Thu, 23 Aug 2018 13:29:57 +0200 Subject: [PATCH 1/3] Add a decimator to the Monitor block --- src/core/monitor/gnss_synchro_monitor.cc | 21 +++++++++++---------- src/core/monitor/gnss_synchro_monitor.h | 2 ++ 2 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/core/monitor/gnss_synchro_monitor.cc b/src/core/monitor/gnss_synchro_monitor.cc index bde09ef69..dada85d4a 100644 --- a/src/core/monitor/gnss_synchro_monitor.cc +++ b/src/core/monitor/gnss_synchro_monitor.cc @@ -61,6 +61,8 @@ gnss_synchro_monitor::gnss_synchro_monitor(unsigned int n_channels, d_nchannels = n_channels; udp_sink_ptr = std::unique_ptr(new Gnss_Synchro_Udp_Sink(udp_addresses, udp_port)); + + count = 0; } @@ -75,17 +77,16 @@ int gnss_synchro_monitor::work(int noutput_items, gr_vector_const_void_star& inp const Gnss_Synchro** in = reinterpret_cast(&input_items[0]); // Get the input buffer pointer for (int epoch = 0; epoch < noutput_items; epoch++) { - // ############ 1. READ PSEUDORANGES #### - for (unsigned int i = 0; i < d_nchannels; i++) + count++; + if (count >= d_output_rate_ms) { - //if (in[i][epoch].Flag_valid_pseudorange) - // { - // } - //todo: send the gnss_synchro objects - - std::vector stocks; - stocks.push_back(in[i][epoch]); - udp_sink_ptr->write_gnss_synchro(stocks); + for (unsigned int i = 0; i < d_nchannels; i++) + { + std::vector stocks; + stocks.push_back(in[i][epoch]); + udp_sink_ptr->write_gnss_synchro(stocks); + } + count = 0; } } return noutput_items; diff --git a/src/core/monitor/gnss_synchro_monitor.h b/src/core/monitor/gnss_synchro_monitor.h index 36b6f1e3a..051c262cc 100644 --- a/src/core/monitor/gnss_synchro_monitor.h +++ b/src/core/monitor/gnss_synchro_monitor.h @@ -65,6 +65,8 @@ private: std::unique_ptr udp_sink_ptr; + unsigned int count; + public: gnss_synchro_monitor(unsigned int nchannels, From cafb3b0363840210910dfbf8e91be5ace1e6f711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Cebri=C3=A1n=20Juan?= Date: Thu, 23 Aug 2018 13:44:51 +0200 Subject: [PATCH 2/3] Fix Monitor block file header --- src/core/monitor/gnss_synchro_monitor.cc | 5 ++++- src/core/monitor/gnss_synchro_monitor.h | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/core/monitor/gnss_synchro_monitor.cc b/src/core/monitor/gnss_synchro_monitor.cc index dada85d4a..d788b52b0 100644 --- a/src/core/monitor/gnss_synchro_monitor.cc +++ b/src/core/monitor/gnss_synchro_monitor.cc @@ -1,6 +1,9 @@ /*! * \file gnss_synchro_monitor.cc - * \brief Interface of a Position Velocity and Time computation block + * \brief Implementation of a receiver monitoring block which allows sending + * a data stream with the receiver internal parameters (Gnss_Synchro objects) + * to local or remote clients over UDP. + * * \author Álvaro Cebrián Juan, 2018. acebrianjuan(at)gmail.com * * ------------------------------------------------------------------------- diff --git a/src/core/monitor/gnss_synchro_monitor.h b/src/core/monitor/gnss_synchro_monitor.h index 051c262cc..deaab7e2a 100644 --- a/src/core/monitor/gnss_synchro_monitor.h +++ b/src/core/monitor/gnss_synchro_monitor.h @@ -1,6 +1,9 @@ /*! * \file gnss_synchro_monitor.h - * \brief Interface of a Position Velocity and Time computation block + * \brief Interface of a receiver monitoring block which allows sending + * a data stream with the receiver internal parameters (Gnss_Synchro objects) + * to local or remote clients over UDP. + * * \author Álvaro Cebrián Juan, 2018. acebrianjuan(at)gmail.com * * ------------------------------------------------------------------------- From 3c3057ba0b8ccec33f24571fb98adab972aa4c07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Cebri=C3=A1n=20Juan?= Date: Thu, 23 Aug 2018 14:47:24 +0200 Subject: [PATCH 3/3] Fix warning --- src/core/monitor/gnss_synchro_monitor.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/monitor/gnss_synchro_monitor.h b/src/core/monitor/gnss_synchro_monitor.h index deaab7e2a..9547bf12d 100644 --- a/src/core/monitor/gnss_synchro_monitor.h +++ b/src/core/monitor/gnss_synchro_monitor.h @@ -68,7 +68,7 @@ private: std::unique_ptr udp_sink_ptr; - unsigned int count; + int count; public: