gotthard2: timingsource and currentsource features, (timing source external yet to be implemented in fpga to test (#80)

This commit is contained in:
Dhanya Thattil
2020-02-28 12:45:02 +01:00
committed by GitHub
parent 2e2e91b219
commit 11e7737a2f
17 changed files with 334 additions and 3 deletions

View File

@ -217,6 +217,18 @@ inline std::string ToString(const defs::burstMode s) {
}
}
inline std::string ToString(const defs::timingSourceType s) {
switch (s) {
case defs::TIMING_INTERNAL:
return std::string("internal");
case defs::TIMING_EXTERNAL:
return std::string("external");
default:
return std::string("Unknown");
}
}
// in case we already have a string
// causes a copy but might be needed in generic code
inline std::string ToString(const std::string& s) {
@ -574,6 +586,15 @@ inline defs::burstMode StringTo(const std::string& s) {
throw sls::RuntimeError("Unknown burst mode " + s);
}
template <>
inline defs::timingSourceType StringTo(const std::string& s) {
if (s == "internal")
return defs::TIMING_INTERNAL;
if (s == "external")
return defs::TIMING_EXTERNAL;
throw sls::RuntimeError("Unknown timing source type " + s);
}
/** For types with a .str() method use this for conversion */
template <typename T>