mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 13:27:14 +02:00
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:
@ -100,6 +100,12 @@ template <typename T, size_t Capacity> class StaticVector {
|
||||
constexpr const T &front() const noexcept { return data_.front(); }
|
||||
constexpr const T &back() const noexcept { return data_[current_size - 1]; }
|
||||
|
||||
bool anyEqualTo(const T value) {
|
||||
return std::any_of(
|
||||
data_.cbegin(), data_.cend(),
|
||||
[value](const T &element) { return element == value; });
|
||||
}
|
||||
|
||||
// iterators
|
||||
iterator begin() noexcept { return data_.begin(); }
|
||||
// auto begin() noexcept -> decltype(data_.begin()) { return data_.begin();
|
||||
|
@ -44,9 +44,6 @@ std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::ROI &roi);
|
||||
std::string ToString(const slsDetectorDefs::rxParameters &r);
|
||||
std::ostream &operator<<(std::ostream &os,
|
||||
const slsDetectorDefs::rxParameters &r);
|
||||
std::string ToString(const slsDetectorDefs::patternParameters &r);
|
||||
std::ostream &operator<<(std::ostream &os,
|
||||
const slsDetectorDefs::patternParameters &r);
|
||||
std::string ToString(const slsDetectorDefs::scanParameters &r);
|
||||
std::ostream &operator<<(std::ostream &os,
|
||||
const slsDetectorDefs::scanParameters &r);
|
||||
@ -181,6 +178,22 @@ std::string ToString(const std::map<KeyType, ValueType> &m) {
|
||||
return os.str();
|
||||
}
|
||||
|
||||
/**
|
||||
* Print a c style array
|
||||
*/
|
||||
template <typename T, size_t size> std::string ToString(const T (&arr)[size]) {
|
||||
std::ostringstream os;
|
||||
os << '[';
|
||||
if (size) {
|
||||
size_t i = 0;
|
||||
os << ToString(arr[i++]);
|
||||
for (; i < size; ++i)
|
||||
os << ", " << ToString(arr[i]);
|
||||
}
|
||||
os << ']';
|
||||
return os.str();
|
||||
}
|
||||
|
||||
/**
|
||||
* For a container loop over all elements and call ToString on the element
|
||||
* Container<std::string> is excluded
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include <bitset>
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#else
|
||||
// C includes
|
||||
@ -453,7 +454,7 @@ typedef struct {
|
||||
int activate{0};
|
||||
int quad{0};
|
||||
int numLinesReadout{0};
|
||||
int thresholdEnergyeV{0};
|
||||
int thresholdEnergyeV[3]{0, 0, 0};
|
||||
int dynamicRange{16};
|
||||
timingMode timMode{AUTO_TIMING};
|
||||
int tenGiga{0};
|
||||
@ -472,18 +473,6 @@ typedef struct {
|
||||
int gates{0};
|
||||
scanParameters scanParams{};
|
||||
} __attribute__((packed));
|
||||
|
||||
/** pattern structure */
|
||||
struct patternParameters {
|
||||
uint64_t word[MAX_PATTERN_LENGTH]{};
|
||||
uint64_t patioctrl{0};
|
||||
uint32_t patlimits[2]{};
|
||||
uint32_t patloop[6]{};
|
||||
uint32_t patnloop[3]{};
|
||||
uint32_t patwait[3]{};
|
||||
uint64_t patwaittime[3]{};
|
||||
} __attribute__((packed));
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
@ -582,14 +571,14 @@ typedef struct {
|
||||
int reg; /**< is the module register settings (gain level) */
|
||||
int iodelay; /**< iodelay */
|
||||
int tau; /**< tau */
|
||||
int eV; /**< threshold energy */
|
||||
int eV[3]; /**< threshold energy */
|
||||
int *dacs; /**< is the pointer to the array of the dac values (in V) */
|
||||
int *chanregs; /**< is the pointer to the array of the channel registers */
|
||||
|
||||
#ifdef __cplusplus
|
||||
sls_detector_module()
|
||||
: serialnumber(0), nchan(0), nchip(0), ndac(0), reg(-1), iodelay(0),
|
||||
tau(0), eV(-1), dacs(nullptr), chanregs(nullptr) {}
|
||||
tau(0), eV{-1, -1, -1}, dacs(nullptr), chanregs(nullptr) {}
|
||||
|
||||
explicit sls_detector_module(slsDetectorDefs::detectorType type)
|
||||
: sls_detector_module() {
|
||||
@ -618,7 +607,7 @@ typedef struct {
|
||||
reg = other.reg;
|
||||
iodelay = other.iodelay;
|
||||
tau = other.tau;
|
||||
eV = other.eV;
|
||||
std::copy(other.eV, other.eV + 3, eV);
|
||||
dacs = new int[ndac];
|
||||
std::copy(other.dacs, other.dacs + ndac, dacs);
|
||||
chanregs = new int[nchan];
|
||||
|
@ -217,6 +217,10 @@ enum detFuncs {
|
||||
F_START_READOUT,
|
||||
F_SET_DEFAULT_DACS,
|
||||
F_IS_VIRTUAL,
|
||||
F_GET_PATTERN,
|
||||
F_LOAD_DEFAULT_PATTERN,
|
||||
F_GET_ALL_THRESHOLD_ENERGY,
|
||||
F_GET_MASTER,
|
||||
|
||||
NUM_DET_FUNCTIONS,
|
||||
RECEIVER_ENUM_START = 256, /**< detector function should not exceed this
|
||||
@ -320,6 +324,7 @@ enum detFuncs {
|
||||
F_RECEIVER_SET_THRESHOLD,
|
||||
F_GET_RECEIVER_STREAMING_HWM,
|
||||
F_SET_RECEIVER_STREAMING_HWM,
|
||||
F_RECEIVER_SET_ALL_THRESHOLD,
|
||||
|
||||
NUM_REC_FUNCTIONS
|
||||
};
|
||||
@ -539,7 +544,11 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
case F_START_READOUT: return "F_START_READOUT";
|
||||
case F_SET_DEFAULT_DACS: return "F_SET_DEFAULT_DACS";
|
||||
case F_IS_VIRTUAL: return "F_IS_VIRTUAL";
|
||||
|
||||
case F_GET_PATTERN: return "F_GET_PATTERN";
|
||||
case F_LOAD_DEFAULT_PATTERN: return "F_LOAD_DEFAULT_PATTERN";
|
||||
case F_GET_ALL_THRESHOLD_ENERGY: return "F_GET_ALL_THRESHOLD_ENERGY";
|
||||
case F_GET_MASTER: return "F_GET_MASTER";
|
||||
|
||||
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
|
||||
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
|
||||
|
||||
@ -641,6 +650,7 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
case F_RECEIVER_SET_THRESHOLD: return "F_RECEIVER_SET_THRESHOLD";
|
||||
case F_GET_RECEIVER_STREAMING_HWM: return "F_GET_RECEIVER_STREAMING_HWM";
|
||||
case F_SET_RECEIVER_STREAMING_HWM: return "F_SET_RECEIVER_STREAMING_HWM";
|
||||
case F_RECEIVER_SET_ALL_THRESHOLD: return "F_RECEIVER_SET_ALL_THRESHOLD";
|
||||
|
||||
|
||||
case NUM_REC_FUNCTIONS: return "NUM_REC_FUNCTIONS";
|
||||
|
@ -1,12 +1,12 @@
|
||||
/** API versions */
|
||||
#define GITBRANCH "5.0.1"
|
||||
#define APICTB 0x201117
|
||||
#define APIGOTTHARD 0x201117
|
||||
#define APIGOTTHARD2 0x201117
|
||||
#define APIJUNGFRAU 0x201117
|
||||
#define APIMYTHEN3 0x201117
|
||||
#define APIMOENCH 0x201117
|
||||
#define APIEIGER 0x201117
|
||||
#define APILIB 0x201125
|
||||
#define APIRECEIVER 0x201125
|
||||
#define APIGUI 0x201125
|
||||
#define GITBRANCH "5.1.0"
|
||||
#define APICTB 0x210225
|
||||
#define APIGOTTHARD 0x210225
|
||||
#define APIGOTTHARD2 0x210225
|
||||
#define APIJUNGFRAU 0x210225
|
||||
#define APIMOENCH 0x210225
|
||||
#define APIEIGER 0x210225
|
||||
#define APIMYTHEN3 0x210225
|
||||
#define APILIB 0x210225
|
||||
#define APIRECEIVER 0x210225
|
||||
#define APIGUI 0x210225
|
||||
|
Reference in New Issue
Block a user