mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 01:58:00 +02:00
Jf: Electron collection mode (#983)
* electron collection mode for jungfrau. also removing the config chip when using register command * collectionMode: HOLE/ELECTRON (enum)
This commit is contained in:
@ -44,6 +44,7 @@ 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 defs::collectionMode s);
|
||||
|
||||
std::string ToString(const slsDetectorDefs::xy &coord);
|
||||
std::ostream &operator<<(std::ostream &os, const slsDetectorDefs::xy &coord);
|
||||
@ -318,6 +319,7 @@ 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 <> defs::collectionMode StringTo(const std::string &s);
|
||||
|
||||
template <> uint8_t StringTo(const std::string &s);
|
||||
template <> uint16_t StringTo(const std::string &s);
|
||||
|
@ -520,6 +520,8 @@ enum streamingInterface {
|
||||
|
||||
enum polarity { POSITIVE, NEGATIVE };
|
||||
|
||||
enum collectionMode { HOLE, ELECTRON };
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
/** scan structure */
|
||||
|
@ -293,6 +293,8 @@ enum detFuncs {
|
||||
F_GET_PEDESTAL_MODE,
|
||||
F_SET_PEDESTAL_MODE,
|
||||
F_CONFIG_TRANSCEIVER,
|
||||
F_GET_COLLECTION_MODE,
|
||||
F_SET_COLLECTION_MODE,
|
||||
|
||||
NUM_DET_FUNCTIONS,
|
||||
RECEIVER_ENUM_START = 512, /**< detector function should not exceed this
|
||||
@ -693,6 +695,8 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
case F_GET_PEDESTAL_MODE: return "F_GET_PEDESTAL_MODE";
|
||||
case F_SET_PEDESTAL_MODE: return "F_SET_PEDESTAL_MODE";
|
||||
case F_CONFIG_TRANSCEIVER: return "F_CONFIG_TRANSCEIVER";
|
||||
case F_GET_COLLECTION_MODE: return "F_GET_COLLECTION_MODE";
|
||||
case F_SET_COLLECTION_MODE: return "F_SET_COLLECTION_MODE";
|
||||
|
||||
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
|
||||
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
|
||||
|
@ -7,8 +7,8 @@
|
||||
#define APICTB "developer 0x240918"
|
||||
#define APIGOTTHARD "developer 0x240918"
|
||||
#define APIGOTTHARD2 "developer 0x240918"
|
||||
#define APIJUNGFRAU "developer 0x240918"
|
||||
#define APIMYTHEN3 "developer 0x240918"
|
||||
#define APIMOENCH "developer 0x240918"
|
||||
#define APIXILINXCTB "developer 0x240918"
|
||||
#define APIEIGER "developer 0x240918"
|
||||
#define APIJUNGFRAU "developer 0x240930"
|
||||
|
@ -679,6 +679,17 @@ std::string ToString(const defs::polarity s) {
|
||||
}
|
||||
}
|
||||
|
||||
std::string ToString(const defs::collectionMode s) {
|
||||
switch (s) {
|
||||
case defs::HOLE:
|
||||
return std::string("hole");
|
||||
case defs::ELECTRON:
|
||||
return std::string("electron");
|
||||
default:
|
||||
return std::string("Unknown");
|
||||
}
|
||||
}
|
||||
|
||||
const std::string &ToString(const std::string &s) { return s; }
|
||||
|
||||
template <> defs::detectorType StringTo(const std::string &s) {
|
||||
@ -1104,6 +1115,14 @@ template <> defs::polarity StringTo(const std::string &s) {
|
||||
throw RuntimeError("Unknown polarity mode " + s);
|
||||
}
|
||||
|
||||
template <> defs::collectionMode StringTo(const std::string &s) {
|
||||
if (s == "hole")
|
||||
return defs::HOLE;
|
||||
if (s == "electron")
|
||||
return defs::ELECTRON;
|
||||
throw RuntimeError("Unknown collection mode " + s);
|
||||
}
|
||||
|
||||
template <> uint8_t StringTo(const std::string &s) {
|
||||
int base = s.find("0x") != std::string::npos ? 16 : 10;
|
||||
int value = std::stoi(s, nullptr, base);
|
||||
|
Reference in New Issue
Block a user