mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-11-05 21:43:12 +01:00
use chipindex and fix the cli put
This commit is contained in:
1 parent
734eb7b51a
commit
39148679e0
4 files changed
+11
-5
No files matched your search
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
|
||||
@@ -1458,16 +1458,19 @@ std::string Caller::hdr(int action) {
|
||||
if (sls::is_int(args[0])) {
|
||||
auto val = StringTo<int>(args[0]);
|
||||
if (val == 0) {
|
||||
det->setHDR(defs::hdrParameters(), std::vector<int>{det_id});
|
||||
auto disable = defs::hdrParameters();
|
||||
det->setHDR(disable, std::vector<int>{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<defs::operationMode>(args[0]);
|
||||
det->setHDR(val, std::vector<int>{det_id});
|
||||
os << ToString(val) << '\n';
|
||||
}
|
||||
auto val = StringTo<defs::hdrParameters>(args[0]);
|
||||
det->setHDR(val, std::vector<int>{det_id});
|
||||
os << ToString(val) << '\n';
|
||||
} else {
|
||||
throw RuntimeError("Unknown action");
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user