mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 21:07:13 +02:00
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:
@ -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);
|
||||
|
Reference in New Issue
Block a user