24 #include "cheetah/psrdada/Config.h" 25 #include "panda/Error.h" 35 key_t string_to_key(std::string
const& in)
38 std::stringstream converter;
39 converter << std::hex << in;
42 throw panda::Error(
"Wrong input parameter. The dada key has to be a hexadecimal number.");
50 : cheetah::utils::Config(
"psrdada")
52 , _number_of_samples(128)
62 void Config::add_options(OptionsDescriptionEasyInit& add_options)
65 (
"number_of_threads", boost::program_options::value<unsigned>()->default_value(1U)->notifier([&](
unsigned v) { _engine_config = v; }) ,
"the number of threads to run the engine")
66 (
"number_of_samples", boost::program_options::value<int>(&_number_of_samples)->default_value(128),
"the number of time samples in each chunk")
67 (
"dada_key", boost::program_options::value<std::string>()
68 ->default_value(
"dada")
69 ->notifier([&](std::string in)
72 _dada_key = detail::string_to_key(in);
74 }),
"DADA buffer key");
77 key_t Config::dada_key()
const {
return _dada_key; }
79 void Config::dada_key(key_t
const& key){ _dada_key = key; }
81 int Config::number_of_samples()
const {
return _number_of_samples; }
83 void Config::number_of_samples(
int const& samples){ _number_of_samples = samples; }
85 Config::Engine& Config::engine()
const 89 _engine.reset(
new Engine(_engine_config));
94 unsigned Config::number_of_threads()
const 96 return _engine_config.number_of_threads();
98 #endif // ENABLE_PSRDADA Some limits and constants for FLDO.