1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
|
#include "autotrack.h"
#include "logger.h"
void AutoTrackApp::start_device()
{
if (is_started)
return;
set_frequency(frequency_hz);
try
{
current_samplerate = source_ptr->get_samplerate();
if (current_samplerate == 0)
throw satdump_exception("Samplerate not set!");
source_ptr->start();
// if (current_decimation > 1)
// {
// decim_ptr = std::make_shared<dsp::SmartResamplerBlock<complex_t>>(source_ptr->output_stream, 1, current_decimation);
// decim_ptr->start();
// logger->info("Setting up resampler...");
//}
if (d_parameters.contains("fft_enable") && d_parameters["fft_enable"])
{
fft->set_fft_settings(fft_size, get_samplerate(), fft_rate);
// waterfall_plot->set_rate(fft_rate, waterfall_rate);
fft_plot->bandwidth = get_samplerate();
}
splitter->input_stream = /*current_decimation > 1 ? decim_ptr->output_stream :*/ source_ptr->output_stream;
splitter->start();
is_started = true;
}
catch (std::runtime_error &e)
{
logger->error(e.what());
}
}
void AutoTrackApp::stop_device()
{
if (!is_started)
return;
splitter->stop_tmp();
// if (current_decimation > 1)
// decim_ptr->stop();
source_ptr->stop();
is_started = false;
}
|