merged with g2continuous

This commit is contained in:
maliakal_d 2020-09-08 08:46:37 +02:00
commit f26d8e514b
19 changed files with 153 additions and 83 deletions

View File

@ -274,9 +274,12 @@ void init_enums(py::module &m) {
.export_values();
py::enum_<slsDetectorDefs::burstMode>(Defs, "burstMode")
.value("BURST_OFF", slsDetectorDefs::burstMode::BURST_OFF)
.value("BURST_INTERNAL", slsDetectorDefs::burstMode::BURST_INTERNAL)
.value("BURST_EXTERNAL", slsDetectorDefs::burstMode::BURST_EXTERNAL)
.value("CONTINUOUS_INTERNAL",
slsDetectorDefs::burstMode::CONTINUOUS_INTERNAL)
.value("CONTINUOUS_EXTERNAL",
slsDetectorDefs::burstMode::CONTINUOUS_EXTERNAL)
.value("NUM_BURST_MODES", slsDetectorDefs::burstMode::NUM_BURST_MODES)
.export_values();

View File

@ -1664,11 +1664,6 @@ Frame period between exposures.
<string>Timing Mode of the detector.
#timing#</string>
</property>
<item>
<property name="text">
<string>Off</string>
</property>
</item>
<item>
<property name="text">
<string>Burst Internal</string>
@ -1676,7 +1671,17 @@ Frame period between exposures.
</item>
<item>
<property name="text">
<string>Burst external</string>
<string>Burst External</string>
</property>
</item>
<item>
<property name="text">
<string>Continuous Internal</string>
</property>
</item>
<item>
<property name="text">
<string>Continuous External</string>
</property>
</item>
</widget>

View File

@ -152,7 +152,11 @@ void qTabMeasurement::Initialization() {
void qTabMeasurement::ShowTriggerDelay() {
bool showTrigger = true;
if (det->getDetectorType().squash() == slsDetectorDefs::GOTTHARD2) {
if ((comboBurstMode->currentIndex() != slsDetectorDefs::BURST_OFF) &&
// burst and auto
if ((comboBurstMode->currentIndex() ==
slsDetectorDefs::BURST_INTERNAL ||
comboBurstMode->currentIndex() ==
slsDetectorDefs::BURST_EXTERNAL) &&
(comboTimingMode->currentIndex() == AUTO)) {
// show burst, burstperiod, not trigger or delay
showTrigger = false;
@ -368,9 +372,10 @@ void qTabMeasurement::GetBurstMode() {
auto retval = det->getBurstMode().tsquash(
"Inconsistent burst mode for all detectors.");
switch (retval) {
case slsDetectorDefs::BURST_OFF:
case slsDetectorDefs::BURST_INTERNAL:
case slsDetectorDefs::BURST_EXTERNAL:
case slsDetectorDefs::CONTINUOUS_INTERNAL:
case slsDetectorDefs::CONTINUOUS_EXTERNAL:
comboBurstMode->setCurrentIndex((int)retval);
ShowTriggerDelay();
break;

View File

@ -121,9 +121,10 @@
#define ASIC_CONFIG_RUN_MODE_OFST (0)
#define ASIC_CONFIG_RUN_MODE_MSK (0x00000003 << ASIC_CONFIG_RUN_MODE_OFST)
#define ASIC_CONFIG_RUN_MODE_INT_BURST_VAL ((0x1 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
#define ASIC_CONFIG_RUN_MODE_CONT_VAL ((0x2 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
#define ASIC_CONFIG_RUN_MODE_EXT_BURST_VAL ((0x3 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
#define ASIC_CONFIG_RUN_MODE_INT_BURST_VAL ((0x0 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
#define ASIC_CONFIG_RUN_MODE_EXT_BURST_VAL ((0x1 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
#define ASIC_CONFIG_RUN_MODE_INT_CONT_VAL ((0x2 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
#define ASIC_CONFIG_RUN_MODE_EXT_CONT_VAL ((0x3 << ASIC_CONFIG_RUN_MODE_OFST) & ASIC_CONFIG_RUN_MODE_MSK)
#define ASIC_CONFIG_GAIN_OFST (4)
#define ASIC_CONFIG_GAIN_MSK (0x00000003 << ASIC_CONFIG_GAIN_OFST)
#define ASIC_CONFIG_DYNAMIC_GAIN_VAL ((0x0 << ASIC_CONFIG_GAIN_OFST) & ASIC_CONFIG_GAIN_MSK)

View File

@ -809,11 +809,15 @@ int setDynamicRange(int dr) { return DYNAMIC_RANGE; }
/* parameters - timer */
void setNumFrames(int64_t val) {
if (val > 0) {
if (burstMode == BURST_OFF) {
// continuous
if (burstMode == CONTINUOUS_INTERNAL ||
burstMode == CONTINUOUS_EXTERNAL) {
LOG(logINFO,
("Setting number of frames %lld [Continuous mode]\n", val));
set64BitReg(val, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
} else {
}
// burst
else {
LOG(logINFO,
("Setting number of frames %d [Burst mode]\n", (int)val));
bus_w(ASIC_INT_FRAMES_REG,
@ -826,9 +830,12 @@ void setNumFrames(int64_t val) {
}
int64_t getNumFrames() {
if (burstMode == BURST_OFF) {
// continuous
if (burstMode == CONTINUOUS_INTERNAL || burstMode == CONTINUOUS_EXTERNAL) {
return get64BitReg(SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
} else {
}
// burst
else {
return ((bus_r(ASIC_INT_FRAMES_REG) & ASIC_INT_FRAMES_MSK) >>
ASIC_INT_FRAMES_OFST);
}
@ -856,9 +863,13 @@ int64_t getNumTriggers() {
void setNumBursts(int64_t val) {
if (val > 0) {
LOG(logINFO, ("Setting number of bursts %lld\n", val));
if (burstMode != BURST_OFF && getTiming() == AUTO_TIMING) {
// burst and auto
if ((burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) &&
getTiming() == AUTO_TIMING) {
set64BitReg(val, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
} else {
}
// burst-trigger or continuous
else {
LOG(logINFO,
("\tNot (Burst and Auto mode): not writing to register\n"));
numBurstsReg = val;
@ -867,9 +878,12 @@ void setNumBursts(int64_t val) {
}
int64_t getNumBursts() {
if (burstMode != BURST_OFF && getTiming() == AUTO_TIMING) {
// burst and auto
if ((burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) &&
getTiming() == AUTO_TIMING) {
return get64BitReg(SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
}
// burst-trigger or continuous
return numBurstsReg;
}
@ -901,11 +915,14 @@ int setPeriod(int64_t val) {
LOG(logERROR, ("Invalid period: %lld ns\n", val));
return FAIL;
}
if (burstMode == BURST_OFF) {
// continuous
if (burstMode == CONTINUOUS_INTERNAL || burstMode == CONTINUOUS_EXTERNAL) {
LOG(logINFO, ("Setting period %lld ns [Continuous mode]\n", val));
val *= (1E-9 * systemFrequency);
set64BitReg(val, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
} else {
}
// burst
else {
LOG(logINFO, ("Setting period %lld ns [Burst mode]\n", val));
val *= (1E-9 * systemFrequency);
set64BitReg(val, ASIC_INT_PERIOD_LSB_REG, ASIC_INT_PERIOD_MSB_REG);
@ -920,10 +937,13 @@ int setPeriod(int64_t val) {
}
int64_t getPeriod() {
if (burstMode == BURST_OFF) {
// continuous
if (burstMode == CONTINUOUS_INTERNAL || burstMode == CONTINUOUS_EXTERNAL) {
return get64BitReg(SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG) /
(1E-9 * systemFrequency);
} else {
}
// burst
else {
return get64BitReg(ASIC_INT_PERIOD_LSB_REG, ASIC_INT_PERIOD_MSB_REG) /
(1E-9 * systemFrequency);
}
@ -966,9 +986,13 @@ int setBurstPeriod(int64_t val) {
}
LOG(logINFO, ("Setting burst period %lld ns\n", val));
val *= (1E-9 * systemFrequency);
if (burstMode != BURST_OFF && getTiming() == AUTO_TIMING) {
// burst and auto
if ((burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) &&
getTiming() == AUTO_TIMING) {
set64BitReg(val, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
} else {
}
// burst-trigger, continuous
else {
LOG(logINFO,
("\tNot (Burst and Auto mode): not writing to register\n"));
burstPeriodReg = val;
@ -984,10 +1008,13 @@ int setBurstPeriod(int64_t val) {
}
int64_t getBurstPeriod() {
if (burstMode != BURST_OFF && getTiming() == AUTO_TIMING) {
// burst and auto
if ((burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) &&
getTiming() == AUTO_TIMING) {
return get64BitReg(SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG) /
(1E-9 * systemFrequency);
}
// burst-trigger, continuous
return burstPeriodReg / (1E-9 * systemFrequency);
}
@ -1211,7 +1238,7 @@ void setTiming(enum timingMode arg) {
get64BitReg(SET_TRIGGER_DELAY_LSB_REG, SET_TRIGGER_DELAY_MSB_REG);
}
// auto and burst
else if (burstMode != BURST_OFF) {
else if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
numBurstsReg = get64BitReg(SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
burstPeriodReg = get64BitReg(SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
}
@ -1238,7 +1265,7 @@ void setTiming(enum timingMode arg) {
LOG(logINFO, ("\tTriggers reg: %lld, Delay reg: %lldns\n",
getNumTriggers(), getDelayAfterTrigger()));
// burst
if (burstMode != BURST_OFF) {
if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
LOG(logINFO, ("\tFrame reg: 1, Period reg: 0\n"))
set64BitReg(1, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
set64BitReg(0, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
@ -1250,7 +1277,7 @@ void setTiming(enum timingMode arg) {
set64BitReg(1, SET_CYCLES_LSB_REG, SET_CYCLES_MSB_REG);
set64BitReg(0, SET_TRIGGER_DELAY_LSB_REG, SET_TRIGGER_DELAY_MSB_REG);
// burst
if (burstMode != BURST_OFF) {
if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
set64BitReg(numBurstsReg, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
set64BitReg(burstPeriodReg, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
LOG(logINFO, ("\tFrames reg (bursts): %lld, Period reg(burst "
@ -2053,15 +2080,18 @@ int setBurstModeinFPGA(enum burstMode value) {
uint32_t addr = ASIC_CONFIG_REG;
uint32_t runmode = 0;
switch (value) {
case BURST_OFF:
runmode = ASIC_CONFIG_RUN_MODE_CONT_VAL;
break;
case BURST_INTERNAL:
runmode = ASIC_CONFIG_RUN_MODE_INT_BURST_VAL;
break;
case BURST_EXTERNAL:
runmode = ASIC_CONFIG_RUN_MODE_EXT_BURST_VAL;
break;
case CONTINUOUS_INTERNAL:
runmode = ASIC_CONFIG_RUN_MODE_INT_CONT_VAL;
break;
case CONTINUOUS_EXTERNAL:
runmode = ASIC_CONFIG_RUN_MODE_EXT_CONT_VAL;
break;
default:
LOG(logERROR, ("Unknown burst mode %d\n", value));
return FAIL;
@ -2075,16 +2105,20 @@ int setBurstModeinFPGA(enum burstMode value) {
}
int setBurstMode(enum burstMode burst) {
LOG(logINFO, ("Setting burst mode to %s\n",
burst == BURST_OFF
? "off"
: (burst == BURST_INTERNAL ? "internal" : "external")));
LOG(logINFO,
("Setting burst mode to %s\n",
(burst == BURST_INTERNAL
? "burst_internal"
: (burst == BURST_EXTERNAL ? "burst external"
: (burst == CONTINUOUS_INTERNAL
? "continuous internal"
: "continuous external")))));
// update
int64_t framesReg = 0;
int64_t periodReg = 0;
// burst
if (burstMode != BURST_OFF) {
if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
framesReg = ((bus_r(ASIC_INT_FRAMES_REG) & ASIC_INT_FRAMES_MSK) >>
ASIC_INT_FRAMES_OFST);
periodReg =
@ -2108,7 +2142,7 @@ int setBurstMode(enum burstMode burst) {
LOG(logINFO, ("\tUpdating registers\n"));
// continuous
if (burstMode == BURST_OFF) {
if (burstMode == CONTINUOUS_INTERNAL || burstMode == CONTINUOUS_EXTERNAL) {
set64BitReg(framesReg, SET_FRAMES_LSB_REG, SET_FRAMES_MSB_REG);
set64BitReg(periodReg, SET_PERIOD_LSB_REG, SET_PERIOD_MSB_REG);
LOG(logINFO, ("\tFrames reg: %lld, Period reg: %lldns\n",
@ -2158,14 +2192,17 @@ int configureASICGlobalSettings() {
int value = ((filter << ASIC_FILTER_OFST) & ASIC_FILTER_MSK) |
((cdsGain << ASIC_CDS_GAIN_OFST) & ASIC_CDS_GAIN_MSK);
switch (burstMode) {
case BURST_OFF:
value |= (ASIC_CONT_MODE_MSK | ASIC_EXT_TIMING_MSK);
break;
case BURST_INTERNAL:
break;
case BURST_EXTERNAL:
value |= ASIC_EXT_TIMING_MSK;
break;
case CONTINUOUS_INTERNAL:
value |= ASIC_CONT_MODE_MSK;
break;
case CONTINUOUS_EXTERNAL:
value |= (ASIC_CONT_MODE_MSK | ASIC_EXT_TIMING_MSK);
break;
}
LOG(logINFO, ("\tSending Global Chip settings:0x%x (filter:%d, "
"cdsgain:%d)\n",
@ -2214,15 +2251,18 @@ enum burstMode getBurstMode() {
uint32_t addr = ASIC_CONFIG_REG;
int runmode = bus_r(addr) & ASIC_CONFIG_RUN_MODE_MSK;
switch (runmode) {
case ASIC_CONFIG_RUN_MODE_CONT_VAL:
burstMode = BURST_OFF;
break;
case ASIC_CONFIG_RUN_MODE_INT_BURST_VAL:
burstMode = BURST_INTERNAL;
break;
case ASIC_CONFIG_RUN_MODE_EXT_BURST_VAL:
burstMode = BURST_EXTERNAL;
break;
case ASIC_CONFIG_RUN_MODE_INT_CONT_VAL:
burstMode = CONTINUOUS_INTERNAL;
break;
case ASIC_CONFIG_RUN_MODE_EXT_CONT_VAL:
burstMode = CONTINUOUS_EXTERNAL;
break;
default:
LOG(logERROR, ("Unknown run mode read from FPGA %d\n", runmode));
return -1;
@ -2431,9 +2471,13 @@ void *start_timer(void *arg) {
int numRepeats = getNumTriggers();
if (getTiming() == AUTO_TIMING) {
if (burstMode == BURST_OFF) {
// continuous
if (burstMode == CONTINUOUS_INTERNAL ||
burstMode == CONTINUOUS_EXTERNAL) {
numRepeats = 1;
} else {
}
// burst
else {
numRepeats = getNumBursts();
}
}
@ -2511,8 +2555,8 @@ void *start_timer(void *arg) {
sendUDPPacket(1, packetData2, vetopacketsize);
}
LOG(logINFO,
("Sent frame: %d (bursts: %d) [%lld]\n", frameNr, repeatNr,
(long long unsigned int)virtual_currentFrameNumber));
("Sent frame: %d (bursts/ triggers: %d) [%lld]\n", frameNr,
repeatNr, (long long unsigned int)virtual_currentFrameNumber));
clock_gettime(CLOCK_REALTIME, &end);
int64_t timeNs = ((end.tv_sec - begin.tv_sec) * 1E9 +
(end.tv_nsec - begin.tv_nsec));

View File

@ -1940,7 +1940,9 @@ int set_num_frames(int file_des) {
} else {
#ifdef GOTTHARD2D
// validate #frames in burst mode
if (getBurstMode() != BURST_OFF && arg > MAX_FRAMES_IN_BURST_MODE) {
enum burstMode mode = getBurstMode();
if ((mode == BURST_INTERNAL || mode == BURST_EXTERNAL) &&
arg > MAX_FRAMES_IN_BURST_MODE) {
ret = FAIL;
sprintf(mess,
"Could not set number of frames %lld. Must be <= %d in "
@ -6494,7 +6496,7 @@ int set_veto_reference(int file_des) {
int set_burst_mode(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
enum burstMode arg = BURST_OFF;
enum burstMode arg = BURST_INTERNAL;
if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0)
return printSocketReadError();
@ -6506,9 +6508,10 @@ int set_burst_mode(int file_des) {
// only set
if (Server_VerifyLock() == OK) {
switch (arg) {
case BURST_OFF:
case BURST_INTERNAL:
case BURST_EXTERNAL:
case CONTINUOUS_INTERNAL:
case CONTINUOUS_EXTERNAL:
break;
default:
modeNotImplemented("Burst mode", (int)arg);
@ -6533,7 +6536,7 @@ int set_burst_mode(int file_des) {
int get_burst_mode(int file_des) {
ret = OK;
memset(mess, 0, sizeof(mess));
enum burstMode retval = BURST_OFF;
enum burstMode retval = BURST_INTERNAL;
LOG(logDEBUG1, ("Getting burst mode\n"));

View File

@ -1087,7 +1087,8 @@ class Detector {
/** [Gotthard2] */
Result<defs::burstMode> getBurstMode(Positions pos = {});
/** [Gotthard2] BURST_OFF, BURST_INTERNAL (default), BURST_EXTERNAL */
/** [Gotthard2] BURST_INTERNAL (default), BURST_EXTERNAL,
* CONTINUOUS_INTERNAL, CONTINUOUS_EXTERNAL */
void setBurstMode(defs::burstMode value, Positions pos = {});
/** [Gotthard2] */

View File

@ -1687,8 +1687,8 @@ std::string CmdProxy::BurstMode(int action) {
std::ostringstream os;
os << cmd << ' ';
if (action == defs::HELP_ACTION) {
os << "[off or 0, internal or 1, external or 2]\n\t[Gotthard2] Default "
"is burst internal type"
os << "[burst_internal or 0, burst_external or 1, cw_internal or 2, "
"cw_external or 3]\n\t[Gotthard2] Default is burst_internal type"
<< '\n';
} else {
if (action == defs::GET_ACTION) {
@ -1706,14 +1706,17 @@ std::string CmdProxy::BurstMode(int action) {
int ival = StringTo<int>(args[0]);
switch (ival) {
case 0:
t = defs::BURST_OFF;
break;
case 1:
t = defs::BURST_INTERNAL;
break;
case 2:
case 1:
t = defs::BURST_EXTERNAL;
break;
case 2:
t = defs::CONTINUOUS_INTERNAL;
break;
case 3:
t = defs::CONTINUOUS_EXTERNAL;
break;
default:
throw sls::RuntimeError("Unknown burst mode " + args[0]);
}

View File

@ -230,7 +230,7 @@ TEST_CASE("bursts", "[.cmd][.new]") {
}
// continuous mode: reg set to #frames,
// but bursts should return same value
det.setBurstMode(defs::BURST_OFF);
det.setBurstMode(defs::CONTINUOUS_INTERNAL);
det.setNumberOfFrames(2);
{
std::ostringstream oss;
@ -370,18 +370,18 @@ TEST_CASE("burstmode", "[.cmd][.new]") {
auto burststr = sls::ToString(burst);
{
std::ostringstream oss;
proxy.Call("burstmode", {"internal"}, -1, PUT, oss);
REQUIRE(oss.str() == "burstmode internal\n");
proxy.Call("burstmode", {"burst_internal"}, -1, PUT, oss);
REQUIRE(oss.str() == "burstmode burst_internal\n");
}
{
std::ostringstream oss;
proxy.Call("burstmode", {"off"}, -1, PUT, oss);
REQUIRE(oss.str() == "burstmode off\n");
proxy.Call("burstmode", {"cw_internal"}, -1, PUT, oss);
REQUIRE(oss.str() == "burstmode cw_internal\n");
}
{
std::ostringstream oss;
proxy.Call("burstmode", {}, -1, GET, oss);
REQUIRE(oss.str() == "burstmode off\n");
REQUIRE(oss.str() == "burstmode cw_internal\n");
}
for (int i = 0; i != det.size(); ++i) {
det.setBurstMode(burst[i], {i});

View File

@ -1125,9 +1125,9 @@ void Implementation::updateTotalNumberOfFrames() {
int64_t repeats = numberOfTriggers;
// gotthard2: auto mode
// burst mode: (bursts instead of triggers)
// non burst mode: no bursts or triggers
// continuous mode: no bursts or triggers
if (myDetectorType == GOTTHARD2 && timingMode == AUTO_TIMING) {
if (burstMode != BURST_OFF) {
if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
repeats = numberOfBursts;
} else {
repeats = 1;

View File

@ -391,9 +391,10 @@ typedef struct {
* burst mode for gotthard2
*/
enum burstMode {
BURST_OFF,
BURST_INTERNAL,
BURST_EXTERNAL,
CONTINUOUS_INTERNAL,
CONTINUOUS_EXTERNAL,
NUM_BURST_MODES
};
@ -471,7 +472,7 @@ typedef struct {
uint32_t adc10gMask{0};
ROI roi;
uint32_t countermask{0};
burstMode burstType{BURST_OFF};
burstMode burstType{BURST_INTERNAL};
int64_t expTime1Ns{0};
int64_t expTime2Ns{0};
int64_t expTime3Ns{0};

View File

@ -3,10 +3,10 @@
#define APILIB 0x200810
#define APIRECEIVER 0x200810
#define APIGUI 0x200804
#define APICTB 0x200828
#define APIGOTTHARD 0x200828
#define APIGOTTHARD2 0x200908
#define APIJUNGFRAU 0x200828
#define APIMYTHEN3 0x200908
#define APIMOENCH 0x200828
#define APIEIGER 0x200908
#define APICTB 0x200908
#define APIGOTTHARD 0x200908
#define APIGOTTHARD2 0x200908
#define APIJUNGFRAU 0x200908
#define APIMYTHEN3 0x200908
#define APIMOENCH 0x200908

View File

@ -559,12 +559,14 @@ std::string ToString(const std::vector<defs::dacIndex> &vec) {
std::string ToString(const defs::burstMode s) {
switch (s) {
case defs::BURST_OFF:
return std::string("off");
case defs::BURST_INTERNAL:
return std::string("internal");
return std::string("burst_internal");
case defs::BURST_EXTERNAL:
return std::string("external");
return std::string("burst_external");
case defs::CONTINUOUS_INTERNAL:
return std::string("cw_internal");
case defs::CONTINUOUS_EXTERNAL:
return std::string("cw_external");
default:
return std::string("Unknown");
}
@ -922,12 +924,14 @@ template <> defs::dacIndex StringTo(const std::string &s) {
}
template <> defs::burstMode StringTo(const std::string &s) {
if (s == "off")
return defs::BURST_OFF;
if (s == "internal")
if (s == "burst_internal")
return defs::BURST_INTERNAL;
if (s == "external")
if (s == "burst_external")
return defs::BURST_EXTERNAL;
if (s == "cw_internal")
return defs::CONTINUOUS_INTERNAL;
if (s == "cw_external")
return defs::CONTINUOUS_EXTERNAL;
throw sls::RuntimeError("Unknown burst mode " + s);
}