mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2026-01-16 00:49:22 +01:00
gotthard2: timingsource and currentsource features, (timing source external yet to be implemented in fpga to test (#80)
This commit is contained in:
@@ -217,6 +217,18 @@ inline std::string ToString(const defs::burstMode s) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
inline std::string ToString(const defs::timingSourceType s) {
|
||||
switch (s) {
|
||||
case defs::TIMING_INTERNAL:
|
||||
return std::string("internal");
|
||||
case defs::TIMING_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) {
|
||||
@@ -574,6 +586,15 @@ inline defs::burstMode StringTo(const std::string& s) {
|
||||
throw sls::RuntimeError("Unknown burst mode " + s);
|
||||
}
|
||||
|
||||
template <>
|
||||
inline defs::timingSourceType StringTo(const std::string& s) {
|
||||
if (s == "internal")
|
||||
return defs::TIMING_INTERNAL;
|
||||
if (s == "external")
|
||||
return defs::TIMING_EXTERNAL;
|
||||
throw sls::RuntimeError("Unknown timing source type " + s);
|
||||
}
|
||||
|
||||
|
||||
/** For types with a .str() method use this for conversion */
|
||||
template <typename T>
|
||||
|
||||
@@ -444,9 +444,17 @@ class slsDetectorDefs {
|
||||
enum burstMode {
|
||||
BURST_OFF,
|
||||
BURST_INTERNAL,
|
||||
BURST_EXTERNAL,
|
||||
BURST_EXTERNAL
|
||||
};
|
||||
|
||||
/**
|
||||
* timing source for gotthard2
|
||||
*/
|
||||
enum timingSourceType {
|
||||
TIMING_INTERNAL,
|
||||
TIMING_EXTERNAL
|
||||
};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
protected:
|
||||
|
||||
@@ -192,6 +192,10 @@ enum detFuncs{
|
||||
F_SET_NUM_BURSTS,
|
||||
F_GET_BURST_PERIOD,
|
||||
F_SET_BURST_PERIOD,
|
||||
F_GET_CURRENT_SOURCE,
|
||||
F_SET_CURRENT_SOURCE,
|
||||
F_GET_TIMING_SOURCE,
|
||||
F_SET_TIMING_SOURCE,
|
||||
|
||||
NUM_DET_FUNCTIONS,
|
||||
RECEIVER_ENUM_START = 256, /**< detector function should not exceed this (detector server should not compile anyway) */
|
||||
@@ -451,7 +455,11 @@ static const char* getFunctionNameFromEnum(enum detFuncs func) {
|
||||
case F_GET_NUM_BURSTS: return "F_GET_NUM_BURSTS";
|
||||
case F_SET_NUM_BURSTS: return "F_SET_NUM_BURSTS";
|
||||
case F_GET_BURST_PERIOD: return "F_GET_BURST_PERIOD";
|
||||
case F_SET_BURST_PERIOD: return "F_SET_BURST_PERIOD";
|
||||
case F_SET_BURST_PERIOD: return "F_SET_BURST_PERIOD";
|
||||
case F_GET_CURRENT_SOURCE: return "F_GET_CURRENT_SOURCE";
|
||||
case F_SET_CURRENT_SOURCE: return "F_SET_CURRENT_SOURCE";
|
||||
case F_GET_TIMING_SOURCE: return "F_GET_TIMING_SOURCE";
|
||||
case F_SET_TIMING_SOURCE: return "F_SET_TIMING_SOURCE";
|
||||
|
||||
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
|
||||
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
/** API versions */
|
||||
#define GITBRANCH "developer"
|
||||
#define APIMOENCH 0x200131
|
||||
#define APIGOTTHARD2 0x200226
|
||||
#define APIMYTHEN3 0x200226
|
||||
#define APIJUNGFRAU 0x200226
|
||||
#define APIEIGER 0x200226
|
||||
@@ -10,3 +9,4 @@
|
||||
#define APIRECEIVER 0x200227
|
||||
#define APIGUI 0x200227
|
||||
#define APICTB 0x200227
|
||||
#define APIGOTTHARD2 0x200228
|
||||
|
||||
Reference in New Issue
Block a user