mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
rewrote settings enums, gainmode enums
This commit is contained in:
@ -345,7 +345,7 @@ typedef struct {
|
||||
LOWGAIN,
|
||||
MEDIUMGAIN,
|
||||
VERYHIGHGAIN,
|
||||
DYNAMICHG0,
|
||||
HIGHGAIN0,
|
||||
FIXGAIN1,
|
||||
FIXGAIN2,
|
||||
VERYLOWGAIN,
|
||||
@ -357,6 +357,7 @@ typedef struct {
|
||||
G2_LOWCAP_LOWGAIN,
|
||||
G4_HIGHGAIN,
|
||||
G4_LOWGAIN,
|
||||
GAIN0,
|
||||
UNDEFINED = 200,
|
||||
UNINITIALIZED
|
||||
};
|
||||
@ -415,13 +416,13 @@ typedef struct {
|
||||
enum vetoAlgorithm { DEFAULT_ALGORITHM };
|
||||
|
||||
enum gainMode {
|
||||
DYNAMICGAIN,
|
||||
DYNAMIC_GAIN,
|
||||
FORCE_SWITCH_G1,
|
||||
FORCE_SWITCH_G2,
|
||||
FIX_G1,
|
||||
FIX_G2,
|
||||
FIX_G0,
|
||||
FIX_HG0
|
||||
FIX_G0
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
@ -170,8 +170,8 @@ std::string ToString(const defs::detectorSettings s) {
|
||||
return std::string("mediumgain");
|
||||
case defs::VERYHIGHGAIN:
|
||||
return std::string("veryhighgain");
|
||||
case defs::DYNAMICHG0:
|
||||
return std::string("dynamichg0");
|
||||
case defs::HIGHGAIN0:
|
||||
return std::string("highgain0");
|
||||
case defs::FIXGAIN1:
|
||||
return std::string("fixgain1");
|
||||
case defs::FIXGAIN2:
|
||||
@ -194,6 +194,8 @@ std::string ToString(const defs::detectorSettings s) {
|
||||
return std::string("g4_hg");
|
||||
case defs::G4_LOWGAIN:
|
||||
return std::string("g4_lg");
|
||||
case defs::GAIN0:
|
||||
return std::string("gain0");
|
||||
case defs::UNDEFINED:
|
||||
return std::string("undefined");
|
||||
case defs::UNINITIALIZED:
|
||||
@ -581,7 +583,7 @@ std::string ToString(const defs::vetoAlgorithm s) {
|
||||
|
||||
std::string ToString(const defs::gainMode s) {
|
||||
switch (s) {
|
||||
case defs::DYNAMICGAIN:
|
||||
case defs::DYNAMIC_GAIN:
|
||||
return std::string("dynamicgain");
|
||||
case defs::FORCE_SWITCH_G1:
|
||||
return std::string("forceswitchg1");
|
||||
@ -593,8 +595,6 @@ std::string ToString(const defs::gainMode s) {
|
||||
return std::string("fixg2");
|
||||
case defs::FIX_G0:
|
||||
return std::string("fixg0");
|
||||
case defs::FIX_HG0:
|
||||
return std::string("fixhg0");
|
||||
default:
|
||||
return std::string("Unknown");
|
||||
}
|
||||
@ -635,8 +635,8 @@ template <> defs::detectorSettings StringTo(const std::string &s) {
|
||||
return defs::MEDIUMGAIN;
|
||||
if (s == "veryhighgain")
|
||||
return defs::VERYHIGHGAIN;
|
||||
if (s == "dynamichg0")
|
||||
return defs::DYNAMICHG0;
|
||||
if (s == "highgain0")
|
||||
return defs::HIGHGAIN0;
|
||||
if (s == "fixgain1")
|
||||
return defs::FIXGAIN1;
|
||||
if (s == "fixgain2")
|
||||
@ -657,6 +657,8 @@ template <> defs::detectorSettings StringTo(const std::string &s) {
|
||||
return defs::G2_LOWCAP_LOWGAIN;
|
||||
if (s == "g4_hg")
|
||||
return defs::G4_HIGHGAIN;
|
||||
if (s == "gain0")
|
||||
return defs::GAIN0;
|
||||
if (s == "g4_lg")
|
||||
return defs::G4_LOWGAIN;
|
||||
throw sls::RuntimeError("Unknown setting " + s);
|
||||
@ -985,7 +987,7 @@ template <> defs::vetoAlgorithm StringTo(const std::string &s) {
|
||||
|
||||
template <> defs::gainMode StringTo(const std::string &s) {
|
||||
if (s == "dynamicgain")
|
||||
return defs::DYNAMICGAIN;
|
||||
return defs::DYNAMIC_GAIN;
|
||||
if (s == "forceswitchg1")
|
||||
return defs::FORCE_SWITCH_G1;
|
||||
if (s == "forceswitchg2")
|
||||
@ -996,8 +998,6 @@ template <> defs::gainMode StringTo(const std::string &s) {
|
||||
return defs::FIX_G2;
|
||||
if (s == "fixg0")
|
||||
return defs::FIX_G0;
|
||||
if (s == "fixhg0")
|
||||
return defs::FIX_HG0;
|
||||
throw sls::RuntimeError("Unknown gain mode " + s);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user