mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 21:07:13 +02:00
filter and cds gain, burst and continuous value to asic changed, bug fix to scanning function addresses in server_funcs.c
This commit is contained in:
@ -891,6 +891,18 @@ template <> int StringTo(const std::string &s) {
|
||||
return std::stoi(s, nullptr, base);
|
||||
}
|
||||
|
||||
template <> bool StringTo(const std::string &s) {
|
||||
int i = std::stoi(s, nullptr, 10);
|
||||
switch (i) {
|
||||
case 0:
|
||||
return false;
|
||||
case 1:
|
||||
return true;
|
||||
default:
|
||||
throw sls::RuntimeError("Unknown boolean. Expecting be 0 or 1.");
|
||||
}
|
||||
}
|
||||
|
||||
template <> int64_t StringTo(const std::string &s) {
|
||||
int base = s.find("0x") != std::string::npos ? 16 : 10;
|
||||
return std::stol(s, nullptr, base);
|
||||
|
Reference in New Issue
Block a user