From 429eb8da53a5fc175929ebe561203a6698296706 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Thu, 20 Aug 2020 12:58:17 +0200 Subject: [PATCH] doc wip --- python/slsdet/detector.py | 43 ++++++++++++++++++++------ slsDetectorSoftware/include/Detector.h | 26 +++++++++++++--- slsDetectorSoftware/src/CmdProxy.cpp | 25 +++++++-------- slsDetectorSoftware/src/CmdProxy.h | 17 +++++----- 4 files changed, 74 insertions(+), 37 deletions(-) diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 6de311d10..78e6a418a 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -80,8 +80,8 @@ class Detector(CppDetectorApi): Note ----- - Frees shared memory before loading configuration file. This function does not support ~ for home. - + Frees shared memory before loading configuration file. + Set up once. :getter: Not implemented :setter: Loads config file @@ -809,6 +809,13 @@ class Detector(CppDetectorApi): @property @element def auto_comp_disable(self): + """[Jungfrau] Enable or disable auto comparator disable mode. + + 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).\n + Default is 0 or this mode disabled (comparator enabled throughout). 1 enables mode. 0 disables mode. + """ return self.getAutoCompDisable() @auto_comp_disable.setter @@ -916,7 +923,16 @@ class Detector(CppDetectorApi): @property def counters(self): """ - [Mythen3] List of counters enabled. Each element in list can be 0 - 2 and must be non repetitive. + [Mythen3] List of counter indices enabled. + + Note + ----- + Each element in list can be 0 - 2 and must be non repetitive. + + Examples + ----------- + >>> d.counters = [0, 1] + """ mask = self.getCounterMask() mask = element_if_equal(mask) @@ -951,6 +967,7 @@ class Detector(CppDetectorApi): @property def asamples(self): + """[Ctb][Moench] Number of analog samples expected. """ return element_if_equal(self.getNumberOfAnalogSamples()) @asamples.setter @@ -967,6 +984,12 @@ class Detector(CppDetectorApi): @property def dbitphase(self): + """[Ctb][Jungfrau] Phase shift of clock to latch digital bits. Absolute phase shift. + + Note + ----- + [Ctb]Changing dbitclk also resets dbitphase and sets to previous values. + """ return element_if_equal(self.getDBITPhase()) @dbitphase.setter @@ -975,6 +998,7 @@ class Detector(CppDetectorApi): @property def dbitclk(self): + """[Ctb] Clock for latching the digital bits in MHz.""" return element_if_equal(self.getDBITClock()) @dbitclk.setter @@ -983,6 +1007,7 @@ class Detector(CppDetectorApi): @property def dbitpipeline(self): + """ [Ctb] Pipeline of the clock for latching digital bits. """ return element_if_equal(self.getDBITPipeline()) @dbitpipeline.setter @@ -1019,9 +1044,9 @@ class Detector(CppDetectorApi): Note ----- - | [Jungfrau] Absolute phase shift. Changing Speed also resets adcphase to recommended defaults. - | [Ctb][Moench] Absolute phase shift. Changing adcclk also resets adcphase and sets it to previous values. - | [Gotthard] Relative phase shift. + [Jungfrau] Absolute phase shift. Changing Speed also resets adcphase to recommended defaults.\n + [Ctb][Moench] Absolute phase shift. Changing adcclk also resets adcphase and sets it to previous values.\n + [Gotthard] Relative phase shift. :getter: Not implemented for Gotthard """ @@ -1033,8 +1058,7 @@ class Detector(CppDetectorApi): @property def adcpipeline(self): - """[Ctb][Moench] Sets pipeline for ADC clock. - """ + """[Ctb][Moench] Sets pipeline for ADC clock. """ return element_if_equal(self.getADCPipeline()) @adcpipeline.setter @@ -1043,8 +1067,7 @@ class Detector(CppDetectorApi): @property def adcclk(self): - """[Ctb][Moench] Sets ADC clock frequency in MHz. - """ + """[Ctb][Moench] Sets ADC clock frequency in MHz. """ return element_if_equal(self.getADCClock()) @adcclk.setter diff --git a/slsDetectorSoftware/include/Detector.h b/slsDetectorSoftware/include/Detector.h index 4cb4601be..e3dbc06f9 100644 --- a/slsDetectorSoftware/include/Detector.h +++ b/slsDetectorSoftware/include/Detector.h @@ -46,8 +46,11 @@ class Detector { * belonging to it */ void freeSharedMemory(); + /** Frees shared memory before loading configuration file. Set up once + * normally */ void loadConfig(const std::string &fname); + /** Shared memory not freed prior. Set up per measurement. */ void loadParameters(const std::string &fname); Result getHostname(Positions pos = {}) const; @@ -256,13 +259,21 @@ class Detector { /** [Gotthard][Jungfrau][CTB][Moench] */ Result getADCPhaseInDegrees(Positions pos = {}) const; - /** [Gotthard][Jungfrau][CTB][Moench] */ + /** [Gotthard][Jungfrau][CTB][Moench] + * [Jungfrau] Absolute phase shift. Changing Speed also resets adcphase to + * recommended defaults. \n + * [Ctb][Moench] Absolute phase shift. Changing adcclk also resets adcphase + * and sets it to previous values. \n + * [Gotthard] Relative phase shift + */ void setADCPhaseInDegrees(int value, Positions pos = {}); /** [CTB][Jungfrau] */ Result getDBITPhase(Positions pos = {}) const; - /** [CTB][Jungfrau] */ + /** [CTB][Jungfrau] Absolute phase shift \n + * [CTB] changing dbitclk also resets dbitphase and sets to previous values. + */ void setDBITPhase(int value, Positions pos = {}); /** [CTB][Jungfrau] */ @@ -271,7 +282,9 @@ class Detector { /** [CTB][Jungfrau] */ Result getDBITPhaseInDegrees(Positions pos = {}) const; - /** [CTB][Jungfrau] */ + /** [CTB][Jungfrau] Absolute phase shift \n + * [CTB] changing dbitclk also resets dbitphase and sets to previous values. + */ void setDBITPhaseInDegrees(int value, Positions pos = {}); /** [Mythen3][Gotthard2] Hz */ @@ -925,7 +938,10 @@ 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). + * automatically after 93.75% of exposure time (only for longer than + * 100us).\n + * Default is false or this mode disabled(comparator enabled throughout). + * true enables " "mode. 0 disables mode. */ void setAutoCompDisable(bool value, Positions pos = {}); @@ -1075,7 +1091,7 @@ class Detector { /** [Mythen3] */ Result getCounterMask(Positions pos = {}) const; - /** [Mythen3] countermask bit set for each counter enabled */ + /** [Mythen3] countermask bit set for each counter index enabled */ void setCounterMask(uint32_t countermask, Positions pos = {}); Result getNumberOfGates(Positions pos = {}) const; diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index a0edc608f..dfbfd934f 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -564,14 +564,12 @@ std::string CmdProxy::Adcphase(int action) { if (action == defs::HELP_ACTION) { os << "[n_value] " "[(optional)deg]\n\t[Jungfrau][Ctb][Moench][Gotthard] " - "Phase " - "shift of ADC clock. \n\t[Jungfrau] Absolute phase shift. If deg " - "used, then shift in degrees. Changing Speed also resets " + "Phase shift of ADC clock. \n\t[Jungfrau] Absolute phase shift. " + "If deg used, then shift in degrees. Changing Speed also resets " "adcphase to recommended defaults.\n\t[Ctb][Moench] Absolute " - "phase " - "shift. If deg used, then shift in degrees. Changing adcclk also " - "resets adcphase and sets it to previous values.\n\t[Gotthard] " - "Relative phase shift. Cannot get" + "phase shift. If deg used, then shift in degrees. Changing " + "adcclk also resets adcphase and sets it to previous " + "values.\n\t[Gotthard] Relative phase shift. Cannot get" << '\n'; } else { auto det_type = det->getDetectorType().squash(defs::GENERIC); @@ -622,11 +620,9 @@ std::string CmdProxy::Dbitphase(int action) { os << cmd << ' '; if (action == defs::HELP_ACTION) { os << "[n_value] [(optional)deg]\n\t[Ctb][Jungfrau] Phase shift of " - "clock to " - "latch digital bits. Absolute phase shift. If deg used, then " - "shift in degrees. \n\t[Ctb]Changing dbitclk also resets " - "dbitphase and " - "sets to previous values." + "clock to latch digital bits. Absolute phase shift. If deg used, " + "then shift in degrees. \n\t[Ctb]Changing dbitclk also resets " + "dbitphase and sets to previous values." << '\n'; } else { auto det_type = det->getDetectorType().squash(defs::GENERIC); @@ -1764,8 +1760,9 @@ std::string CmdProxy::Counters(int action) { std::ostringstream os; os << cmd << ' '; if (action == defs::HELP_ACTION) { - os << "[i0] [i1] [i2]... \n\t[Mythen3] List of counters enabled. Each " - "element in list can be 0 - 2 and must be non repetitive." + 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." << '\n'; } else if (action == defs::GET_ACTION) { if (!args.empty()) { diff --git a/slsDetectorSoftware/src/CmdProxy.h b/slsDetectorSoftware/src/CmdProxy.h index dba9bbb41..c2641bc40 100644 --- a/slsDetectorSoftware/src/CmdProxy.h +++ b/slsDetectorSoftware/src/CmdProxy.h @@ -1103,7 +1103,7 @@ class CmdProxy { /* configuration */ EXECUTE_SET_COMMAND_NOID_1ARG( config, loadConfig, - "[fname]\n\tConfigures detector to configuration contained in fname. " + "[fname]\n\tFrees shared memory before loading configuration file. " "Set up once."); EXECUTE_SET_COMMAND_NOID_1ARG( @@ -1953,11 +1953,12 @@ class CmdProxy { INTEGER_COMMAND( auto_comp_disable, getAutoCompDisable, setAutoCompDisable, StringTo, - "[0, 1]\n\t[Jungfrau] Auto comparator disable mode. Default 0 or this " - "mode disabled(comparator enabled throughout). 1 enables mode. 0 " - "disables mode. This mode disables the on-chip gain switching " - "comparator automatically after 93.75% of exposure time (only for " - "longer than 100us)."); + "[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% of exposure time (only for longer than 100us). \n\tDefault is " + "0 or this mode disabled(comparator enabled throughout). 1 enables " + "mode. 0 disables mode. "); INTEGER_COMMAND_NOID( storagecells, getNumberOfAdditionalStorageCells, @@ -2028,7 +2029,7 @@ class CmdProxy { INTEGER_COMMAND( asamples, getNumberOfAnalogSamples, setNumberOfAnalogSamples, StringTo, - "[0, 1]\n\t[CTB][Moench] Number of analog samples expected."); + "[n_samples]\n\t[CTB][Moench] Number of analog samples expected."); INTEGER_COMMAND( adcclk, getADCClock, setADCClock, StringTo, @@ -2064,7 +2065,7 @@ class CmdProxy { INTEGER_COMMAND(dsamples, getNumberOfDigitalSamples, setNumberOfDigitalSamples, StringTo, - "[0, 1]\n\t[CTB] Number of digital samples expected."); + "[n_value]\n\t[CTB] Number of digital samples expected."); INTEGER_COMMAND(romode, getReadoutMode, setReadoutMode, sls::StringTo,