mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 01:58:00 +02:00
merge from developer (mythen3 branch)
This commit is contained in:
@ -12,6 +12,7 @@
|
||||
#include "sls_detector_defs.h"
|
||||
#include "sls_detector_exceptions.h"
|
||||
#include "string_utils.h"
|
||||
#include <array>
|
||||
#include <chrono>
|
||||
#include <iomanip>
|
||||
#include <map>
|
||||
@ -38,9 +39,6 @@ std::string ToString(const defs::timingSourceType s);
|
||||
|
||||
std::string ToString(const slsDetectorDefs::ROI &roi);
|
||||
std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::ROI &roi);
|
||||
|
||||
|
||||
|
||||
const std::string &ToString(const std::string &s);
|
||||
|
||||
/** Convert std::chrono::duration with specified output unit */
|
||||
|
@ -207,29 +207,10 @@ typedef struct {
|
||||
use of the external signals
|
||||
*/
|
||||
enum externalSignalFlag {
|
||||
GET_EXTERNAL_SIGNAL_FLAG = -1, /**<return flag for signal */
|
||||
SIGNAL_OFF, /**<signal unused - tristate*/
|
||||
GATE_IN_ACTIVE_HIGH, /**<input gate active high*/
|
||||
GATE_IN_ACTIVE_LOW, /**<input gate active low */
|
||||
TRIGGER_IN_RISING_EDGE, /**<input exposure trigger on rising edge */
|
||||
TRIGGER_IN_FALLING_EDGE, /**<input exposure trigger on falling edge */
|
||||
RO_TRIGGER_IN_RISING_EDGE, /**<input raedout trigger on rising edge */
|
||||
RO_TRIGGER_IN_FALLING_EDGE, /**<input readout trigger on falling edge */
|
||||
GATE_OUT_ACTIVE_HIGH, /**<output active high when detector is exposing*/
|
||||
GATE_OUT_ACTIVE_LOW, /**<output active low when detector is exposing*/
|
||||
TRIGGER_OUT_RISING_EDGE, /**<output trigger rising edge at start of
|
||||
exposure */
|
||||
TRIGGER_OUT_FALLING_EDGE, /**<output trigger falling edge at start of
|
||||
exposure */
|
||||
RO_TRIGGER_OUT_RISING_EDGE, /**<output trigger rising edge at start of
|
||||
readout */
|
||||
RO_TRIGGER_OUT_FALLING_EDGE, /**<output trigger falling edge at start of
|
||||
readout */
|
||||
OUTPUT_LOW, /**< output always low */
|
||||
OUTPUT_HIGH, /**< output always high */
|
||||
MASTER_SLAVE_SYNCHRONIZATION /**< reserved for master/slave
|
||||
synchronization in multi detector
|
||||
systems */
|
||||
TRIGGER_IN_RISING_EDGE,
|
||||
TRIGGER_IN_FALLING_EDGE,
|
||||
INVERSION_ON,
|
||||
INVERSION_OFF
|
||||
};
|
||||
|
||||
/**
|
||||
@ -241,6 +222,7 @@ typedef struct {
|
||||
TRIGGER_EXPOSURE, /**< trigger mode i.e. exposure is triggered */
|
||||
GATED, /**< gated */
|
||||
BURST_TRIGGER, /**< trigger a burst of frames */
|
||||
TRIGGER_GATED, /**< trigger and gating */
|
||||
NUM_TIMING_MODES
|
||||
};
|
||||
|
||||
@ -476,6 +458,13 @@ typedef struct {
|
||||
ROI roi;
|
||||
uint32_t countermask{0};
|
||||
burstMode burstType{BURST_OFF};
|
||||
int64_t expTime1Ns{0};
|
||||
int64_t expTime2Ns{0};
|
||||
int64_t expTime3Ns{0};
|
||||
int64_t gateDelay1Ns{0};
|
||||
int64_t gateDelay2Ns{0};
|
||||
int64_t gateDelay3Ns{0};
|
||||
int gates{0};
|
||||
} __attribute__((packed));
|
||||
#endif
|
||||
|
||||
@ -483,9 +472,9 @@ typedef struct {
|
||||
protected:
|
||||
#endif
|
||||
|
||||
// #ifndef MYROOT
|
||||
// #include "sls_detector_funcs.h"
|
||||
// #endif
|
||||
// #ifndef MYROOT
|
||||
// #include "sls_detector_funcs.h"
|
||||
// #endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
|
@ -11,6 +11,7 @@
|
||||
enum detFuncs {
|
||||
F_EXEC_COMMAND = 0,
|
||||
F_GET_DETECTOR_TYPE,
|
||||
F_GET_EXTERNAL_SIGNAL_FLAG,
|
||||
F_SET_EXTERNAL_SIGNAL_FLAG,
|
||||
F_SET_TIMING_MODE,
|
||||
F_GET_FIRMWARE_VERSION,
|
||||
@ -197,6 +198,13 @@ enum detFuncs {
|
||||
F_GET_NUM_CHANNELS,
|
||||
F_UPDATE_RATE_CORRECTION,
|
||||
F_GET_RECEIVER_PARAMETERS,
|
||||
F_START_PATTERN,
|
||||
F_SET_NUM_GATES,
|
||||
F_GET_NUM_GATES,
|
||||
F_SET_GATE_DELAY,
|
||||
F_GET_GATE_DELAY,
|
||||
F_GET_EXPTIME_ALL_GATES,
|
||||
F_GET_GATE_DELAY_ALL_GATES,
|
||||
|
||||
NUM_DET_FUNCTIONS,
|
||||
RECEIVER_ENUM_START = 256, /**< detector function should not exceed this
|
||||
@ -291,6 +299,8 @@ enum detFuncs {
|
||||
F_GET_ADDITIONAL_JSON_PARAMETER,
|
||||
F_GET_RECEIVER_PROGRESS,
|
||||
F_SETUP_RECEIVER,
|
||||
F_SET_RECEIVER_NUM_GATES,
|
||||
F_SET_RECEIVER_GATE_DELAY,
|
||||
|
||||
NUM_REC_FUNCTIONS
|
||||
};
|
||||
@ -304,6 +314,7 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
switch (func) {
|
||||
case F_EXEC_COMMAND: return "F_EXEC_COMMAND";
|
||||
case F_GET_DETECTOR_TYPE: return "F_GET_DETECTOR_TYPE";
|
||||
case F_GET_EXTERNAL_SIGNAL_FLAG: return "F_GET_EXTERNAL_SIGNAL_FLAG";
|
||||
case F_SET_EXTERNAL_SIGNAL_FLAG: return "F_SET_EXTERNAL_SIGNAL_FLAG";
|
||||
case F_SET_TIMING_MODE: return "F_SET_TIMING_MODE";
|
||||
case F_GET_FIRMWARE_VERSION: return "F_GET_FIRMWARE_VERSION";
|
||||
@ -490,6 +501,14 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
case F_GET_NUM_CHANNELS: return "F_GET_NUM_CHANNELS";
|
||||
case F_UPDATE_RATE_CORRECTION: return "F_UPDATE_RATE_CORRECTION";
|
||||
case F_GET_RECEIVER_PARAMETERS: return "F_GET_RECEIVER_PARAMETERS";
|
||||
case F_START_PATTERN: return "F_START_PATTERN";
|
||||
case F_SET_NUM_GATES: return "F_SET_NUM_GATES";
|
||||
case F_GET_NUM_GATES: return "F_GET_NUM_GATES";
|
||||
case F_SET_GATE_DELAY: return "F_SET_GATE_DELAY";
|
||||
case F_GET_GATE_DELAY: return "F_GET_GATE_DELAY";
|
||||
case F_GET_EXPTIME_ALL_GATES: return "F_GET_EXPTIME_ALL_GATES";
|
||||
case F_GET_GATE_DELAY_ALL_GATES: return "F_GET_GATE_DELAY_ALL_GATES";
|
||||
|
||||
|
||||
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
|
||||
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
|
||||
@ -583,6 +602,8 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
case F_GET_ADDITIONAL_JSON_PARAMETER: return "F_GET_ADDITIONAL_JSON_PARAMETER";
|
||||
case F_GET_RECEIVER_PROGRESS: return "F_GET_RECEIVER_PROGRESS";
|
||||
case F_SETUP_RECEIVER: return "F_SETUP_RECEIVER";
|
||||
case F_SET_RECEIVER_NUM_GATES: return "F_SET_RECEIVER_NUM_GATES" ;
|
||||
case F_SET_RECEIVER_GATE_DELAY: return "F_SET_RECEIVER_GATE_DELAY" ;
|
||||
|
||||
case NUM_REC_FUNCTIONS: return "NUM_REC_FUNCTIONS";
|
||||
default: return "Unknown Function";
|
||||
@ -590,4 +611,3 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
|
||||
// clang-format on
|
||||
}
|
||||
|
||||
|
@ -1,13 +1,12 @@
|
||||
/** API versions */
|
||||
#define GITBRANCH "setrxhostname"
|
||||
#define APILIB 0x200409
|
||||
#define APIRECEIVER 0x200409
|
||||
#define APIGUI 0x200409
|
||||
|
||||
#define APIEIGER 0x200515
|
||||
#define APICTB 0x200515
|
||||
#define APIGOTTHARD 0x200515
|
||||
#define APIJUNGFRAU 0x200515
|
||||
#define APIMYTHEN3 0x200515
|
||||
#define APIMOENCH 0x200515
|
||||
#define APIGOTTHARD2 0x200526
|
||||
#define GITBRANCH "setrxhostname"
|
||||
#define APILIB 0x200409
|
||||
#define APIRECEIVER 0x200409
|
||||
#define APIGUI 0x200409
|
||||
#define APICTB 0x200520
|
||||
#define APIGOTTHARD 0x200520
|
||||
#define APIJUNGFRAU 0x200520
|
||||
#define APIMOENCH 0x200515
|
||||
#define APIEIGER 0x200520
|
||||
#define APIMYTHEN3 0x200526
|
||||
#define APIGOTTHARD2 0x200527
|
||||
|
@ -128,6 +128,8 @@ std::string ToString(const defs::timingMode s) {
|
||||
return std::string("gating");
|
||||
case defs::BURST_TRIGGER:
|
||||
return std::string("burst_trigger");
|
||||
case defs::TRIGGER_GATED:
|
||||
return std::string("trigger_gating");
|
||||
default:
|
||||
return std::string("Unknown");
|
||||
}
|
||||
@ -163,6 +165,10 @@ std::string ToString(const defs::externalSignalFlag s) {
|
||||
return std::string("trigger_in_rising_edge");
|
||||
case defs::TRIGGER_IN_FALLING_EDGE:
|
||||
return std::string("trigger_in_falling_edge");
|
||||
case defs::INVERSION_ON:
|
||||
return std::string("inversion_on");
|
||||
case defs::INVERSION_OFF:
|
||||
return std::string("inversion_off");
|
||||
default:
|
||||
return std::string("Unknown");
|
||||
}
|
||||
@ -318,6 +324,8 @@ template <> defs::timingMode StringTo(const std::string &s) {
|
||||
return defs::GATED;
|
||||
if (s == "burst_trigger")
|
||||
return defs::BURST_TRIGGER;
|
||||
if (s == "trigger_gating")
|
||||
return defs::TRIGGER_GATED;
|
||||
throw sls::RuntimeError("Unknown timing mode " + s);
|
||||
}
|
||||
|
||||
@ -344,6 +352,10 @@ template <> defs::externalSignalFlag StringTo(const std::string &s) {
|
||||
return defs::TRIGGER_IN_RISING_EDGE;
|
||||
if (s == "trigger_in_falling_edge")
|
||||
return defs::TRIGGER_IN_FALLING_EDGE;
|
||||
if (s == "inversion_on")
|
||||
return defs::INVERSION_ON;
|
||||
if (s == "inversion_off")
|
||||
return defs::INVERSION_OFF;
|
||||
throw sls::RuntimeError("Unknown external signal flag " + s);
|
||||
}
|
||||
|
||||
|
@ -232,3 +232,9 @@ TEST_CASE("Streaming of slsDetectorDefs::ROI") {
|
||||
REQUIRE(oss.str() == "[-10, 1]");
|
||||
}
|
||||
|
||||
TEST_CASE("std::array"){
|
||||
std::array<int, 3> arr{4,6,7};
|
||||
REQUIRE(ToString(arr) == "[4, 6, 7]");
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user