mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07:59 +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:
@ -290,6 +290,7 @@ template <> defs::timingSourceType StringTo(const std::string &s);
|
||||
template <> uint32_t StringTo(const std::string &s);
|
||||
template <> uint64_t StringTo(const std::string &s);
|
||||
template <> int StringTo(const std::string &s);
|
||||
template <> bool StringTo(const std::string &s);
|
||||
template <> int64_t StringTo(const std::string &s);
|
||||
|
||||
/** For types with a .str() method use this for conversion */
|
||||
|
@ -203,6 +203,10 @@ enum detFuncs {
|
||||
F_GET_SCAN,
|
||||
F_SET_SCAN,
|
||||
F_GET_SCAN_ERROR_MESSAGE,
|
||||
F_GET_CDS_GAIN,
|
||||
F_SET_CDS_GAIN,
|
||||
F_GET_FILTER,
|
||||
F_SET_FILTER,
|
||||
|
||||
NUM_DET_FUNCTIONS,
|
||||
RECEIVER_ENUM_START = 256, /**< detector function should not exceed this
|
||||
@ -504,7 +508,10 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
case F_GET_SCAN: return "F_GET_SCAN";
|
||||
case F_SET_SCAN: return "F_SET_SCAN";
|
||||
case F_GET_SCAN_ERROR_MESSAGE: return "F_GET_SCAN_ERROR_MESSAGE";
|
||||
|
||||
case F_GET_CDS_GAIN: return "F_GET_CDS_GAIN";
|
||||
case F_SET_CDS_GAIN: return "F_SET_CDS_GAIN";
|
||||
case F_GET_FILTER: return "F_GET_FILTER";
|
||||
case F_SET_FILTER: return "F_SET_FILTER";
|
||||
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
|
||||
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
|
||||
|
||||
|
@ -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