mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 05:47:14 +02:00
fixed
This commit is contained in:
@ -6797,12 +6797,15 @@ int set_current_source(int file_des) {
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
int chipVersion = getChipVersion();
|
int chipVersion = getChipVersion();
|
||||||
|
if (ret == OK) {
|
||||||
if (chipVersion == 11) {
|
if (chipVersion == 11) {
|
||||||
// require both
|
// require both
|
||||||
if ((fix != 0 && fix != 1) || (normal != 0 && normal != 1)) {
|
if ((fix != 0 && fix != 1) ||
|
||||||
|
(normal != 0 && normal != 1)) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
strcpy(mess,
|
strcpy(mess, "Could not enable current source. Invalid "
|
||||||
"Could not enable current source. Invalid value for parameters (fix or normal). Options: 0 or 1.\n");
|
"or insufficient parameters (fix or "
|
||||||
|
"normal). or Options: 0 or 1.\n");
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6816,21 +6819,25 @@ int set_current_source(int file_des) {
|
|||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
} else if (normal != -1) {
|
} else if (normal != -1) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
strcpy(mess,
|
strcpy(mess, "Could not enable current source. Invalid "
|
||||||
"Could not enable current source. Invalid parmaeter (normal). Require only fix and select for chipv1.0.\n");
|
"parmaeter (normal). Require only fix and "
|
||||||
|
"select for chipv1.0.\n");
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
}
|
}
|
||||||
// select can only be 0-63
|
// select can only be 0-63
|
||||||
else if (select > MAX_SELECT_CHIP10_VAL) {
|
else if (select > MAX_SELECT_CHIP10_VAL) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
strcpy(mess,
|
strcpy(mess,
|
||||||
"Could not enable current source. Invalid value for parameter (select). Options: 0-63.\n");
|
"Could not enable current source. Invalid value "
|
||||||
|
"for parameter (select). Options: 0-63.\n");
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ret == OK) {
|
||||||
#ifdef JUNGFRAUD
|
#ifdef JUNGFRAUD
|
||||||
if (enable == 0) {
|
if (enable == 0) {
|
||||||
disableCurrentSource();
|
disableCurrentSource();
|
||||||
@ -6844,6 +6851,7 @@ int set_current_source(int file_des) {
|
|||||||
LOG(logDEBUG1, ("current source enable retval: %u\n", retval));
|
LOG(logDEBUG1, ("current source enable retval: %u\n", retval));
|
||||||
validate(&ret, mess, enable, retval, "set current source enable", DEC);
|
validate(&ret, mess, enable, retval, "set current source enable", DEC);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||||
}
|
}
|
||||||
@ -6863,10 +6871,14 @@ int get_current_source(int file_des) {
|
|||||||
retvals[0] = getCurrentSource();
|
retvals[0] = getCurrentSource();
|
||||||
LOG(logDEBUG1, ("current source enable retval: %u\n", retvals[0]));
|
LOG(logDEBUG1, ("current source enable retval: %u\n", retvals[0]));
|
||||||
#ifdef JUNGFRAUD
|
#ifdef JUNGFRAUD
|
||||||
|
if (retvals[0]) {
|
||||||
retvals[1] = getFixCurrentSource();
|
retvals[1] = getFixCurrentSource();
|
||||||
retvals[2] = getNormalCurrentSource();
|
retvals[2] = getNormalCurrentSource();
|
||||||
retval_select = getSelectCurrentSource();
|
retval_select = getSelectCurrentSource();
|
||||||
LOG(logDEBUG1, ("current source parameters retval: [fix:%d, normal:%d, select:%lld]\n", retvals[1], retvals[2], retval_select));
|
}
|
||||||
|
LOG(logDEBUG1, ("current source parameters retval: [enable:%d fix:%d, "
|
||||||
|
"normal:%d, select:%lld]\n",
|
||||||
|
retvals[0], retvals[1], retvals[2], retval_select));
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
Server_SendResult(file_des, INT32, NULL, 0);
|
Server_SendResult(file_des, INT32, NULL, 0);
|
||||||
|
Reference in New Issue
Block a user