From e574c55ca99a3ccd0b4bfc93e8b4d50a3ea48305 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Fri, 10 May 2019 15:05:35 +0200 Subject: [PATCH] Smoother transition when reading a sequence of files From: End of current file, reading the next Labsat file in sequence: /Users/carlesfernandez/Downloads/time/output/output_0000.LS3 Labsat file source is reading samples from /Users/carlesfernandez/Downloads/time/output/output_0001.LS3 Warning To: End of current file, reading the next Labsat file in sequence: /Users/carlesfernandez/Downloads/time/output/output_0001.LS3 Labsat file source is reading samples from /Users/carlesfernandez/Downloads/time/output/output_0001.LS3 --- .../signal_source/gnuradio_blocks/labsat23_source.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc index 894e30cae..ac7df268c 100644 --- a/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc +++ b/src/algorithms/signal_source/gnuradio_blocks/labsat23_source.cc @@ -442,16 +442,17 @@ int labsat23_source::general_work(int noutput_items, } // trigger the read of the next file in the sequence + d_current_file_number++; if (d_labsat_version == 3) { std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl; } - d_current_file_number++; binary_input_file->close(); binary_input_file->open(generate_filename().c_str(), std::ios::in | std::ios::binary); if (binary_input_file->is_open()) { std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl; + return 0; } else { @@ -504,16 +505,17 @@ int labsat23_source::general_work(int noutput_items, } // trigger the read of the next file in the sequence + d_current_file_number++; if (d_labsat_version == 3) { std::cout << "End of current file, reading the next Labsat file in sequence: " << generate_filename() << std::endl; } - d_current_file_number++; binary_input_file->close(); binary_input_file->open(generate_filename().c_str(), std::ios::in | std::ios::binary); if (binary_input_file->is_open()) { std::cout << "Labsat file source is reading samples from " << generate_filename() << std::endl; + return 0; } else {