mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 10:07: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:
@ -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