This commit is contained in:
2021-08-10 17:26:26 +02:00
parent c716a87935
commit fce35e35a1
17 changed files with 486 additions and 78 deletions

View File

@ -114,6 +114,40 @@ std::ostream &operator<<(std::ostream &os,
return os << ToString(r);
}
std::string ToString(const slsDetectorDefs::currentSrcParameters &r) {
std::ostringstream oss;
if (r.fix < -1 || r.fix > 1 || r.normal < -1 || r.normal > 1) {
throw sls::RuntimeError(
"Invalid current source parameters. Cannot print.");
}
oss << '[';
if (r.enable) {
oss << "enabled" << std::endl;
// [jungfrau]
if (r.fix != -1) {
oss << (r.fix == 1 ? "fix" : "nofix") << std::endl;
}
// [jungfrau chip v1.1]
if (r.normal != -1) {
oss << (r.normal == 1 ? "normal" : "low") << std::endl;
oss << "select: " << ToStringHex(r.select, 16) << std::endl;
}
// [jungfrau chip v1.0]
else {
oss << "select: " << r.select << std::endl;
}
} else {
oss << "disabled";
}
oss << ']';
return oss.str();
}
std::ostream &operator<<(std::ostream &os,
const slsDetectorDefs::currentSrcParameters &r) {
return os << ToString(r);
}
std::string ToString(const defs::runStatus s) {
switch (s) {
case defs::ERROR: