mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 12:27:14 +02:00
gotthard2: timingsource and currentsource features, (timing source external yet to be implemented in fpga to test (#80)
This commit is contained in:
@ -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>
|
||||
|
Reference in New Issue
Block a user