/* -*- c++ -*- */ /* * Copyright 2018 <+YOU OR YOUR COMPANY+>. * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3, or (at your option) * any later version. * * This software is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this software; see the file COPYING. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, * Boston, MA 02110-1301, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include #include "trigger_pipe_samples_impl.h" namespace gr { namespace prediction_cpp { trigger_pipe_samples::sptr trigger_pipe_samples::make(int num_pipe) { return gnuradio::get_initial_sptr (new trigger_pipe_samples_impl(num_pipe)); } /* * The private constructor */ trigger_pipe_samples_impl::trigger_pipe_samples_impl(int num_pipe) : gr::block("trigger_pipe_samples", gr::io_signature::make2(2, 2, sizeof(float), sizeof(gr_complex)), gr::io_signature::make2(2, 2, sizeof(float), sizeof(gr_complex))), d_num_pipe(num_pipe) {} /* * Our virtual destructor. */ trigger_pipe_samples_impl::~trigger_pipe_samples_impl() { } void trigger_pipe_samples_impl::forecast (int noutput_items, gr_vector_int &ninput_items_required) { unsigned ninputs = ninput_items_required.size (); for(unsigned i = 0; i < ninputs; i++) ninput_items_required[i] = noutput_items; } int trigger_pipe_samples_impl::general_work (int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) { const float *in_trigger = (const float *) input_items[0]; const gr_complex *in_sig = (const gr_complex*) input_items[1]; float *out_trigger = (float *) output_items[0]; gr_complex *out_sig = (gr_complex *) output_items[1]; // Do <+signal processing+> int i = 0; int out_pos = 0; while(i