2028 if (conf.
Has(
"zfits.num-threads"))
2030 if (conf.
Has(
"zfits.max-mem"))
2032 if (conf.
Has(
"zfits.num-tiles"))
2034 if (conf.
Has(
"zfits.num-rows"))
2045 const vector<string> types = conf.
Vec<
string>(
"run-type");
2046 if (types.size()==0)
2047 T::Warn(
"No run-types defined.");
2049 T::Message(
"Defining run-types");
2050 for (vector<string>::const_iterator it=types.begin();
2051 it!=types.end(); it++)
2053 T::Message(
" -> "+ *it);
2057 T::Error(
"Run-type "+*it+
" defined twice.");
2061 FAD::Configuration target;
2063 if (!CheckConfigVal<bool>(conf,
true,
"enable-drs.", *it) ||
2064 !CheckConfigVal<bool>(conf,
true,
"enable-dwrite.", *it) ||
2065 !CheckConfigVal<bool>(conf,
true,
"enable-continous-trigger.", *it))
2068 target.fDenable = conf.
GetDef<
bool>(
"enable-drs.", *it);
2069 target.fDwrite = conf.
GetDef<
bool>(
"enable-dwrite.", *it);
2070 target.fContinousTrigger = conf.
GetDef<
bool>(
"enable-continous-trigger.", *it);
2072 target.fTriggerRate = 0;
2075 if (!CheckConfigVal<uint16_t>(conf, 0xffff,
"trigger-rate.", *it))
2078 target.fTriggerRate = conf.
GetDef<uint16_t>(
"trigger-rate.", *it);
2084 str <<
"roi-ch" <<
i <<
'.';
2090 target.fRoi[
i] = conf.HasDef(str.str(), *it) ?
2091 conf.GetDef<uint16_t>(str.str(), *it) :
2092 conf.GetDef<uint16_t>(
"roi.", *it);
2098 str <<
"dac-" << i <<
'.';
2104 target.fDac[
i] = conf.HasDef(str.str(), *it) ?
2105 conf.GetDef<uint16_t>(str.str(), *it) :
2106 conf.GetDef<uint16_t>(
"dac.", *it);
2116 if (conf.Has(
"debug-addr"))
2118 const string addr = conf.Get<
string>(
"debug-addr");
2119 const int num = conf.Get<
unsigned int>(
"debug-num");
2122 if (endpoint==tcp::endpoint())
2125 for (
int i=0; i<num; i++)
2126 AddEndpoint(tcp::endpoint(endpoint.address(), endpoint.port()+8*
i));
2128 if (conf.Get<
bool>(
"start"))
2135 if (conf.Has(
"base-addr"))
2137 string base = conf.Get<
string>(
"base-addr");
2139 if (base==
"def" || base ==
"default")
2140 base =
"10.0.128.128:31919";
2143 if (endpoint==tcp::endpoint())
2146 const ba::ip::address_v4::bytes_type ip = endpoint.address().to_v4().to_bytes();
2148 if (ip[2]>250 || ip[3]>244)
2150 T::Out() <<
kRed <<
"EvalConfiguration - IP address given by --base-addr out-of-range." << endl;
2154 for (
int crate=0; crate<4; crate++)
2155 for (
int board=0; board<10; board++)
2157 ba::ip::address_v4::bytes_type target = endpoint.address().to_v4().to_bytes();
2161 AddEndpoint(tcp::endpoint(ba::ip::address_v4(target), endpoint.port()));
2164 if (conf.Get<
bool>(
"start"))
2172 if (conf.Has(
"addr"))
2174 const vector<string> addrs = conf.Vec<
string>(
"addr");
2175 for (vector<string>::const_iterator i=addrs.begin(); i<addrs.end(); i++)
2178 if (endpoint==tcp::endpoint())
2184 if (conf.Get<
bool>(
"start"))
void SetMaxMemory(unsigned int mb) const
T Get(const std::string &var)
void AddEndpoint(const tcp::endpoint &addr)
static uint32_t DefaultMaxMemory(const uint32_t &_n=0)
std::vector< T > Vec(const std::string &var)
static uint32_t DefaultMaxNumTiles(const uint32_t &_n=0)
static uint32_t DefaultNumThreads(const uint32_t &_n=-2)
static setter for the default number of threads to use. -1 means all available physical cores ...
bool Has(const std::string &var)
T GetDef(const std::string &var, const S &val)
void SetEventTimeout(uint16_t to) const
static uint32_t DefaultNumRowsPerTile(const uint32_t &_n=0)
bool InitRunNumber(const string &path="")
tcp::endpoint GetEndpoint(const string &base)