mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 21:37:13 +02:00
wip
This commit is contained in:
@ -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:
|
||||
|
Reference in New Issue
Block a user