1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2024-12-15 12:40:35 +00:00

Add a decimator to the Monitor block

This commit is contained in:
Álvaro Cebrián Juan 2018-08-23 13:29:57 +02:00
parent bc8fab36e5
commit 587af5f61c
2 changed files with 13 additions and 10 deletions

View File

@ -61,6 +61,8 @@ gnss_synchro_monitor::gnss_synchro_monitor(unsigned int n_channels,
d_nchannels = n_channels; d_nchannels = n_channels;
udp_sink_ptr = std::unique_ptr<Gnss_Synchro_Udp_Sink>(new Gnss_Synchro_Udp_Sink(udp_addresses, udp_port)); udp_sink_ptr = std::unique_ptr<Gnss_Synchro_Udp_Sink>(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<const Gnss_Synchro**>(&input_items[0]); // Get the input buffer pointer const Gnss_Synchro** in = reinterpret_cast<const Gnss_Synchro**>(&input_items[0]); // Get the input buffer pointer
for (int epoch = 0; epoch < noutput_items; epoch++) for (int epoch = 0; epoch < noutput_items; epoch++)
{ {
// ############ 1. READ PSEUDORANGES #### count++;
for (unsigned int i = 0; i < d_nchannels; i++) if (count >= d_output_rate_ms)
{ {
//if (in[i][epoch].Flag_valid_pseudorange) for (unsigned int i = 0; i < d_nchannels; i++)
// { {
// } std::vector<Gnss_Synchro> stocks;
//todo: send the gnss_synchro objects stocks.push_back(in[i][epoch]);
udp_sink_ptr->write_gnss_synchro(stocks);
std::vector<Gnss_Synchro> stocks; }
stocks.push_back(in[i][epoch]); count = 0;
udp_sink_ptr->write_gnss_synchro(stocks);
} }
} }
return noutput_items; return noutput_items;

View File

@ -65,6 +65,8 @@ private:
std::unique_ptr<Gnss_Synchro_Udp_Sink> udp_sink_ptr; std::unique_ptr<Gnss_Synchro_Udp_Sink> udp_sink_ptr;
unsigned int count;
public: public:
gnss_synchro_monitor(unsigned int nchannels, gnss_synchro_monitor(unsigned int nchannels,