gotthard2: first edit

This commit is contained in:
2020-01-20 12:13:23 +01:00
parent 6e47f0b7f7
commit 6cfd0f8962
17 changed files with 322 additions and 53 deletions

View File

@ -204,6 +204,17 @@ inline std::string ToString(const defs::detectorModeType s) {
}
}
inline std::string ToString(const defs::burstModeType s) {
switch (s) {
case defs::INTERNAL:
return std::string("internal");
case defs::EXTERNAL:
return std::string("external");
default:
return std::string("Unknown");
}
}
// in case we already have a string
// causes a copy but might be needed in generic code
inline std::string ToString(const std::string& s) {
@ -550,6 +561,16 @@ inline defs::dacIndex StringTo(const std::string& s) {
throw sls::RuntimeError("Unknown dac Index " + s);
}
template <>
inline defs::burstModeType StringTo(const std::string& s) {
if (s == "internal")
return defs::INTERNAL;
if (s == "external")
return defs::EXTERNAL;
throw sls::RuntimeError("Unknown burst mode type" + s);
}
/** For types with a .str() method use this for conversion */
template <typename T>
typename std::enable_if<has_str<T>::value, std::string>::type

View File

@ -436,6 +436,14 @@ class slsDetectorDefs {
ANALOG /** < analog */
};
/**
* burst mode type for gotthard2
*/
enum burstModeType {
INTERNAL,
EXTERNAL,
};
#ifdef __cplusplus
protected:

View File

@ -188,6 +188,8 @@ enum detFuncs{
F_GET_ADC_ENABLE_MASK_10G,
F_SET_COUNTER_MASK,
F_GET_COUNTER_MASK,
F_SET_BURST_TYPE,
F_GET_BURST_TYPE,
NUM_DET_FUNCTIONS,
RECEIVER_ENUM_START = 256, /**< detector function should not exceed this (detector server should not compile anyway) */
@ -443,7 +445,8 @@ static const char* getFunctionNameFromEnum(enum detFuncs func) {
case F_GET_ADC_ENABLE_MASK_10G: return "F_GET_ADC_ENABLE_MASK_10G";
case F_SET_COUNTER_MASK: return "F_SET_COUNTER_MASK";
case F_GET_COUNTER_MASK: return "F_GET_COUNTER_MASK";
case F_SET_BURST_TYPE: return "F_SET_BURST_TYPE";
case F_GET_BURST_TYPE: return "F_GET_BURST_TYPE";
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";

View File

@ -9,4 +9,4 @@
#define APICTB 0x191210
#define APIEIGER 0x200110
#define APIMYTHEN3 0x200120
#define APIGOTTHARD2 0x200116
#define APIGOTTHARD2 0x200120