Release of 5.1.0 (#237)

* Setting pattern from memory (#218)

* ToString accepts c-style arrays

* fixed patwait time bug in validation

* Introduced pattern class

* compile for servers too

* Python binding for Pattern

* added scanParameters in Python

* slsReceiver: avoid potential memory leak around Implementation::generalData

* additional constructors for scanPrameters in python

* bugfix: avoid potentital memory leak in receiver if called outside constructor context

* added scanParameters in Python

* additional constructors for scanPrameters in python

* M3defaultpattern (#227)

* default pattern for m3 and moench including Python bindings

* M3settings (#228)

* some changes to compile on RH7 and in the server to load the default chip status register at startup

* Updated mythen3DeectorServer_developer executable with correct initialization at startup

Co-authored-by: Erik Frojdh <erik.frojdh@gmail.com>
Co-authored-by: Anna Bergamaschi <anna.bergamaschi@psi.ch>

* Pattern.h as a public header files (#229)

* fixed buffer overflow but caused by using global instead of local enum

* replacing out of range trimbits with edge values

* replacing dac values that are out of range after interpolation

* updated pybind11 to 2.6.2

* Mythen3 improved synchronization (#231)

Disabling scans for multi module Mythen3, since there is no feedback of the detectors being ready
startDetector first starts the slaves then the master
acquire firs calls startDetector for the slaves then acquire on the master
getMaster to read back from hardware which one is master

* New server for JF to go with the new FW (#232)

* Modified Jungfrau speed settings for HW1.0 - FW fix version 1.1.1, compilation date 210218

* Corrected bug. DBIT clk phase is implemented in both HW version 1.0 and 2.0. Previous version did not update the DBIT phase shift on the configuration of a speed.

* fix for m3 scan with single module

* m3 fw version

* m3 server

* bugfix for bottom when setting quad

* new strategy for finding zmq based on cppzmq



Co-authored-by: Dhanya Thattil <dhanya.thattil@psi.ch>
Co-authored-by: Dhanya Thattil <33750417+thattil@users.noreply.github.com>
Co-authored-by: Alejandro Homs Puron <ahoms@esrf.fr>
Co-authored-by: Anna Bergamaschi <anna.bergamaschi@psi.ch>
Co-authored-by: Xiaoqiang Wang <xiaoqiangwang@gmail.com>
Co-authored-by: lopez_c <carlos.lopez-cuenca@psi.ch>
This commit is contained in:
Erik Fröjdh
2021-03-22 14:43:11 +01:00
committed by GitHub
parent 64de9f3ad0
commit 2f2fe4dd47
168 changed files with 3614 additions and 9057 deletions

View File

@ -1,4 +1,5 @@
#pragma once
#include "sls/Pattern.h"
#include "sls/Result.h"
#include "sls/network_utils.h"
#include "sls/sls_detector_defs.h"
@ -109,7 +110,7 @@ class Detector {
/** list of possible settings for this detector */
std::vector<defs::detectorSettings> getSettingsList() const;
/** [Jungfrau][Gotthard][Gotthard2] */
/** [Jungfrau][Gotthard][Gotthard2][Mythen3] */
Result<defs::detectorSettings> getSettings(Positions pos = {}) const;
/** [Jungfrau] DYNAMICGAIN, DYNAMICHG0, FIXGAIN1, FIXGAIN2,
@ -117,12 +118,34 @@ class Detector {
* LOWGAIN, MEDIUMGAIN, VERYHIGHGAIN \n [Gotthard2] DYNAMICGAIN,
* FIXGAIN1, FIXGAIN2 \n [Moench] G1_HIGHGAIN, G1_LOWGAIN,
* G2_HIGHCAP_HIGHGAIN, G2_HIGHCAP_LOWGAIN, G2_LOWCAP_HIGHGAIN,
* G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN \n [Eiger] Use threshold
* command. Settings loaded from file found in
* settingspath
* G2_LOWCAP_LOWGAIN, G4_HIGHGAIN, G4_LOWGAIN \n [Mythen3] STANDARD, FAST,
* HIGHGAIN. Also changes vrshaper and vrpreamp \n [Eiger] Use threshold
* command. Settings loaded from file found in settingspath
*/
void setSettings(defs::detectorSettings value, Positions pos = {});
/** [Eiger] */
Result<int> getThresholdEnergy(Positions pos = {}) const;
/** Mythen3] threshold energy for the three counters */
Result<std::array<int, 3>> getAllThresholdEnergy(Positions pos = {}) const;
/** [Eiger][Mythen3] It loads trim files from settingspath */
void setThresholdEnergy(int threshold_ev,
defs::detectorSettings settings = defs::STANDARD,
bool trimbits = true, Positions pos = {});
/** [Mythen3] It loads trim files from settingspath */
void setThresholdEnergy(std::array<int, 3> threshold_ev,
defs::detectorSettings settings = defs::STANDARD,
bool trimbits = true, Positions pos = {});
/** [Eiger][Mythen3] */
Result<std::string> getSettingsPath(Positions pos = {}) const;
/** [Eiger][Mythen3] Directory where settings files are loaded from/to */
void setSettingsPath(const std::string &value, Positions pos = {});
/** [Eiger][Mythen3] If no extension specified, serial number of each module
* is attached. */
void loadTrimbits(const std::string &fname, Positions pos = {});
@ -133,6 +156,13 @@ class Detector {
/**[Eiger][Mythen3] */
void setAllTrimbits(int value, Positions pos = {});
/**[Eiger][Mythen3] Returns energies in eV where the module is trimmed */
Result<std::vector<int>> getTrimEnergies(Positions pos = {}) const;
/** [Eiger][Mythen3] List of trim energies, where corresponding default trim
* files exist in corresponding trim folders */
void setTrimEnergies(std::vector<int> energies, Positions pos = {});
/**[Eiger][Jungfrau] */
bool getGapPixelsinCallback() const;
@ -939,20 +969,6 @@ class Detector {
/** [Eiger] in 32 bit mode */
void setSubDeadTime(ns value, Positions pos = {});
/** [Eiger] */
Result<int> getThresholdEnergy(Positions pos = {}) const;
/** [Eiger] It loads trim files from settingspath */
void setThresholdEnergy(int threshold_ev,
defs::detectorSettings settings = defs::STANDARD,
bool trimbits = true, Positions pos = {});
/** [Eiger] */
Result<std::string> getSettingsPath(Positions pos = {}) const;
/** [Eiger] Directory where settings files are loaded from/to */
void setSettingsPath(const std::string &value, Positions pos = {});
/** [Eiger] */
Result<bool> getOverFlowMode(Positions pos = {}) const;
@ -965,13 +981,6 @@ class Detector {
/** [Eiger] for client call back (gui) purposes to flip bottom image */
void setBottom(bool value, Positions pos = {});
/**[Eiger] Returns energies in eV where the module is trimmed */
Result<std::vector<int>> getTrimEnergies(Positions pos = {}) const;
/** [Eiger] List of trim energies, where corresponding default trim files
* exist in corresponding trim folders */
void setTrimEnergies(std::vector<int> energies, Positions pos = {});
/** [Eiger] deadtime in ns, 0 = disabled */
Result<ns> getRateCorrection(Positions pos = {}) const;
@ -1296,6 +1305,9 @@ class Detector {
/** [Mythen3] gate delay for all gates in auto or trigger timing mode
* (internal gating). Gate index: 0-2, -1 for all */
Result<std::array<ns, 3>> getGateDelayForAllGates(Positions pos = {}) const;
Result<bool> getMaster(Positions pos = {}) const;
///@{
/** @name CTB / Moench Specific */
@ -1457,10 +1469,17 @@ class Detector {
* (instead of executing line by line)*/
void setPattern(const std::string &fname, Positions pos = {});
/** [CTB][Moench][Mythen3] Loads pattern parameters structure directly to
* server */
void setPattern(const Pattern &pat, Positions pos = {});
/** [CTB][Moench][Mythen3] [Ctb][Moench][Mythen3] Saves pattern to file
* (ascii). \n [Ctb][Moench] Also executes pattern.*/
void savePattern(const std::string &fname);
/** [Mythen3][Moench] Loads and runs default pattern */
void loadDefaultPattern(Positions pos = {});
/** [CTB][Moench] */
Result<uint64_t> getPatternIOControl(Positions pos = {}) const;

View File

@ -0,0 +1,41 @@
#pragma once
#include "sls/sls_detector_defs.h"
#ifdef __cplusplus
#include <memory>
namespace sls {
#endif
// Common C/C++ structure to handle pattern data
typedef struct __attribute__((packed)) {
uint64_t word[MAX_PATTERN_LENGTH];
uint64_t ioctrl;
uint32_t limits[2];
// loop0 start, loop0 stop .. loop2 start, loop2 stop
uint32_t loop[6];
uint32_t nloop[3];
uint32_t wait[3];
uint64_t waittime[3];
} patternParameters;
#ifdef __cplusplus
class Pattern {
patternParameters *pat = new patternParameters{};
public:
Pattern();
~Pattern();
Pattern(const Pattern &other);
bool operator==(const Pattern &other) const;
bool operator!=(const Pattern &other) const;
patternParameters *data();
patternParameters *data() const;
size_t size() const noexcept { return sizeof(patternParameters); }
void validate() const;
void load(const std::string &fname);
void save(const std::string &fname);
std::string str() const;
};
} // namespace sls
#endif