From 27c1916d636d3c18906ab4a26372e5e94109f067 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Wed, 26 Aug 2020 17:45:12 +0200 Subject: [PATCH] WIP, doc --- python/slsdet/detector.py | 34 +++++++++++++++++++++----- slsDetectorSoftware/include/Detector.h | 8 +++--- slsDetectorSoftware/src/CmdProxy.cpp | 7 +++--- 3 files changed, 37 insertions(+), 12 deletions(-) diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index ad9ad022e..c87baefd9 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -777,6 +777,14 @@ class Detector(CppDetectorApi): @property def reg(self): + """ + Reads/writes to a 32 bit register. + + Note + ----- + Advanced user Function! \n + [Eiger] Address is +0x100 for only left, +0x200 for only right. + """ return self._register @property @@ -834,14 +842,18 @@ class Detector(CppDetectorApi): ----- To set default rate correction, use setDefaultRateCorrection + Known Issue + ------------ + :getter: Always give 0 due to the microseconds precision. + :setter: Use scientific notation to set custom rate correction, since timedelta resolution is 1 microseconds. \n + Or use setDefaultRateCorrection to set the default one from trimbit file + + Examples ----------- - >>> d.ratecorr = 1.05 - >>> d.period = datetime.timedelta(minutes = 3, seconds = 1.23) - >>> d.period - 181.23 - >>> d.getPeriod() - [datetime.timedelta(seconds=181, microseconds=230000)] + >>> d.ratecorr = 10e-9 + >>> d.setDefaultRateCorrection() + >>> d.ratecorr = 0.0 """ return reduce_time(self.getRateCorrection()) @@ -1181,6 +1193,7 @@ class Detector(CppDetectorApi): @property def runclk(self): + """[Ctb][Moench] Run clock in MHz.""" return element_if_equal(self.getRUNClock()) @runclk.setter @@ -1189,6 +1202,15 @@ class Detector(CppDetectorApi): @property def romode(self): + """ + [CTB] Readout mode. Default is analog. Options: ANALOG_ONLY, DIGITAL_ONLY, ANALOG_AND_DIGITAL + + Examples + -------- + >>> d.romode = slsdet.readoutMode.ANALOG_ONLY + >>> d.romode + readoutMode.ANALOG_ONLY + """ return element_if_equal(self.getReadoutMode()) @romode.setter diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index 00ee0cce7..8374b29cf 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -1206,7 +1206,7 @@ class Detector { /** [CTB] */ Result getReadoutMode(Positions pos = {}) const; - /** [CTB] Options: ANALOG_ONLY = 0, DIGITAL_ONLY = 1, ANALOG_AND_DIGITAL */ + /** [CTB] Options: ANALOG_ONLY, DIGITAL_ONLY, ANALOG_AND_DIGITAL */ void setReadoutMode(defs::readoutMode value, Positions pos = {}); /** [CTB] */ @@ -1444,10 +1444,12 @@ class Detector { const std::string &hostname, const std::string &fname, Positions pos = {}); - /** Advanced user Function! */ + /** Advanced user Function! \n + * [Eiger] Address is +0x100 for only left, +0x200 for only right. */ Result readRegister(uint32_t addr, Positions pos = {}) const; - /** Advanced user Function! */ + /** Advanced user Function! \n + * [Eiger] Address is +0x100 for only left, +0x200 for only right. */ void writeRegister(uint32_t addr, uint32_t val, Positions pos = {}); /** Advanced user Function! */ diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index 15d0c70b4..7c020f720 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -1312,8 +1312,8 @@ std::string CmdProxy::RateCorrection(int action) { os << cmd << ' '; if (action == defs::HELP_ACTION) { os << "[n_rate (in ns)]\n\t[Eiger] Dead time correction constant in " - "ns. -1 will set to default tau of settings. 0 will unset rate " - "correction." + "ns. -1 will set to default tau of settings from trimbit file. 0 " + "will unset rate correction." << '\n'; } else if (action == defs::GET_ACTION) { if (!args.empty()) { @@ -2509,7 +2509,8 @@ std::string CmdProxy::Register(int action) { os << cmd << ' '; if (action == defs::HELP_ACTION) { os << "[address] [32 bit value]\n\tReads/writes to a 32 bit register " - "in hex.\n\t[Eiger] +0x100 for only left, +0x200 for only right" + "in hex. Advanced Function!\n\t[Eiger] +0x100 for only left, " + "+0x200 for only right." << '\n'; } else if (action == defs::GET_ACTION) { if (args.size() != 1) {