Jf: Electron collection mode (#983)

* electron collection mode for jungfrau. also removing the config chip when using register command
* collectionMode: HOLE/ELECTRON (enum)
This commit is contained in:
2024-09-30 17:15:22 +02:00
committed by GitHub
parent 7fa5b5d70a
commit 5b832cb6aa
30 changed files with 32158 additions and 21441 deletions

View File

@ -679,6 +679,17 @@ std::string ToString(const defs::polarity s) {
}
}
std::string ToString(const defs::collectionMode s) {
switch (s) {
case defs::HOLE:
return std::string("hole");
case defs::ELECTRON:
return std::string("electron");
default:
return std::string("Unknown");
}
}
const std::string &ToString(const std::string &s) { return s; }
template <> defs::detectorType StringTo(const std::string &s) {
@ -1104,6 +1115,14 @@ template <> defs::polarity StringTo(const std::string &s) {
throw RuntimeError("Unknown polarity mode " + s);
}
template <> defs::collectionMode StringTo(const std::string &s) {
if (s == "hole")
return defs::HOLE;
if (s == "electron")
return defs::ELECTRON;
throw RuntimeError("Unknown collection mode " + s);
}
template <> uint8_t StringTo(const std::string &s) {
int base = s.find("0x") != std::string::npos ? 16 : 10;
int value = std::stoi(s, nullptr, base);