diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index b3e107835..547d5d5f1 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -2570,7 +2570,7 @@ class Detector(CppDetectorApi): Note ----- - By default, the on-chip gain switching is active during the entire exposure. This mode disables the on-chip gain switching comparator automatically after 93.75% of exposure time (only for longer than 100us). The % is only for chipv1.0, the duration can be set for chipv1.1.\n + By default, the on-chip gain switching is active during the entire exposure. This mode disables the on-chip gain switching comparator automatically and the duration is set using compdisabletime.\n Default is 0 or this mode disabled (comparator enabled throughout). 1 enables mode. 0 disables mode. """ return self.getAutoComparatorDisable() @@ -2586,8 +2586,6 @@ class Detector(CppDetectorApi): Note ----- - It is only possible for chipv1.1. - :getter: always returns in seconds. To get in DurationWrapper, use getComparatorDisableTime Example @@ -2917,7 +2915,7 @@ class Detector(CppDetectorApi): @property @element def timing_info_decoder(self): - """[Jungfrau] [Jungfrau] Advanced Command and only for SWISSFEL and SHINE. Sets the bunch id or timing info decoder. Default is SWISSFEL. + """[Jungfrau] [Jungfrau] Advanced Command and only for SWISSFEL and SHINE. Sets the bunch id or timing info decoder. Default is SWISSFEL. Only allowed for pcbv2.0. Enum: timingInfoDecoder """ return self.getTimingInfoDecoder() diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer index 6525af9d6..b1002fa69 100755 Binary files a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer and b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer differ diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 9cf641b2d..9d133f7f4 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -9098,16 +9098,9 @@ int get_comp_disable_time(int file_des) { functionNotImplemented(); #else // get only - if (getChipVersion() != 11) { - ret = FAIL; - strcpy(mess, - "Cannot get comparator disable time. Only valid for chipv1.1\n"); - LOG(logERROR, (mess)); - } else { - retval = getComparatorDisableTime(); - LOG(logDEBUG1, - ("retval comp disable time %lld ns\n", (long long int)retval)); - } + retval = getComparatorDisableTime(); + LOG(logDEBUG1, + ("retval comp disable time %lld ns\n", (long long int)retval)); #endif return Server_SendResult(file_des, INT64, &retval, sizeof(retval)); } @@ -9125,23 +9118,16 @@ int set_comp_disable_time(int file_des) { #else // only set if (Server_VerifyLock() == OK) { - if (getChipVersion() != 11) { - ret = FAIL; - strcpy(mess, "Cannot get comparator disable time. Only valid for " - "chipv1.1\n"); + ret = setComparatorDisableTime(arg); + int64_t retval = getComparatorDisableTime(); + LOG(logDEBUG1, + ("retval get comp disable time %lld ns\n", (long long int)retval)); + if (ret == FAIL) { + sprintf(mess, + "Could not set comp disable time. Set %lld ns, read " + "%lld ns.\n", + (long long int)arg, (long long int)retval); LOG(logERROR, (mess)); - } else { - ret = setComparatorDisableTime(arg); - int64_t retval = getComparatorDisableTime(); - LOG(logDEBUG1, ("retval get comp disable time %lld ns\n", - (long long int)retval)); - if (ret == FAIL) { - sprintf(mess, - "Could not set comp disable time. Set %lld ns, read " - "%lld ns.\n", - (long long int)arg, (long long int)retval); - LOG(logERROR, (mess)); - } } } #endif @@ -11144,6 +11130,12 @@ int set_timing_info_decoder(int file_des) { modeNotImplemented("Timing info decoder index", (int)arg); break; } + if (ret == OK && isHardwareVersion_1_0()) { + ret = FAIL; + sprintf(mess, "Could not set timing info decoder. Not supported " + "for hardware version 1.0\n"); + LOG(logERROR, (mess)); + } if (ret == OK) { ret = setTimingInfoDecoder(arg); if (ret == FAIL) { diff --git a/slsDetectorSoftware/generator/commands.yaml b/slsDetectorSoftware/generator/commands.yaml index be298d0fd..acd1cc8e0 100644 --- a/slsDetectorSoftware/generator/commands.yaml +++ b/slsDetectorSoftware/generator/commands.yaml @@ -468,7 +468,7 @@ subdeadtime: function: setSubDeadTime compdisabletime: - help: "[duration] [(optional unit) ns|us|ms|s]\n\t[Jungfrau] Time before end of exposure when comparator is disabled. It is only possible for chipv1.1." + help: "[duration] [(optional unit) ns|us|ms|s]\n\t[Jungfrau] Time before end of exposure when comparator is disabled." inherit_actions: TIME_COMMAND actions: GET: @@ -1123,7 +1123,7 @@ temp_control: input_types: [ bool ] autocompdisable: - help: "[0, 1]\n\t[Jungfrau] Auto comparator disable mode. By default, the on-chip gain switching is active during the entire exposure.This mode disables the on - chip gain switching comparator automatically after 93.75% (only for chipv1.0) of exposure time (only for longer than 100us). It is possible to set the duration for chipv1.1 using compdisabletime command.\n\tDefault is 0 or this mode disabled(comparator enabled throughout). 1 enables mode. 0 disables mode. " + help: "[0, 1]\n\t[Jungfrau] Auto comparator disable mode. By default, the on-chip gain switching is active during the entire exposure.This mode disables the on - chip gain switching comparator automatically and the duration is set using compdisabletime command.\n\tDefault is 0 or this mode disabled(comparator enabled throughout). 1 enables mode. 0 disables mode. " inherit_actions: INTEGER_COMMAND_VEC_ID actions: GET: @@ -1210,7 +1210,7 @@ polarity: input_types: [ defs::polarity ] timing_info_decoder: - help: "[swissfel|shine]\n\t[Jungfrau] Advanced Command and only for Swissfel and Shine. Sets the bunch id or timing info decoder. Default is swissfel." + help: "[swissfel|shine]\n\t[Jungfrau] Advanced Command and only for Swissfel and Shine. Sets the bunch id or timing info decoder. Default is swissfel. Only allowed for pcbv2.0." inherit_actions: INTEGER_COMMAND_VEC_ID actions: GET: diff --git a/slsDetectorSoftware/generator/extended_commands.yaml b/slsDetectorSoftware/generator/extended_commands.yaml index 6f4d7b583..d0dd5cece 100644 --- a/slsDetectorSoftware/generator/extended_commands.yaml +++ b/slsDetectorSoftware/generator/extended_commands.yaml @@ -762,10 +762,9 @@ autocompdisable: function_alias: autocompdisable help: "[0, 1]\n\t[Jungfrau] Auto comparator disable mode. By default, the on-chip\ \ gain switching is active during the entire exposure.This mode disables the on\ - \ - chip gain switching comparator automatically after 93.75% (only for chipv1.0)\ - \ of exposure time (only for longer than 100us). It is possible to set the duration\ - \ for chipv1.1 using compdisabletime command.\n\tDefault is 0 or this mode disabled(comparator\ - \ enabled throughout). 1 enables mode. 0 disables mode. " + \ - chip gain switching comparator automatically and the duration is set using\ + \ compdisabletime command.\n\tDefault is 0 or this mode disabled(comparator enabled\ + \ throughout). 1 enables mode. 0 disables mode. " infer_action: true template: true badchannels: @@ -1607,7 +1606,7 @@ compdisabletime: command_name: compdisabletime function_alias: compdisabletime help: "[duration] [(optional unit) ns|us|ms|s]\n\t[Jungfrau] Time before end of\ - \ exposure when comparator is disabled. It is only possible for chipv1.1." + \ exposure when comparator is disabled." infer_action: true template: true confadc: @@ -11386,7 +11385,8 @@ timing_info_decoder: command_name: timing_info_decoder function_alias: timing_info_decoder help: "[swissfel|shine]\n\t[Jungfrau] Advanced Command and only for Swissfel and\ - \ Shine. Sets the bunch id or timing info decoder. Default is swissfel." + \ Shine. Sets the bunch id or timing info decoder. Default is swissfel. Only allowed\ + \ for pcbv2.0." infer_action: true template: true timinglist: diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index b51345f30..becdde20d 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -1309,11 +1309,9 @@ class Detector { * //TODO naming * By default, the on-chip gain switching is active during the * entire exposure. This mode disables the on-chip gain switching comparator - * automatically after 93.75% of exposure time (only for longer than 100us). - * The % is for chipv1.0. One can set the duration for chipv1.1 using - * setComparatorDisableTime\n Default is false or this mode - * disabled(comparator enabled throughout). true enables mode. 0 disables - * mode. + * automatically and the duration is set using setComparatorDisableTime\n + * Default is false or this mode disabled(comparator enabled throughout). + * true enables mode. 0 disables mode. */ void setAutoComparatorDisable(bool value, Positions pos = {}); @@ -1321,7 +1319,7 @@ class Detector { Result getComparatorDisableTime(Positions pos = {}) const; /** [Jungfrau] Time before end of exposure when comparator is - * disabled. It is only possible for chipv1.1.*/ + * disabled.*/ void setComparatorDisableTime(ns t, Positions pos = {}); /** [Jungfrau] Advanced TODO naming */ @@ -1387,7 +1385,7 @@ class Detector { Result getTimingInfoDecoder(Positions pos = {}) const; - /** [Jungfrau] Advanced Command! */ + /** [Jungfrau] Advanced Command! Only for pcb v2.0 */ void setTimingInfoDecoder(defs::timingInfoDecoder value, Positions pos = {}); diff --git a/slsDetectorSoftware/src/Caller.cpp b/slsDetectorSoftware/src/Caller.cpp index 96fd229a1..ba53173da 100644 --- a/slsDetectorSoftware/src/Caller.cpp +++ b/slsDetectorSoftware/src/Caller.cpp @@ -1018,7 +1018,7 @@ std::string Caller::autocompdisable(int action) { // print help if (action == slsDetectorDefs::HELP_ACTION) { os << R"V0G0N([0, 1] - [Jungfrau] Auto comparator disable mode. By default, the on-chip gain switching is active during the entire exposure.This mode disables the on - chip gain switching comparator automatically after 93.75% (only for chipv1.0) of exposure time (only for longer than 100us). It is possible to set the duration for chipv1.1 using compdisabletime command. + [Jungfrau] Auto comparator disable mode. By default, the on-chip gain switching is active during the entire exposure.This mode disables the on - chip gain switching comparator automatically and the duration is set using compdisabletime command. Default is 0 or this mode disabled(comparator enabled throughout). 1 enables mode. 0 disables mode. )V0G0N" << std::endl; return os.str(); @@ -2108,7 +2108,7 @@ std::string Caller::compdisabletime(int action) { // print help if (action == slsDetectorDefs::HELP_ACTION) { os << R"V0G0N([duration] [(optional unit) ns|us|ms|s] - [Jungfrau] Time before end of exposure when comparator is disabled. It is only possible for chipv1.1. )V0G0N" + [Jungfrau] Time before end of exposure when comparator is disabled. )V0G0N" << std::endl; return os.str(); } @@ -14655,7 +14655,7 @@ std::string Caller::timing_info_decoder(int action) { // print help if (action == slsDetectorDefs::HELP_ACTION) { os << R"V0G0N([swissfel|shine] - [Jungfrau] Advanced Command and only for Swissfel and Shine. Sets the bunch id or timing info decoder. Default is swissfel. )V0G0N" + [Jungfrau] Advanced Command and only for Swissfel and Shine. Sets the bunch id or timing info decoder. Default is swissfel. Only allowed for pcbv2.0. )V0G0N" << std::endl; return os.str(); } diff --git a/slsDetectorSoftware/tests/Caller/test-Caller-jungfrau.cpp b/slsDetectorSoftware/tests/Caller/test-Caller-jungfrau.cpp index e63f99144..f6fb4260d 100644 --- a/slsDetectorSoftware/tests/Caller/test-Caller-jungfrau.cpp +++ b/slsDetectorSoftware/tests/Caller/test-Caller-jungfrau.cpp @@ -262,8 +262,7 @@ TEST_CASE("compdisabletime", "[.cmdcall]") { Detector det; Caller caller(&det); auto det_type = det.getDetectorType().squash(); - if (det_type == defs::JUNGFRAU && - det.getChipVersion().squash() * 10 == 11) { + if (det_type == defs::JUNGFRAU) { auto prev_val = det.getComparatorDisableTime(); { std::ostringstream oss; @@ -670,7 +669,8 @@ TEST_CASE("pedestalmode", "[.cmdcall]") { TEST_CASE("timing_info_decoder", "[.cmdcall]") { Detector det; Caller caller(&det); - if (det.getDetectorType().squash() == defs::JUNGFRAU) { + if (det.getDetectorType().squash() == defs::JUNGFRAU && + det.getHardwareVersion().squash() == "2.0") { auto prev_val = det.getTimingInfoDecoder(); /*{ std::ostringstream oss; diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index 649399f08..6018bc31c 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -5,9 +5,9 @@ #define APIGOTTHARD2 "developer 0x241107" #define APIMOENCH "developer 0x241107" #define APIEIGER "developer 0x241107" -#define APIJUNGFRAU "developer 0x241120" #define APILIB "developer 0x241122" #define APIRECEIVER "developer 0x241122" #define APIXILINXCTB "developer 0x250131" #define APICTB "developer 0x250131" #define APIMYTHEN3 "developer 0x250131" +#define APIJUNGFRAU "developer 0x250218"