diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c index a1642c59e..efd4f0d06 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -404,6 +404,8 @@ int setChipIndex(enum CHIPINDEX ind, char *mess) { return setChipVersionInFPGA(mess); } +enum CHIPINDEX getChipIndex() { return chipIndex; } + int validateChipIndex(enum CHIPINDEX ind, char *mess) { if (ind < 0 || ind >= NUM_CHIP_INDICES) { sprintf(mess, "Invalid chip index %d. Options: %s\n", (int)ind, diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h index 97f01d615..55dee0d18 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h @@ -102,6 +102,7 @@ int setChipVersionIntFromConfigFile(int val, char *mess); // for backward compatibility int setChipVersionStringFromConfigFile(char *cval, char *mess); int setChipIndex(enum CHIPINDEX ind, char *mess); +enum CHIPINDEX getChipIndex(); int validateChipIndex(enum CHIPINDEX ind, char *mess); void setChipIndexAllowedFeatures(); int setChipVersionInFPGA(char *mess); diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 9bef774cb..a48cff8f1 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -2370,7 +2370,7 @@ int set_num_additional_storage_cells(int file_des) { #else // only set if (Server_VerifyLock() == OK) { - if (!hasStorageCellsFeature() || getChipVersionInFPGA() > 11) { + if (!hasStorageCellsFeature() || getChipIndex() > v1_1) { ret = FAIL; sprintf(mess, "Cannot set addl. number of storage cells for this " "chip version\n"); diff --git a/slsDetectorSoftware/src/CallerSpecial.cpp b/slsDetectorSoftware/src/CallerSpecial.cpp index d6167cfba..153890428 100644 --- a/slsDetectorSoftware/src/CallerSpecial.cpp +++ b/slsDetectorSoftware/src/CallerSpecial.cpp @@ -1458,16 +1458,19 @@ std::string Caller::hdr(int action) { if (sls::is_int(args[0])) { auto val = StringTo(args[0]); if (val == 0) { - det->setHDR(defs::hdrParameters(), std::vector{det_id}); + auto disable = defs::hdrParameters(); + det->setHDR(disable, std::vector{det_id}); + os << val << '\n'; } else { throw RuntimeError("Did you mean to disable HDR? Then Please " "use '0' to do so. Unknown argument: " + args[0]); } + } else { + auto val = StringTo(args[0]); + det->setHDR(val, std::vector{det_id}); + os << ToString(val) << '\n'; } - auto val = StringTo(args[0]); - det->setHDR(val, std::vector{det_id}); - os << ToString(val) << '\n'; } else { throw RuntimeError("Unknown action"); }