This commit is contained in:
vladisslav2011 2024-03-10 08:27:10 -06:00 committed by GitHub
commit 5498a67d89
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 8 additions and 3 deletions

View File

@ -55,11 +55,13 @@ gnss_synchro_monitor::gnss_synchro_monitor(int n_channels,
void gnss_synchro_monitor::forecast(int noutput_items __attribute__((unused)), gr_vector_int& ninput_items_required)
{
for (int32_t channel_index = 0; channel_index < d_nchannels; channel_index++)
for (int32_t channel_index = 0; channel_index < d_nchannels - 1; channel_index++)
{
// Set the required number of inputs to 0 so that a lone input on any channel can be pushed to UDP
ninput_items_required[channel_index] = 0;
}
// last input channel is the sample counter, triggered each ms
ninput_items_required[d_nchannels - 1] = 1;
}
@ -70,7 +72,7 @@ int gnss_synchro_monitor::general_work(int noutput_items __attribute__((unused))
const auto** in = reinterpret_cast<const Gnss_Synchro**>(&input_items[0]);
// Loop through each input stream channel
for (int channel_index = 0; channel_index < d_nchannels; channel_index++)
for (int channel_index = 0; channel_index < d_nchannels - 1; channel_index++)
{
// Loop through each item in each input stream channel
int count = 0;
@ -91,6 +93,7 @@ int gnss_synchro_monitor::general_work(int noutput_items __attribute__((unused))
}
}
}
consume(d_nchannels - 1, ninput_items[d_nchannels - 1]);
// Not producing any outputs
return 0;

View File

@ -206,7 +206,8 @@ void GNSSFlowgraph::init()
udp_addr_vec.erase(std::unique(udp_addr_vec.begin(), udp_addr_vec.end()), udp_addr_vec.end());
// Instantiate monitor object
GnssSynchroMonitor_ = gnss_synchro_make_monitor(channels_count_,
// last input channel is the sample counter, triggered each ms
GnssSynchroMonitor_ = gnss_synchro_make_monitor(channels_count_ + 1,
configuration_->property("Monitor.decimation_factor", 1),
configuration_->property("Monitor.udp_port", 1234),
udp_addr_vec, enable_protobuf);
@ -1217,6 +1218,7 @@ int GNSSFlowgraph::connect_gnss_synchro_monitor()
{
top_block_->connect(observables_->get_right_block(), i, GnssSynchroMonitor_, i);
}
top_block_->connect(ch_out_sample_counter_, 0, GnssSynchroMonitor_, channels_count_); // extra port for the sample counter pulse
}
catch (const std::exception& e)
{