3#include "common/dsp/block.h"
4#include "common/dsp/complex.h"
14 class IQSinkBlock :
public Block
17 size_t total_written_raw;
18 size_t total_written_bytes_compressed;
21 int buffer_size = 1024 * 1024;
25 double samplerate = 1e6;
26 double frequency = 100e6;
29 FILE *file_stream =
nullptr;
30 void *buffer_convert =
nullptr;
36 void stop(
bool stop_now =
false);
46 if (key ==
"buffer_size")
48 else if (key ==
"path")
50 else if (key ==
"format")
52 else if (key ==
"autogen")
54 else if (key ==
"samplerate")
56 else if (key ==
"frequency")
58 else if (key ==
"timestamp")
61 throw satdump_exception(key);
66 if (key ==
"buffer_size")
68 else if (key ==
"filepath")
70 else if (key ==
"format")
71 format = v.get<std::string>();
72 else if (key ==
"samplerate")
74 else if (key ==
"autogen")
76 else if (key ==
"frequency")
78 else if (key ==
"timestamp")
81 throw satdump_exception(key);
86 static std::string prepareBasebandFileName(
double timeValue_precise, uint64_t samplerate, uint64_t frequency);
cfg_res_t
set_cfg status.
Definition block.h:227
virtual bool work()=0
The actual looping work function meant to handle all the DSP (well, in most blocks)
Block(std::string id, std::vector< BlockIO > in={}, std::vector< BlockIO > out={})
Generic constructor, to be overloaded.
Definition block.h:206
nlohmann::json get_cfg(std::string key)
Get parameters of the block as JSON.
Definition iq_sink.h:44
cfg_res_t set_cfg(std::string key, nlohmann::json v)
Set parameters of the block from JSON, including potentially IO configurations for blocks that may ha...
Definition iq_sink.h:64
void start()
Starts this block's internal thread and loop.
Definition iq_sink.cpp:20
void stop(bool stop_now=false)
Stops the block, or rather tells the internal loop it should exit & joins the thread to wait....
Definition iq_sink.cpp:46
void init()
Applies current parameters to the block. This is called automatically once in start(),...
Definition iq_sink.h:42