gotthard2: first edit

This commit is contained in:
2020-01-20 12:13:23 +01:00
parent 6e47f0b7f7
commit 6cfd0f8962
17 changed files with 322 additions and 53 deletions

View File

@ -204,6 +204,17 @@ inline std::string ToString(const defs::detectorModeType s) {
}
}
inline std::string ToString(const defs::burstModeType s) {
switch (s) {
case defs::INTERNAL:
return std::string("internal");
case defs::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) {
@ -550,6 +561,16 @@ inline defs::dacIndex StringTo(const std::string& s) {
throw sls::RuntimeError("Unknown dac Index " + s);
}
template <>
inline defs::burstModeType StringTo(const std::string& s) {
if (s == "internal")
return defs::INTERNAL;
if (s == "external")
return defs::EXTERNAL;
throw sls::RuntimeError("Unknown burst mode type" + s);
}
/** For types with a .str() method use this for conversion */
template <typename T>
typename std::enable_if<has_str<T>::value, std::string>::type