From e92270565b9eae63be947b03fec47c319f4987b9 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 6 Aug 2021 16:38:05 +0200 Subject: [PATCH] changed gain mode. dynamic_gain_mode to dynamic only. binaries in --- python/scripts/test_virtual.py | 4 ++-- python/slsdet/detector.py | 2 +- python/src/enums.cpp | 2 +- slsDetectorGui/include/qTabSettings.h | 2 +- slsDetectorGui/src/qTabSettings.cpp | 2 +- .../bin/ctbDetectorServer_developer | Bin 271516 -> 271516 bytes .../bin/eigerDetectorServer_developer | Bin 381856 -> 381856 bytes .../bin/gotthardDetectorServer_developer | Bin 222400 -> 222400 bytes .../bin/jungfrauDetectorServer_developer | Bin 244476 -> 244476 bytes .../slsDetectorFunctionList.c | 4 ++-- .../slsDetectorServer_defs.h | 2 +- .../bin/moenchDetectorServer_developer | Bin 260132 -> 260132 bytes .../src/slsDetectorServer_funcs.c | 4 ++-- slsDetectorSoftware/include/sls/Detector.h | 2 +- slsDetectorSoftware/src/Detector.cpp | 2 +- .../tests/test-CmdProxy-jungfrau.cpp | 4 ++-- slsSupportLib/include/sls/ToString.h | 4 ---- slsSupportLib/include/sls/sls_detector_defs.h | 2 +- slsSupportLib/include/sls/versionAPI.h | 2 +- slsSupportLib/src/ToString.cpp | 8 ++++---- 20 files changed, 21 insertions(+), 25 deletions(-) diff --git a/python/scripts/test_virtual.py b/python/scripts/test_virtual.py index eec0da90b..2024194ac 100644 --- a/python/scripts/test_virtual.py +++ b/python/scripts/test_virtual.py @@ -161,7 +161,7 @@ def test_gainmode(virtual_jf_detectors): assert d.gainMode == gainMode.NORMAL_GAIN_MODE gain_list = [ - gainMode.DYNAMIC_GAIN_MODE, + gainMode.DYNAMIC, gainMode.FORCE_SWITCH_G1, gainMode.FORCE_SWITCH_G2, gainMode.FIX_G1, @@ -176,7 +176,7 @@ def test_gainmode(virtual_jf_detectors): d.setGainMode(gainMode.FORCE_SWITCH_G1, [1]) assert d.gainMode == [ - gainMode.DYNAMIC_GAIN_MODE, + gainMode.DYNAMIC, gainMode.FORCE_SWITCH_G1, gainMode.FORCE_SWITCH_G2, gainMode.FIX_G1, diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index a60db56f4..cb1f0d827 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -2201,7 +2201,7 @@ class Detector(CppDetectorApi): [Jungfrau] Detector gain mode. Enum: gainMode Note ----- - [Jungfrau] DYNAMIC_GAIN_MODE, FORCE_SWITCH_G1, FORCE_SWITCH_G2, FIX_G1, FIX_G2, FIX_G0 \n + [Jungfrau] DYNAMIC, FORCE_SWITCH_G1, FORCE_SWITCH_G2, FIX_G1, FIX_G2, FIX_G0 \n CAUTION: Do not use FIX_G0 without caution, you can damage the detector!!! """ return element_if_equal(self.getGainMode()) diff --git a/python/src/enums.cpp b/python/src/enums.cpp index 7519382fc..2aada8f5c 100644 --- a/python/src/enums.cpp +++ b/python/src/enums.cpp @@ -308,7 +308,7 @@ void init_enums(py::module &m) { .export_values(); py::enum_(Defs, "gainMode") - .value("DYNAMIC_GAIN_MODE", slsDetectorDefs::gainMode::DYNAMIC_GAIN_MODE) + .value("DYNAMIC", slsDetectorDefs::gainMode::DYNAMIC) .value("FORCE_SWITCH_G1", slsDetectorDefs::gainMode::FORCE_SWITCH_G1) .value("FORCE_SWITCH_G2", slsDetectorDefs::gainMode::FORCE_SWITCH_G2) .value("FIX_G1", slsDetectorDefs::gainMode::FIX_G1) diff --git a/slsDetectorGui/include/qTabSettings.h b/slsDetectorGui/include/qTabSettings.h index 927cd8436..d4ec2f73a 100644 --- a/slsDetectorGui/include/qTabSettings.h +++ b/slsDetectorGui/include/qTabSettings.h @@ -65,7 +65,7 @@ class qTabSettings : public QWidget, private Ui::TabSettingsObject { }; enum { - DYNAMIC_GAIN_MODE, + DYNAMIC, FORCE_SWITCH_G1, FORCE_SWITCH_G2, FIX_G1, diff --git a/slsDetectorGui/src/qTabSettings.cpp b/slsDetectorGui/src/qTabSettings.cpp index 0181667b7..677b1864b 100644 --- a/slsDetectorGui/src/qTabSettings.cpp +++ b/slsDetectorGui/src/qTabSettings.cpp @@ -132,7 +132,7 @@ void qTabSettings::SetupDetectorSettings() { } void qTabSettings::SetupGainMode() { - comboGainMode->setCurrentIndex(DYNAMIC_GAIN_MODE); + comboGainMode->setCurrentIndex(DYNAMIC); ShowFixG0(false); } diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer index f62a4fa718bb2b7ae3225f098fc6154339efc8ff..5aac2c8b1d707e6f755e16e235b385b06544f685 100755 GIT binary patch delta 32 ocmbPpQee(WfeBhno_f;*qnITcU0PijTV0r1U6{AJutcZ;0J@F7M3lnnUk5!jJIb`W;JyH0GHMYrT_o{ delta 28 kcmZ3mTztWD@rD-07N!>F7M3lnnUk4J47X=bW;JyH0GGH4q5uE@ diff --git a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer index ae012323ba8d32f7b60ea922dfc064d602dd4c8f..809daf590db2a768954bac9217edd62cdb892a6e 100755 GIT binary patch delta 29 lcmX?blJ~$#-U(Vvp8C@ZcQ8pby0p45wz@EFbz!ba0RXJH3UL4c delta 29 lcmX?blJ~$#-U(Vv&gZ8W?qHH=bZK>AY;|GU>cU);0sy!m3kv`M diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer index 75d586829ecac594df8b578a493c96bb284681da..9a13438ee9ead13f077ec09a425a6177d2885491 100755 GIT binary patch delta 29 lcmezKmG942z6n}Po`%yInV2OSU0PijTV0s8x-jq91pu)g3bFtI delta 29 lcmezKmG942z6n}P&KIXMGBHauy0p45wz@EFbz$DI3jn-^3rqk2 diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c index 0665f053e..677946d7c 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorFunctionList.c @@ -1103,7 +1103,7 @@ enum gainMode getGainMode() { // dynamic gain, when nothing is set if (retval_force == 0 && retval_fix == 0 && retval_cmp_rst == 0) { - return DYNAMIC_GAIN_MODE; + return DYNAMIC; } switch (retval_force) { @@ -1137,7 +1137,7 @@ void setGainMode(enum gainMode mode) { uint32_t value = bus_r(addr); switch (mode) { - case DYNAMIC_GAIN_MODE: + case DYNAMIC: value &= ~(DAQ_GAIN_MODE_MASK); bus_w(addr, value); LOG(logINFO, diff --git a/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h b/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h index 6f222b746..4fd1b3dbe 100644 --- a/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h +++ b/slsDetectorServers/jungfrauDetectorServer/slsDetectorServer_defs.h @@ -98,7 +98,7 @@ enum CLKINDEX { RUN_CLK, ADC_CLK, DBIT_CLK, NUM_CLOCKS }; #define DEFAULT_HIGH_VOLTAGE (0) #define DEFAULT_TIMING_MODE (AUTO_TIMING) #define DEFAULT_SETTINGS (GAIN0) -#define DEFAULT_GAINMODE (DYNAMIC_GAIN_MODE) +#define DEFAULT_GAINMODE (DYNAMIC) #define DEFAULT_TX_UDP_PORT (0x7e9a) #define DEFAULT_TMP_THRSHLD (65 * 1000) // milli degree Celsius #define DEFAULT_NUM_STRG_CLLS (0) diff --git a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer index 24572173c67d08bed736aa59dd7c706d34950142..53f2b1e4187293622dbaca98f7e72993b099f7b9 100755 GIT binary patch delta 29 lcmZ4Tfq%&d{s~%4p2pJ~O_(JbU0PijTV0s8x-dWZ4gjgM3ljhU delta 29 lcmZ4Tfq%&d{s~%4&X=b*nlMW=y0p45wz@EFbzy$+9RRf(3#|YE diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 8a54a7f57..1edf4a337 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -8560,7 +8560,7 @@ int set_default_dac(int file_des) { int get_gain_mode(int file_des) { ret = OK; memset(mess, 0, sizeof(mess)); - enum gainMode retval = DYNAMIC_GAIN_MODE; + enum gainMode retval = DYNAMIC; LOG(logDEBUG1, ("Getting gain mode\n")); #ifndef JUNGFRAUD @@ -8593,7 +8593,7 @@ int set_gain_mode(int file_des) { // only set if (Server_VerifyLock() == OK) { switch (gainmode) { - case DYNAMIC_GAIN_MODE: + case DYNAMIC: case FORCE_SWITCH_G1: case FORCE_SWITCH_G2: case FIX_G1: diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index e2144e6fc..8dafce50c 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -1179,7 +1179,7 @@ class Detector { /** [Jungfrau]*/ Result getGainMode(Positions pos = {}) const; - /** [Jungfrau] Options: DYNAMIC_GAIN_MODE, FORCE_SWITCH_G1, FORCE_SWITCH_G2, + /** [Jungfrau] Options: DYNAMIC, FORCE_SWITCH_G1, FORCE_SWITCH_G2, * FIX_G1, FIX_G2, FIX_G0 \n\CAUTION: Do not use FIX_G0 without caution, you * can damage the detector!!!\n */ diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 0d423cd29..821ea9f14 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -1493,7 +1493,7 @@ void Detector::setStorageCellDelay(ns value, Positions pos) { std::vector Detector::getGainModeList() const { switch (getDetectorType().squash()) { case defs::JUNGFRAU: - return std::vector{defs::DYNAMIC_GAIN_MODE, + return std::vector{defs::DYNAMIC, defs::FORCE_SWITCH_G1, defs::FORCE_SWITCH_G2, defs::FIX_G1, diff --git a/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp b/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp index 3fddd6f26..ed517a899 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-jungfrau.cpp @@ -458,8 +458,8 @@ TEST_CASE("gainmode", "[.cmd]") { } { std::ostringstream oss; - proxy.Call("gainmode", {"dynamicgain"}, -1, PUT, oss); - REQUIRE(oss.str() == "gainmode dynamicgain\n"); + proxy.Call("gainmode", {"dynamic"}, -1, PUT, oss); + REQUIRE(oss.str() == "gainmode dynamic\n"); } { std::ostringstream oss; diff --git a/slsSupportLib/include/sls/ToString.h b/slsSupportLib/include/sls/ToString.h index a515b51be..aede99dd6 100644 --- a/slsSupportLib/include/sls/ToString.h +++ b/slsSupportLib/include/sls/ToString.h @@ -36,13 +36,9 @@ std::string ToString(const defs::dacIndex s); std::string ToString(const std::vector &vec); std::string ToString(const defs::burstMode s); std::string ToString(const defs::timingSourceType s); -<<<<<<< HEAD std::string ToString(const defs::M3_GainCaps s); std::string ToString(const defs::portPosition s); -std::string ToString(const defs::ethernetInterface s); -======= std::string ToString(const defs::streamingInterface s); ->>>>>>> 5.2.0-rc std::string ToString(const defs::vetoAlgorithm s); std::string ToString(const defs::gainMode s); diff --git a/slsSupportLib/include/sls/sls_detector_defs.h b/slsSupportLib/include/sls/sls_detector_defs.h index f8dbe0e8d..e51de7cc2 100644 --- a/slsSupportLib/include/sls/sls_detector_defs.h +++ b/slsSupportLib/include/sls/sls_detector_defs.h @@ -416,7 +416,7 @@ typedef struct { enum vetoAlgorithm { DEFAULT_ALGORITHM }; enum gainMode { - DYNAMIC_GAIN_MODE, + DYNAMIC, FORCE_SWITCH_G1, FORCE_SWITCH_G2, FIX_G1, diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index bd94fed72..b89933f47 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -3,10 +3,10 @@ #define APILIB 0x210225 #define APIRECEIVER 0x210225 #define APIGUI 0x210225 -#define APIEIGER 0x210806 #define APICTB 0x210806 #define APIGOTTHARD 0x210806 #define APIGOTTHARD2 0x210806 #define APIJUNGFRAU 0x210806 #define APIMYTHEN3 0x210806 #define APIMOENCH 0x210806 +#define APIEIGER 0x210806 diff --git a/slsSupportLib/src/ToString.cpp b/slsSupportLib/src/ToString.cpp index 049a4db5f..0a39098be 100644 --- a/slsSupportLib/src/ToString.cpp +++ b/slsSupportLib/src/ToString.cpp @@ -583,8 +583,8 @@ std::string ToString(const defs::vetoAlgorithm s) { std::string ToString(const defs::gainMode s) { switch (s) { - case defs::DYNAMIC_GAIN_MODE: - return std::string("dynamicgain"); + case defs::DYNAMIC: + return std::string("dynamic"); case defs::FORCE_SWITCH_G1: return std::string("forceswitchg1"); case defs::FORCE_SWITCH_G2: @@ -986,8 +986,8 @@ template <> defs::vetoAlgorithm StringTo(const std::string &s) { } template <> defs::gainMode StringTo(const std::string &s) { - if (s == "dynamicgain") - return defs::DYNAMIC_GAIN_MODE; + if (s == "dynamic") + return defs::DYNAMIC; if (s == "forceswitchg1") return defs::FORCE_SWITCH_G1; if (s == "forceswitchg2")