Merge branch 'developer' of github.com:slsdetectorgroup/slsDetectorPackage into developer

This commit is contained in:
Erik Frojdh 2020-08-20 13:46:33 +02:00
commit bd6d212f99
4 changed files with 74 additions and 37 deletions

View File

@ -80,8 +80,8 @@ class Detector(CppDetectorApi):
Note 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 :getter: Not implemented
:setter: Loads config file :setter: Loads config file
@ -809,6 +809,13 @@ class Detector(CppDetectorApi):
@property @property
@element @element
def auto_comp_disable(self): 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() return self.getAutoCompDisable()
@auto_comp_disable.setter @auto_comp_disable.setter
@ -916,7 +923,16 @@ class Detector(CppDetectorApi):
@property @property
def counters(self): 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 = self.getCounterMask()
mask = element_if_equal(mask) mask = element_if_equal(mask)
@ -951,6 +967,7 @@ class Detector(CppDetectorApi):
@property @property
def asamples(self): def asamples(self):
"""[Ctb][Moench] Number of analog samples expected. """
return element_if_equal(self.getNumberOfAnalogSamples()) return element_if_equal(self.getNumberOfAnalogSamples())
@asamples.setter @asamples.setter
@ -967,6 +984,12 @@ class Detector(CppDetectorApi):
@property @property
def dbitphase(self): 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()) return element_if_equal(self.getDBITPhase())
@dbitphase.setter @dbitphase.setter
@ -975,6 +998,7 @@ class Detector(CppDetectorApi):
@property @property
def dbitclk(self): def dbitclk(self):
"""[Ctb] Clock for latching the digital bits in MHz."""
return element_if_equal(self.getDBITClock()) return element_if_equal(self.getDBITClock())
@dbitclk.setter @dbitclk.setter
@ -983,6 +1007,7 @@ class Detector(CppDetectorApi):
@property @property
def dbitpipeline(self): def dbitpipeline(self):
""" [Ctb] Pipeline of the clock for latching digital bits. """
return element_if_equal(self.getDBITPipeline()) return element_if_equal(self.getDBITPipeline())
@dbitpipeline.setter @dbitpipeline.setter
@ -1019,9 +1044,9 @@ class Detector(CppDetectorApi):
Note Note
----- -----
| [Jungfrau] Absolute phase shift. Changing Speed also resets adcphase to recommended defaults. [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. [Ctb][Moench] Absolute phase shift. Changing adcclk also resets adcphase and sets it to previous values.\n
| [Gotthard] Relative phase shift. [Gotthard] Relative phase shift.
:getter: Not implemented for Gotthard :getter: Not implemented for Gotthard
""" """
@ -1033,8 +1058,7 @@ class Detector(CppDetectorApi):
@property @property
def adcpipeline(self): def adcpipeline(self):
"""[Ctb][Moench] Sets pipeline for ADC clock. """[Ctb][Moench] Sets pipeline for ADC clock. """
"""
return element_if_equal(self.getADCPipeline()) return element_if_equal(self.getADCPipeline())
@adcpipeline.setter @adcpipeline.setter
@ -1043,8 +1067,7 @@ class Detector(CppDetectorApi):
@property @property
def adcclk(self): 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()) return element_if_equal(self.getADCClock())
@adcclk.setter @adcclk.setter

View File

@ -46,8 +46,11 @@ class Detector {
* belonging to it */ * belonging to it */
void freeSharedMemory(); void freeSharedMemory();
/** Frees shared memory before loading configuration file. Set up once
* normally */
void loadConfig(const std::string &fname); void loadConfig(const std::string &fname);
/** Shared memory not freed prior. Set up per measurement. */
void loadParameters(const std::string &fname); void loadParameters(const std::string &fname);
Result<std::string> getHostname(Positions pos = {}) const; Result<std::string> getHostname(Positions pos = {}) const;
@ -256,13 +259,21 @@ class Detector {
/** [Gotthard][Jungfrau][CTB][Moench] */ /** [Gotthard][Jungfrau][CTB][Moench] */
Result<int> getADCPhaseInDegrees(Positions pos = {}) const; Result<int> 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 = {}); void setADCPhaseInDegrees(int value, Positions pos = {});
/** [CTB][Jungfrau] */ /** [CTB][Jungfrau] */
Result<int> getDBITPhase(Positions pos = {}) const; Result<int> 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 = {}); void setDBITPhase(int value, Positions pos = {});
/** [CTB][Jungfrau] */ /** [CTB][Jungfrau] */
@ -271,7 +282,9 @@ class Detector {
/** [CTB][Jungfrau] */ /** [CTB][Jungfrau] */
Result<int> getDBITPhaseInDegrees(Positions pos = {}) const; Result<int> 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 = {}); void setDBITPhaseInDegrees(int value, Positions pos = {});
/** [Mythen3][Gotthard2] Hz */ /** [Mythen3][Gotthard2] Hz */
@ -925,7 +938,10 @@ class Detector {
* //TODO naming * //TODO naming
* By default, the on-chip gain switching is active during the entire * By default, the on-chip gain switching is active during the entire
* exposure. This mode disables the on-chip gain switching comparator * 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 = {}); void setAutoCompDisable(bool value, Positions pos = {});
@ -1075,7 +1091,7 @@ class Detector {
/** [Mythen3] */ /** [Mythen3] */
Result<uint32_t> getCounterMask(Positions pos = {}) const; Result<uint32_t> 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 = {}); void setCounterMask(uint32_t countermask, Positions pos = {});
Result<int> getNumberOfGates(Positions pos = {}) const; Result<int> getNumberOfGates(Positions pos = {}) const;

View File

@ -564,14 +564,12 @@ std::string CmdProxy::Adcphase(int action) {
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[n_value] " os << "[n_value] "
"[(optional)deg]\n\t[Jungfrau][Ctb][Moench][Gotthard] " "[(optional)deg]\n\t[Jungfrau][Ctb][Moench][Gotthard] "
"Phase " "Phase shift of ADC clock. \n\t[Jungfrau] Absolute phase shift. "
"shift of ADC clock. \n\t[Jungfrau] Absolute phase shift. If deg " "If deg used, then shift in degrees. Changing Speed also resets "
"used, then shift in degrees. Changing Speed also resets "
"adcphase to recommended defaults.\n\t[Ctb][Moench] Absolute " "adcphase to recommended defaults.\n\t[Ctb][Moench] Absolute "
"phase " "phase shift. If deg used, then shift in degrees. Changing "
"shift. If deg used, then shift in degrees. Changing adcclk also " "adcclk also resets adcphase and sets it to previous "
"resets adcphase and sets it to previous values.\n\t[Gotthard] " "values.\n\t[Gotthard] Relative phase shift. Cannot get"
"Relative phase shift. Cannot get"
<< '\n'; << '\n';
} else { } else {
auto det_type = det->getDetectorType().squash(defs::GENERIC); auto det_type = det->getDetectorType().squash(defs::GENERIC);
@ -622,11 +620,9 @@ std::string CmdProxy::Dbitphase(int action) {
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[n_value] [(optional)deg]\n\t[Ctb][Jungfrau] Phase shift of " os << "[n_value] [(optional)deg]\n\t[Ctb][Jungfrau] Phase shift of "
"clock to " "clock to latch digital bits. Absolute phase shift. If deg used, "
"latch digital bits. Absolute phase shift. If deg used, then " "then shift in degrees. \n\t[Ctb]Changing dbitclk also resets "
"shift in degrees. \n\t[Ctb]Changing dbitclk also resets " "dbitphase and sets to previous values."
"dbitphase and "
"sets to previous values."
<< '\n'; << '\n';
} else { } else {
auto det_type = det->getDetectorType().squash(defs::GENERIC); auto det_type = det->getDetectorType().squash(defs::GENERIC);
@ -1764,8 +1760,9 @@ std::string CmdProxy::Counters(int action) {
std::ostringstream os; std::ostringstream os;
os << cmd << ' '; os << cmd << ' ';
if (action == defs::HELP_ACTION) { if (action == defs::HELP_ACTION) {
os << "[i0] [i1] [i2]... \n\t[Mythen3] List of counters enabled. Each " os << "[i0] [i1] [i2]... \n\t[Mythen3] List of counters indices "
"element in list can be 0 - 2 and must be non repetitive." "enabled. Each element in list can be 0 - 2 and must be non "
"repetitive."
<< '\n'; << '\n';
} else if (action == defs::GET_ACTION) { } else if (action == defs::GET_ACTION) {
if (!args.empty()) { if (!args.empty()) {

View File

@ -1103,7 +1103,7 @@ class CmdProxy {
/* configuration */ /* configuration */
EXECUTE_SET_COMMAND_NOID_1ARG( EXECUTE_SET_COMMAND_NOID_1ARG(
config, loadConfig, config, loadConfig,
"[fname]\n\tConfigures detector to configuration contained in fname. " "[fname]\n\tFrees shared memory before loading configuration file. "
"Set up once."); "Set up once.");
EXECUTE_SET_COMMAND_NOID_1ARG( EXECUTE_SET_COMMAND_NOID_1ARG(
@ -1953,11 +1953,12 @@ class CmdProxy {
INTEGER_COMMAND( INTEGER_COMMAND(
auto_comp_disable, getAutoCompDisable, setAutoCompDisable, auto_comp_disable, getAutoCompDisable, setAutoCompDisable,
StringTo<int>, StringTo<int>,
"[0, 1]\n\t[Jungfrau] Auto comparator disable mode. Default 0 or this " "[0, 1]\n\t[Jungfrau] Auto comparator disable mode. By default, the "
"mode disabled(comparator enabled throughout). 1 enables mode. 0 " "on-chip gain switching is active during the entire exposure.This mode "
"disables mode. This mode disables the on-chip gain switching " "disables the on - chip gain switching comparator automatically after "
"comparator automatically after 93.75% of exposure time (only for " "93.75% of exposure time (only for longer than 100us). \n\tDefault is "
"longer than 100us)."); "0 or this mode disabled(comparator enabled throughout). 1 enables "
"mode. 0 disables mode. ");
INTEGER_COMMAND_NOID( INTEGER_COMMAND_NOID(
storagecells, getNumberOfAdditionalStorageCells, storagecells, getNumberOfAdditionalStorageCells,
@ -2028,7 +2029,7 @@ class CmdProxy {
INTEGER_COMMAND( INTEGER_COMMAND(
asamples, getNumberOfAnalogSamples, setNumberOfAnalogSamples, asamples, getNumberOfAnalogSamples, setNumberOfAnalogSamples,
StringTo<int>, StringTo<int>,
"[0, 1]\n\t[CTB][Moench] Number of analog samples expected."); "[n_samples]\n\t[CTB][Moench] Number of analog samples expected.");
INTEGER_COMMAND( INTEGER_COMMAND(
adcclk, getADCClock, setADCClock, StringTo<int>, adcclk, getADCClock, setADCClock, StringTo<int>,
@ -2064,7 +2065,7 @@ class CmdProxy {
INTEGER_COMMAND(dsamples, getNumberOfDigitalSamples, INTEGER_COMMAND(dsamples, getNumberOfDigitalSamples,
setNumberOfDigitalSamples, StringTo<int>, setNumberOfDigitalSamples, StringTo<int>,
"[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, INTEGER_COMMAND(romode, getReadoutMode, setReadoutMode,
sls::StringTo<slsDetectorDefs::readoutMode>, sls::StringTo<slsDetectorDefs::readoutMode>,