mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
M3: polarity, interpolation, pump probe (#421)
* wip, adding m3 functions: polarity, inerpolation, pumpprobe * added interpol, polarity, pump probe, analog pulsing, digital pulsing * tests * binaries in * update release * added python polarity enum * fixed python and minor readability in mythen3.c * binarie sin * added all the m3 funcs also in list.c and enablingall counters for enabling interpolation * binarie sin
This commit is contained in:
@ -43,6 +43,7 @@ std::string ToString(const defs::portPosition s);
|
||||
std::string ToString(const defs::streamingInterface s);
|
||||
std::string ToString(const defs::vetoAlgorithm s);
|
||||
std::string ToString(const defs::gainMode s);
|
||||
std::string ToString(const defs::polarity s);
|
||||
|
||||
std::string ToString(const slsDetectorDefs::xy &coord);
|
||||
std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::xy &coord);
|
||||
@ -313,6 +314,7 @@ template <> defs::portPosition StringTo(const std::string &s);
|
||||
template <> defs::streamingInterface StringTo(const std::string &s);
|
||||
template <> defs::vetoAlgorithm StringTo(const std::string &s);
|
||||
template <> defs::gainMode StringTo(const std::string &s);
|
||||
template <> defs::polarity StringTo(const std::string &s);
|
||||
|
||||
template <> uint32_t StringTo(const std::string &s);
|
||||
template <> uint64_t StringTo(const std::string &s);
|
||||
|
@ -438,6 +438,8 @@ enum streamingInterface {
|
||||
FIX_G0
|
||||
};
|
||||
|
||||
enum polarity { POSITIVE, NEGATIVE };
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
/** scan structure */
|
||||
|
@ -260,9 +260,19 @@ enum detFuncs {
|
||||
F_SET_MASTER,
|
||||
F_GET_TOP,
|
||||
F_SET_TOP,
|
||||
F_GET_POLARITY,
|
||||
F_SET_POLARITY,
|
||||
F_GET_INTERPOLATION,
|
||||
F_SET_INTERPOLATION,
|
||||
F_GET_PUMP_PROBE,
|
||||
F_SET_PUMP_PROBE,
|
||||
F_GET_ANALOG_PULSING,
|
||||
F_SET_ANALOG_PULSING,
|
||||
F_GET_DIGITAL_PULSING,
|
||||
F_SET_DIGITAL_PULSING,
|
||||
|
||||
NUM_DET_FUNCTIONS,
|
||||
RECEIVER_ENUM_START = 256, /**< detector function should not exceed this
|
||||
RECEIVER_ENUM_START = 512, /**< detector function should not exceed this
|
||||
(detector server should not compile anyway) */
|
||||
|
||||
F_EXEC_RECEIVER_COMMAND,
|
||||
@ -623,6 +633,16 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
case F_SET_MASTER: return "F_SET_MASTER";
|
||||
case F_GET_TOP: return "F_GET_TOP";
|
||||
case F_SET_TOP: return "F_SET_TOP";
|
||||
case F_GET_POLARITY: return "F_GET_POLARITY";
|
||||
case F_SET_POLARITY: return "F_SET_POLARITY";
|
||||
case F_GET_INTERPOLATION: return "F_GET_INTERPOLATION";
|
||||
case F_SET_INTERPOLATION: return "F_SET_INTERPOLATION";
|
||||
case F_GET_PUMP_PROBE: return "F_GET_PUMP_PROBE";
|
||||
case F_SET_PUMP_PROBE: return "F_SET_PUMP_PROBE";
|
||||
case F_GET_ANALOG_PULSING: return "F_GET_ANALOG_PULSING";
|
||||
case F_SET_ANALOG_PULSING: return "F_SET_ANALOG_PULSING";
|
||||
case F_GET_DIGITAL_PULSING: return "F_GET_DIGITAL_PULSING";
|
||||
case F_SET_DIGITAL_PULSING: return "F_SET_DIGITAL_PULSING";
|
||||
|
||||
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
|
||||
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
|
||||
|
@ -2,13 +2,14 @@
|
||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||
/** API versions */
|
||||
#define GITBRANCH "developer"
|
||||
#define APILIB 0x220405
|
||||
#define APIRECEIVER 0x220405
|
||||
#define APILIB 0x220408
|
||||
#define APIRECEIVER 0x220408
|
||||
#define APIGUI 0x220328
|
||||
#define APICTB 0x220405
|
||||
#define APIGOTTHARD 0x220405
|
||||
#define APIGOTTHARD2 0x220405
|
||||
#define APIJUNGFRAU 0x220405
|
||||
#define APIMYTHEN3 0x220405
|
||||
#define APIMOENCH 0x220405
|
||||
#define APIEIGER 0x220405
|
||||
|
||||
#define APICTB 0x220408
|
||||
#define APIGOTTHARD 0x220408
|
||||
#define APIGOTTHARD2 0x220408
|
||||
#define APIJUNGFRAU 0x220408
|
||||
#define APIMYTHEN3 0x220408
|
||||
#define APIMOENCH 0x220408
|
||||
#define APIEIGER 0x220408
|
||||
|
@ -642,6 +642,17 @@ std::string ToString(const defs::gainMode s) {
|
||||
}
|
||||
}
|
||||
|
||||
std::string ToString(const defs::polarity s) {
|
||||
switch (s) {
|
||||
case defs::POSITIVE:
|
||||
return std::string("pos");
|
||||
case defs::NEGATIVE:
|
||||
return std::string("neg");
|
||||
default:
|
||||
return std::string("Unknown");
|
||||
}
|
||||
}
|
||||
|
||||
const std::string &ToString(const std::string &s) { return s; }
|
||||
|
||||
template <> defs::detectorType StringTo(const std::string &s) {
|
||||
@ -1055,6 +1066,14 @@ template <> defs::gainMode StringTo(const std::string &s) {
|
||||
throw sls::RuntimeError("Unknown gain mode " + s);
|
||||
}
|
||||
|
||||
template <> defs::polarity StringTo(const std::string &s) {
|
||||
if (s == "pos")
|
||||
return defs::POSITIVE;
|
||||
if (s == "neg")
|
||||
return defs::NEGATIVE;
|
||||
throw sls::RuntimeError("Unknown polarity mode " + s);
|
||||
}
|
||||
|
||||
template <> uint32_t StringTo(const std::string &s) {
|
||||
int base = s.find("0x") != std::string::npos ? 16 : 10;
|
||||
return std::stoul(s, nullptr, base);
|
||||
|
Reference in New Issue
Block a user