Merge branch 'j7filter' into j14filtercell

This commit is contained in:
2021-08-05 17:51:08 +02:00
2 changed files with 30 additions and 4 deletions

View File

@ -7782,8 +7782,18 @@ int get_filter_resistor(int file_des) {
functionNotImplemented();
#else
// get only
retval = getFilterResistor();
LOG(logDEBUG1, ("filter resistor retval: %u\n", retval));
#ifdef JUNGFRAUD
if (getChipVersion() == 10) {
ret = FAIL;
strcpy(mess, "Could not get filter cell. Not available for this chip "
"version 1.0.\n");
LOG(logERROR, (mess));
}
#endif
if (ret == OK) {
retval = getFilterResistor();
LOG(logDEBUG1, ("filter resistor retval: %u\n", retval));
}
#endif
return Server_SendResult(file_des, INT32, &retval, sizeof(retval));
}
@ -7809,7 +7819,16 @@ int set_filter_resistor(int file_des) {
"Options [0-%d]\n",
arg, ASIC_FILTER_MAX_RES_VALUE);
LOG(logERROR, (mess));
} else {
}
#ifdef JUNGFRAUD
else if (getChipVersion() == 10) {
ret = FAIL;
strcpy(mess, "Could not set filter cell. Not available for this "
"chip version 1.0.\n");
LOG(logERROR, (mess));
}
#endif
else {
ret = setFilterResistor(arg);
if (ret == FAIL) {
ret = FAIL;

View File

@ -1384,7 +1384,14 @@ TEST_CASE("filterresistor", "[.cmd]") {
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::GOTTHARD2 || det_type == defs::JUNGFRAU) {
// only for chipv1.1
bool chip11 = false;
if (det_type == defs::JUNGFRAU &&
det.getChipVersion().squash() * 10 == 11) {
chip11 = true;
}
if (det_type == defs::GOTTHARD2 || chip11) {
auto prev_val = det.getFilterResistor();
{
std::ostringstream oss;