From e20022f1395c47d6c5f1ad3775d2e9273883e188 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Tue, 3 Aug 2021 14:51:00 +0200 Subject: [PATCH] jungfrau: settings should not be validated to undefined when special dacs are set individually --- .../slsDetectorFunctionList.c | 41 ------------------- .../include/slsDetectorFunctionList.h | 3 -- 2 files changed, 44 deletions(-) diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c index d03e8a9f5..200b1a03f 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -1078,41 +1078,6 @@ enum detectorSettings setSettings(enum detectorSettings sett) { return thisSettings; } -void validateSettings() { - // if any special dac value is changed individually => undefined - const int specialDacs[NSPECIALDACS] = SPECIALDACINDEX; - int *specialDacValues[] = {defaultDacValue_G0, defaultDacValue_HG0}; - int settList[] = {DYNAMICGAIN, DYNAMICHG0}; - enum detectorSettings sett = UNDEFINED; - for (int isett = 0; isett != NUMSETTINGS; ++isett) { - - // assume it matches current setting in list - sett = settList[isett]; - // if one value does not match, = undefined - for (int i = 0; i < NSPECIALDACS; ++i) { - if (getDAC(specialDacs[i], 0) != specialDacValues[isett][i]) { - sett = UNDEFINED; - break; - } - } - - // all values matchd a setting - if (sett != UNDEFINED) { - break; - } - } - // update settings - if (thisSettings != sett) { - LOG(logINFOBLUE, - ("Validated settings to %s (%d)\n", - (sett == DYNAMICGAIN - ? "dynamicgain" - : (sett == DYNAMICHG0 ? "dynamichg0" : "undefined")), - sett)); - thisSettings = sett; - } -} - enum detectorSettings getSettings() { return thisSettings; } enum gainMode getGainMode() { @@ -1193,12 +1158,6 @@ void setDAC(enum DACINDEX ind, int val, int mV) { } } #endif - const int specialDacs[NSPECIALDACS] = SPECIALDACINDEX; - for (int i = 0; i < NSPECIALDACS; ++i) { - if ((int)ind == specialDacs[i]) { - validateSettings(); - } - } } int getDAC(enum DACINDEX ind, int mV) { diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h index de06ff9ff..95a1c2249 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h @@ -297,9 +297,6 @@ int getAllTrimbits(); #ifndef CHIPTESTBOARDD enum detectorSettings setSettings(enum detectorSettings sett); #endif -#if defined(MYTHEN3D) || defined(JUNGFRAUD) -void validateSettings(); -#endif enum detectorSettings getSettings(); #ifdef JUNGFRAUD enum gainMode getGainMode();