Definition at line 2173 of file biasctrl.cc.
References Error(), Configuration::Get(), Configuration::Has(), BiasMap::Read(), time, BiasMap::Vgapd(), BiasMap::Voffset(), and BiasMap::Vslope().
2178 fBias.SetVerbose(!conf.
Get<
bool>(
"quiet"));
2179 fBias.SetDummyMode(conf.
Get<
bool>(
"dummy-mode"));
2181 if (conf.
Has(
"dev"))
2183 fBias.SetEndpoint(conf.
Get<
string>(
"dev"));
2184 T::Message(
"Setting device to "+
fBias.URL());
2187 const uint16_t step = conf.
Get<uint16_t>(
"ramp-step");
2188 const uint16_t
time = conf.
Get<uint16_t>(
"ramp-delay");
2192 T::Error(
"ramp-step exceeds allowed range.");
2196 fBias.SetRampStep(step);
2197 fBias.SetRampTime(time);
2198 fBias.SetUpdateInterval(conf.
Get<uint32_t>(
"update-interval"));
2199 fBias.SetEmergencyLimit(conf.
Get<uint16_t>(
"emergency-limit"));
2200 fBias.SetSyncDelay(conf.
Get<uint16_t>(
"sync-delay"));
2202 ostringstream str1, str2;
2203 str1 <<
"Ramping in effective steps of " <<
fBias.GetRampStepVolt() <<
"V";
2204 str2 <<
"Ramping with a delay per step of " << time <<
"ms";
2210 const float maxabsv = conf.
Get<
float>(
"volt-max-abs");
2211 const float maxrelv = conf.
Get<
float>(
"volt-max-rel");
2218 T::Warn(
"volt-max exceeds 75V.");
2220 T::Warn(
"volt-max below 70V.");
2227 fBias.SetVoltMaxAbs(maxabsv);
2228 fBias.SetVoltMaxRel(maxrelv);
2230 ostringstream str3, str4;
2231 str3 <<
"Effective maximum allowed absolute voltage: " <<
fBias.GetVoltMaxAbs() <<
"V";
2232 str4 <<
"Effective maximum difference w.r.t to G-APD reference: " <<
fBias.GetVoltMaxRel() <<
"V";
2240 if (!conf.
Has(
"bias-map-file") && !conf.
Has(
"bias-database"))
2242 T::Error(
"Neither bias-map-file not bias-database specified.");
2248 if (conf.
Has(
"bias-map-file"))
2249 map.
Read(conf.
Get<
string>(
"bias-map-file"));
2254 catch (
const runtime_error &e)
2256 T::Error(
"Getting reference voltages failed: "+
string(e.what()));
2262 T::Error(
"Setting reference voltages failed.");
2268 if (conf.
Has(
"dev"))
std::vector< float > Vslope() const
T Get(const std::string &var)
bool Has(const std::string &var)
Warning because the service this data corrsponds to might have been last updated longer ago than Local time
std::vector< float > Voffset() const
std::vector< float > Vgapd() const
bool Read(const std::string &fname)