diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index f03551ce3..061e70193 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -1749,7 +1749,7 @@ class Detector(CppDetectorApi): Note ---- [Eiger] Sets vcmp_ll, vcmp_lr, vcmp_rl, vcmp_rr and vcp to the same value. \n - [Mythen3] Sets vth1, vth2 and vth3 to the same value. + [Mythen3] Sets vth1, vth2 and vth3 to the same value for enabled counters. """ return self.getDAC(dacIndex.VTHRESHOLD) @@ -2381,6 +2381,7 @@ class Detector(CppDetectorApi): Note ----- Each element in list can be 0 - 2 and must be non repetitive. + Enabling counters sets vth dacs to remembered values and disabling sets them to disabled values. Example ----------- diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index ca93b617b..434c391e4 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -1273,7 +1273,9 @@ class Detector { /** [Mythen3] */ Result getCounterMask(Positions pos = {}) const; - /** [Mythen3] countermask bit set for each counter index enabled */ + /** [Mythen3] countermask bit set for each counter index enabled. Enabling + * counters sets vth dacs to remembered values and disabling sets them to + * disabled values. Setting vth dacs explicitly overwrites them. */ void setCounterMask(uint32_t countermask, Positions pos = {}); Result getNumberOfGates(Positions pos = {}) const; @@ -1308,8 +1310,7 @@ class Detector { Result getMaster(Positions pos = {}) const; - - //TODO! check if we really want to expose this !!!!! + // TODO! check if we really want to expose this !!!!! Result getChipStatusRegister(Positions pos = {}) const; void setGainCaps(int caps, Positions pos = {}); diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index 183c94490..629bd4233 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -1867,7 +1867,8 @@ std::string CmdProxy::Counters(int action) { if (action == defs::HELP_ACTION) { os << "[i0] [i1] [i2]... \n\t[Mythen3] List of counters indices " "enabled. Each element in list can be 0 - 2 and must be non " - "repetitive." + "repetitive. Enabling counters sets vth dacs to remembered " + "values and disabling sets them to disabled values." << '\n'; } else if (action == defs::GET_ACTION) { if (!args.empty()) { @@ -1981,12 +1982,12 @@ std::string CmdProxy::GateDelay(int action) { return os.str(); } - -std::string CmdProxy::GainCaps(int action){ +std::string CmdProxy::GainCaps(int action) { std::ostringstream os; os << cmd << ' '; if (action == defs::HELP_ACTION) { - os << "[cap1, cap2, ...]\n\t[Mythen3] gain, options: C10pre, C15sh, C30sh, C50sh, C225ACsh, C15pre" + os << "[cap1, cap2, ...]\n\t[Mythen3] gain, options: C10pre, C15sh, " + "C30sh, C50sh, C225ACsh, C15pre" << '\n'; } else if (action == defs::GET_ACTION) { if (!args.empty()) @@ -1994,22 +1995,22 @@ std::string CmdProxy::GainCaps(int action){ auto tmp = det->getGainCaps(); sls::Result csr; - for (auto val : tmp){ + for (auto val : tmp) { if (val) csr.push_back(static_cast(val)); } - + os << OutString(csr) << '\n'; } else if (action == defs::PUT_ACTION) { if (args.size() < 1) { WrongNumberOfParameters(1); } int caps = 0; - for (const auto& arg:args){ + for (const auto &arg : args) { if (arg != "0") caps |= sls::StringTo(arg); } - + det->setGainCaps(caps); os << OutString(args) << '\n'; } else { diff --git a/slsDetectorSoftware/src/HelpDacs.h b/slsDetectorSoftware/src/HelpDacs.h index 71f2f9c4d..93d2af134 100644 --- a/slsDetectorSoftware/src/HelpDacs.h +++ b/slsDetectorSoftware/src/HelpDacs.h @@ -10,7 +10,8 @@ std::string GetHelpDac(std::string dac) { "[dac or mV value][(optional unit) mV] \n\t[Eiger][Mythen3] " "Detector threshold voltage for single photon counters.\n\t[Eiger] " "Sets vcmp_ll, vcmp_lr, vcmp_rl, vcmp_rr and vcp to the same " - "value. \n\t[Mythen3] Sets vth1, vth2 and vth3 to the same value."); + "value. \n\t[Mythen3] Sets vth1, vth2 and vth3 to the same value " + "for enabled counters."); } if (dac == "vsvp") { return std::string( @@ -134,17 +135,18 @@ std::string GetHelpDac(std::string dac) { if (dac == "vth1") { return std::string( "[dac or mV value][(optional unit) mV] \n\t[Mythen3] Dac for first " - "detector threshold voltage."); + "detector threshold voltage. Overwrites even if counter disabled."); } if (dac == "vth2") { return std::string( "[dac or mV value][(optional unit) mV] \n\t[Mythen3] Dac for " - "second detector threshold voltage."); + "second detector threshold voltage. Overwrites even if counter " + "disabled."); } if (dac == "vth3") { return std::string( "[dac or mV value][(optional unit) mV] \n\t[Mythen3] Dac for third " - "detector threshold voltage."); + "detector threshold voltage. Overwrites even if counter disabled."); } if (dac == "vcal_n") { return std::string(