3#include "common/utils.h"
12 class FileSinkBlock :
public Block
15 std::string p_file =
"/tmp/afile";
18 std::ofstream file_writer;
26 void init() { file_writer = std::ofstream(p_file, std::ios::binary); }
30 nlohmann::ordered_json p;
31 add_param_simple(p,
"file",
"string");
32 p[
"file"][
"disable"] = is_work_running();
41 throw satdump_exception(key);
49 throw satdump_exception(key);
cfg_res_t
set_cfg status.
Definition block.h:241
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:208
void init()
Applies current parameters to the block. This is called automatically once in start(),...
Definition file_sink.h:26
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 file_sink.h:44
nlohmann::ordered_json get_cfg_list()
Get parameters LIST of the block's parameters. This does not contain actual values,...
Definition file_sink.h:28
nlohmann::json get_cfg(std::string key)
Get parameters of the block as JSON.
Definition file_sink.h:36