diff --git a/RELEASE.txt b/RELEASE.txt index 57ff96fd4..b7223a41d 100755 --- a/RELEASE.txt +++ b/RELEASE.txt @@ -88,7 +88,7 @@ This document describes the differences between v7.0.0 and v6.x.x - adapted for g2 hdi v2.0. able to set master from server command line, server config file, and client. - rx udp socket refactored (maybe resolves getting stuck?)remove check for eiger header and isntead checks for malformed packets for every detector -help should not create a new object - +- g2 parallel command 2. Resolved Issues ================== diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 4283132a9..37dbe7002 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -2045,11 +2045,13 @@ class Detector(CppDetectorApi): @element def parallel(self): """ - [Eiger][Mythen3] Enable or disable the parallel readout mode of detector. + [Eiger][Mythen3][Gotthard2] Enable or disable the parallel readout mode of detector. Note ---- [Mythen3] If exposure time is too short, acquisition will return with an ERROR and take fewer frames than expected. + [Mythen3][Eiger] Default: Non parallel + [Gotthard2] Default: parallel. Non parallel mode works only in continuous mode. """ return self.getParallelMode() diff --git a/slsDetectorServers/gotthard2DetectorServer/RegisterDefs.h b/slsDetectorServers/gotthard2DetectorServer/RegisterDefs.h index 80096497b..820ba4420 100644 --- a/slsDetectorServers/gotthard2DetectorServer/RegisterDefs.h +++ b/slsDetectorServers/gotthard2DetectorServer/RegisterDefs.h @@ -155,6 +155,8 @@ #define ASIC_CONFIG_RESERVED_VAL ((0x3 << ASIC_CONFIG_GAIN_OFST) & ASIC_CONFIG_GAIN_MSK) #define ASIC_CONFIG_CURRENT_SRC_EN_OFST (7) #define ASIC_CONFIG_CURRENT_SRC_EN_MSK (0x00000001 << ASIC_CONFIG_CURRENT_SRC_EN_OFST) +#define ASIC_CONFIG_NON_PARALLEL_RD_OFST (8) +#define ASIC_CONFIG_NON_PARALLEL_RD_MSK (0x00000001 << ASIC_CONFIG_NON_PARALLEL_RD_OFST) #define ASIC_CONFIG_RST_DAC_OFST (15) #define ASIC_CONFIG_RST_DAC_MSK (0x00000001 << ASIC_CONFIG_RST_DAC_OFST) #define ASIC_CONFIG_DOUT_RDY_SRC_OFST (16) diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer index 77acb0cca..ddc2e4b7b 100755 Binary files a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer and b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer differ diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c index 804a52a81..8c5159be0 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c @@ -999,6 +999,28 @@ void resetPeripheral() { bus_w(CONTROL_REG, bus_r(CONTROL_REG) | CONTROL_PRPHRL_RST_MSK); } +/* set parameters - readout */ + +int setParallelMode(int mode) { + if (mode < 0) + return FAIL; + LOG(logINFO, ("Setting %s mode\n", (mode ? "Parallel" : "Non Parallel"))); + uint32_t addr = ASIC_CONFIG_REG; + if (mode) { + bus_w(addr, bus_r(addr) & ~ASIC_CONFIG_NON_PARALLEL_RD_MSK); + } else { + bus_w(addr, bus_r(addr) | ASIC_CONFIG_NON_PARALLEL_RD_MSK); + } + return OK; +} + +int getParallelMode() { + int nonparallel = + ((bus_r(ASIC_CONFIG_REG) & ASIC_CONFIG_NON_PARALLEL_RD_MSK) >> + ASIC_CONFIG_NON_PARALLEL_RD_OFST); + return (nonparallel == 0 ? 1 : 0); +} + /* set parameters - dr, roi */ int setDynamicRange(int dr) { diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h index 63eccf967..c529f644e 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h @@ -207,7 +207,7 @@ int setExternalSampling(int val); #endif // parameters - readout -#if defined(EIGERD) || defined(MYTHEN3D) +#if defined(EIGERD) || defined(MYTHEN3D) || defined(GOTTHARD2D) int setParallelMode(int mode); int getParallelMode(); #endif diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 794024016..f38863163 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -5499,7 +5499,7 @@ int set_parallel_mode(int file_des) { return printSocketReadError(); LOG(logINFO, ("Setting parallel mode: %u\n", arg)); -#if !defined(EIGERD) && !defined(MYTHEN3D) +#if !defined(EIGERD) && !defined(MYTHEN3D) && !defined(GOTTHARD2D) functionNotImplemented(); #else // only set @@ -5530,7 +5530,7 @@ int get_parallel_mode(int file_des) { LOG(logDEBUG1, ("Getting parallel mode\n")); -#if !defined(EIGERD) && !defined(MYTHEN3D) +#if !defined(EIGERD) && !defined(MYTHEN3D) && !defined(GOTTHARD2D) functionNotImplemented(); #else // get only diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index 9e3cb65f7..5a5340cda 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -499,12 +499,15 @@ class Detector { void setExternalSignalFlags(int signalIndex, defs::externalSignalFlag value, Positions pos = {}); - /** [Eiger][Mythen3] */ + /** [Eiger][Mythen3][Gotthard2] */ Result getParallelMode(Positions pos = {}) const; - /** [Eiger][Mythen3] + /** [Eiger][Mythen3][Gotthard2] * [Mythen3] If exposure time is too short, acquisition will return with an - * ERROR and take fewer frames than expected */ + * ERROR and take fewer frames than expected \n + * [Mythen3][Eiger] Default: Non parallel \n + * [Gotthard2] Default: Parallel. Non parallel mode works only in continuous + * mode.*/ void setParallelMode(bool value, Positions pos = {}); /** [Gotthard2][Jungfrau] */ diff --git a/slsDetectorSoftware/src/CmdProxy.h b/slsDetectorSoftware/src/CmdProxy.h index 1a0d1ddd9..3af991029 100644 --- a/slsDetectorSoftware/src/CmdProxy.h +++ b/slsDetectorSoftware/src/CmdProxy.h @@ -1407,10 +1407,12 @@ class CmdProxy { INTEGER_COMMAND_VEC_ID( parallel, getParallelMode, setParallelMode, StringTo, - "[0, 1]\n\t[Eiger][Mythen3] Enable or disable parallel " + "[0, 1]\n\t[Eiger][Mythen3][Gotthard2] Enable or disable parallel " "mode.\n\t[Mythen3] If exptime is too short, the " "acquisition will return ERROR status and take fewer " - "frames than expected."); + "frames than expected.\n\t[Mythen3][Eiger] Default: Non " + "parallel.\n\t[Gotthard2] Default: Parallel. Non parallel mode works " + "only in continuous mode."); INTEGER_COMMAND_VEC_ID( filterresistor, getFilterResistor, setFilterResistor, StringTo, diff --git a/slsDetectorSoftware/tests/test-CmdProxy.cpp b/slsDetectorSoftware/tests/test-CmdProxy.cpp index 7db7d699e..700f4b458 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy.cpp @@ -1483,7 +1483,8 @@ TEST_CASE("parallel", "[.cmd]") { CmdProxy proxy(&det); auto det_type = det.getDetectorType().squash(); - if (det_type == defs::EIGER || det_type == defs::MYTHEN3) { + if (det_type == defs::EIGER || det_type == defs::MYTHEN3 || + det_type == defs::GOTTHARD2) { auto prev_val = det.getParallelMode(); { std::ostringstream oss; diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index 412f62cfc..62ead04a5 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -7,8 +7,8 @@ #define APIGUI 0x220609 #define APICTB 0x220816 #define APIGOTTHARD 0x220816 -#define APIGOTTHARD2 0x220816 #define APIJUNGFRAU 0x220816 #define APIMYTHEN3 0x220816 #define APIMOENCH 0x220816 #define APIEIGER 0x220816 +#define APIGOTTHARD2 0x220816