wip
Build on RHEL9 docker image / build (push) Failing after 29s
Build on RHEL8 docker image / build (push) Failing after 35s

This commit is contained in:
2026-03-17 16:03:45 +01:00
parent 8fcff75086
commit 16f8925ffa
9 changed files with 252 additions and 206 deletions
+1 -2
View File
@@ -93,10 +93,9 @@ class Caller {
// applicable
RegisterAddress getRegisterAddress(const std::string &saddr) const;
BitAddress getBitAddress() const;
defs::dacIndex parsePowerIndex(int argIndex);
std::optional<defs::dacIndex> parseIfPowerIndex(int argIndex);
defs::dacIndex parseDacIndex(int argIndex, bool isCtb);
bool parseMV(int argIndex);
defs::dacIndex parsePowerIndex(int argIndex);
FunctionMap functions{
{"list", &Caller::list},
@@ -2757,6 +2757,17 @@ dac:
arg_types: [ std::string ]
- argc: 2
arg_types: [ std::string, bool ]
powerdac:
is_description: true
actions:
PUT:
argc: 2
arg_types: [ std::string, int ]
GET:
argc: 1
arg_types: [ std::string ]
v_limit:
+31 -28
View File
@@ -535,9 +535,7 @@ class Detector {
Result<int> getDAC(defs::dacIndex index, bool mV = false,
Positions pos = {}) const;
/** Sets dac in dac units or mV
* [Ctb][Xilinx Ctb] also includes V_LIMIT, V_POWER_A, V_POWER_B, V_POWER_C,
* V_POWER_D, V_POWER_IO, V_POWER_CHIP (get only)*/
/** Sets dac in dac units or mV1 */
void setDAC(defs::dacIndex index, int value, bool mV = false,
Positions pos = {});
@@ -1632,20 +1630,40 @@ class Detector {
Result<int> getSYNCClock(Positions pos = {}) const;
/** gets list of power enums */
std::vector<defs::dacIndex> getPowerList() const;
/** gets list of slow adc enums */
std::vector<defs::dacIndex> getSlowADCList() const;
std::vector<defs::powerIndex> getPowerList() const;
/** [CTB][Xilinx CTB] */
Result<bool> isPowerEnabled(defs::dacIndex index, Positions pos = {}) const;
int getPowerDAC(defs::powerIndex index) const;
/** [CTB][Xilinx CTB] Options: V_POWE_A, V_POWER_B, V_POWER_C,
* V_POWER_D, V_POWER_IO */
void setPowerDAC(defs::powerIndex index, int value);
/** [CTB][Xilinx CTB] */
bool isPowerEnabled(defs::powerIndex index) const;
/**
* [Ctb][Xilinx CTB] Options: V_POWER_A, V_POWER_B, V_POWER_C,
* V_POWER_D, V_POWER_IO
*/
void setPowerEnabled(const std::vector<defs::dacIndex> &indices,
bool enable, Positions pos = {});
void setPowerEnabled(const std::vector<defs::powerIndex> &indices,
bool enable);
/**
* [CTB] mV
* Options: V_POWER_A, V_POWER_B, V_POWER_C, V_POWER_D, V_POWER_IO */
int getMeasuredPower(defs::powerIndex index) const;
/**
* [CTB] mA
* Options: I_POWER_A, I_POWER_B, I_POWER_C, I_POWER_D, I_POWER_IO */
int getMeasuredCurrent(defs::powerIndex index) const;
/** [CTB][Xilinx CTB] gets list of slow adc enums */
std::vector<defs::dacIndex> getSlowADCList() const;
/** [CTB][Xilinx CTB] Options: SLOW_ADC0 - SLOW_ADC7 in uV */
Result<int> getSlowADC(defs::dacIndex index, Positions pos = {}) const;
/**
* [CTB] Options: [0- 4] or [1V, 1.14V, 1.33V, 1.6V, 2V]
@@ -1701,21 +1719,6 @@ class Detector {
/** [CTB] in MHz, [XCTB] in kHz */
void setDBITClock(int value_in_MHz, Positions pos = {});
/**
* [CTB] mV
* Options: V_POWER_A, V_POWER_B, V_POWER_C, V_POWER_D, V_POWER_IO */
Result<int> getMeasuredPower(defs::dacIndex index,
Positions pos = {}) const;
/**
* [CTB] mA
* Options: I_POWER_A, I_POWER_B, I_POWER_C, I_POWER_D, I_POWER_IO */
Result<int> getMeasuredCurrent(defs::dacIndex index,
Positions pos = {}) const;
/** [CTB][Xilinx CTB] Options: SLOW_ADC0 - SLOW_ADC7 in uV */
Result<int> getSlowADC(defs::dacIndex index, Positions pos = {}) const;
/** [CTB] */
Result<int> getExternalSamplingSource(Positions pos = {}) const;
@@ -1818,13 +1821,13 @@ class Detector {
std::vector<std::string> getPowerNames() const;
/** [CTB][Xilinx CTB] */
defs::dacIndex getPowerIndex(const std::string &name) const;
defs::powerIndex getPowerIndex(const std::string &name) const;
/** [CTB][Xilinx CTB] */
void setPowerName(const defs::dacIndex i, const std::string &name);
void setPowerName(const defs::powerIndex i, const std::string &name);
/** [CTB][Xilinx CTB] */
std::string getPowerName(const defs::dacIndex i) const;
std::string getPowerName(const defs::powerIndex i) const;
/** [CTB][Xilinx CTB] */
void setSlowADCNames(const std::vector<std::string> names);
+75 -35
View File
@@ -1854,37 +1854,6 @@ std::string Caller::dac(int action) {
return os.str();
}
defs::dacIndex Caller::parsePowerIndex(int argIndex) {
auto res = parseIfPowerIndex(argIndex);
if (!res.has_value()) {
throw RuntimeError("Invalid power name. Power name can be v_a, v_b, "
"v_c, v_d, v_io, v_chip or any names set using "
"powername command.");
}
return res.value();
}
std::optional<defs::dacIndex> Caller::parseIfPowerIndex(int argIndex) {
if (argIndex >= (int)args.size()) {
throw RuntimeError("Invalid arguments. Power name is required.");
}
auto arg = args[argIndex];
// power default names
if (is_int(arg) || arg == "v_a" || arg == "v_b" || arg == "v_c" ||
arg == "v_d" || arg == "v_io" || arg == "v_chip") {
return std::make_optional(StringTo<defs::dacIndex>(arg));
}
// power name
auto names = det->getPowerNames();
auto it = std::find(names.begin(), names.end(), arg);
if (it != names.end()) {
return std::make_optional(det->getPowerIndex(arg));
}
return std::nullopt;
}
defs::dacIndex Caller::parseDacIndex(int argIndex, bool isCtb) {
if (argIndex >= (int)args.size()) {
throw RuntimeError("Invalid arguments. DAC index is required.");
@@ -1892,10 +1861,9 @@ defs::dacIndex Caller::parseDacIndex(int argIndex, bool isCtb) {
auto arg = args[argIndex];
if (isCtb) {
// power dacs
auto res = parseIfPowerIndex(argIndex);
if (res.has_value()) {
return res.value();
// dac index
if (is_int(arg)) {
return StringTo<defs::dacIndex>(arg);
}
// dac name
return det->getDacIndex(arg);
@@ -1922,6 +1890,78 @@ bool Caller::parseMV(int argIndex) {
return false;
}
std::string Caller::powerdac(int action) {
std::ostringstream os;
if (action == defs::HELP_ACTION) {
os << "[powername][mV value]\n\t[Ctb][Xilinx Ctb] Controls the dac "
"used for Power supply. Default names for powername are v_a, "
"v_b, v_c, v_d, v_io, v_chip(v_chip only applies to Ctb, not "
"Xilinx_Ctb). If custom names are assigned using the 'powername' "
"command, those names could be used instead instead of the "
"defaults. By default, all are set to minimum values. \n\t[Ctb] "
"v_chip can also be queried to get the vchip dac value, although "
"its rail cannot be enabled or disabled by the user. It is "
"enabled by default. Its dac value is automatically updated "
"whenever a power dac is modified. It is then set to the max of "
"power dacs + 200mV."
<< '\n';
return os.str();
}
auto detType = det->getDetectorType().squash(defs::GENERIC);
if (detType != defs::CHIPTESTBOARD &&
detType != defs::XILINX_CHIPTESTBOARD) {
throw RuntimeError("This command is only applicable for ChipTestBoard "
"and Xilinx ChipTestBoard.");
}
if (det_id != -1) {
throw RuntimeError("Cannot use powerdac at module level.");
}
auto index = parsePowerIndex(0);
if (action == defs::GET_ACTION) {
auto t = det->getPowerDAC(index);
os << args[0] << ' ' << OutString(t) << '\n';
}
else if (action == defs::PUT_ACTION) {
if (args.size() != 2) {
WrongNumberOfParameters(2);
}
auto val = StringTo<int>(args[1]);
det->setPowerDAC(index, val);
os << args[0] << ' ' << args[1] << '\n';
} else {
throw RuntimeError("Unknown action");
}
return os.str();
}
defs::dacIndex Caller::parsePowerIndex(int argIndex) {
if (argIndex >= (int)args.size()) {
throw RuntimeError("Invalid arguments. Power name is required.");
}
auto arg = args[argIndex];
// power default names
if (is_int(arg) || arg == "v_a" || arg == "v_b" || arg == "v_c" ||
arg == "v_d" || arg == "v_io" || arg == "v_chip") {
return StringTo<defs::dacIndex>(arg);
}
// power name
auto names = det->getPowerNames();
auto it = std::find(names.begin(), names.end(), arg);
if (it != names.end()) {
return det->getPowerIndex(arg);
}
throw RuntimeError(
"Unknown power name '" + arg +
"'. Use 'powername' command to see defined power names.");
}
std::string Caller::v_limit(int action) {
std::ostringstream os;
-42
View File
@@ -283,48 +283,6 @@ std::string GetHelpDac(std::string dac) {
if (dac == "vtgstv") {
return std::string("");
}
if (dac == "v_a") {
return std::string(
"[mV value] mV \n\t[Ctb][Xilinx Ctb] Dac for Power supply a. Can "
"only be set in mV. Default to minimum values. To switch off must "
"switch off power rails using 'power' command.\n\t[Ctb] Changes "
"vchip (max of power supply voltages + 200mV).");
}
if (dac == "v_b") {
return std::string(
"[mV value] mV \n\t[Ctb][Xilinx Ctb] Dac for Power supply b. Can "
"only be set in mV. Default to minimum values. To switch off must "
"switch off power rails using 'power' command.\n\t[Ctb] Changes "
"vchip (max of power supply voltages + 200mV).");
}
if (dac == "v_c") {
return std::string(
"[mV value] mV \n\t[Ctb][Xilinx Ctb] Dac for Power supply c. Can "
"only be set in mV. Default to minimum values. To switch off must "
"switch off power rails using 'power' command.\n\t[Ctb] Changes "
"vchip (max of power supply voltages + 200mV).");
}
if (dac == "v_d") {
return std::string(
"[mV value] mV \n\t[Ctb][Xilinx Ctb] Dac for Power supply d. Can "
"only be set in mV. Default to minimum values. To switch off must "
"switch off power rails using 'power' command.\n\t[Ctb] Changes "
"vchip (max of power supply voltages + 200mV).");
}
if (dac == "v_io") {
return std::string(
"[mV value] mV \n\t[Ctb][Xilinx Ctb] Dac for Power supply IO. Can "
"only be set in mV. Default to minimum values. To switch off must "
"switch off power rails using 'power' command.\n\t[Ctb] Changes "
"vchip (max of power supply voltages + 200mV).");
}
if (dac == "v_chip") {
return std::string("mV \n\t[Ctb] Dac for Vchip. Can only get. Default "
"to minimum values. Vchip is set in the background "
"when v_a, b, c, d or io are set.");
}
throw sls::RuntimeError("Unknown dac command");
}
@@ -315,7 +315,7 @@ TEST_CASE("powername", "[.detectorintegration]") {
if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
defs::dacIndex ind = static_cast<defs::dacIndex>(2 + defs::V_POWER_A);
defs::powerIndex ind = static_cast<defs::powerIndex>(2);
std::string str_power_index = "2";
auto prev = det.getPowerName(ind);
@@ -350,7 +350,7 @@ TEST_CASE("powerindex", "[.detectorintegration]") {
if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
defs::dacIndex ind = static_cast<defs::dacIndex>(2 + defs::V_POWER_A);
defs::powerIndex ind = static_cast<defs::powerIndex>(2);
std::string str_power_index = "2";
// 1 arg throw
@@ -593,15 +593,38 @@ TEST_CASE("dac", "[.detectorintegration][dacs]") {
caller.call("dac", {std::to_string(idac), "-1"}, -1, PUT));
}
// power dacs
// power dacs (shouldnt work anymore. TODO: remove after testing)
REQUIRE_THROWS(caller.call("dac", {"v_a", "mV"}, -1, GET));
}
}
TEST_CASE("powerdac", "[.detectorintegration][dacs]") {
Detector det;
Caller caller(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::CHIPTESTBOARD ||
det_type == defs::XILINX_CHIPTESTBOARD) {
if (det.isVirtualDetectorServer().tsquash(
"Inconsistent virtual servers")) {
// test only get of vchip
if (det_type == defs::CHIPTESTBOARD) {
REQUIRE_THROWS(
caller.call("powerdac", {"v_chip", "1700", "mV"}, -1, PUT));
REQUIRE_THROWS(
caller.call("powerdac", {"v_chip", "mV"}, -1, GET));
REQUIRE_NOTHROW(caller.call("powerdac", {"v_chip"}, -1, GET));
} else {
REQUIRE_THROWS(caller.call("powerdac", {"v_chip"}, -1, GET));
}
// other power dacs
std::vector<std::string> names{"v_a", "v_b", "v_c", "v_d", "v_io"};
std::vector<defs::dacIndex> indices{
std::vector<defs::powerIndex> indices{
defs::V_POWER_A, defs::V_POWER_B, defs::V_POWER_C,
defs::V_POWER_D, defs::V_POWER_IO};
for (size_t iPower = 0; iPower < names.size(); ++iPower) {
auto prev_val = det.getDAC(indices[iPower], true);
auto prev_val = det.getPowerDAC(indices[iPower]);
auto prev_val_power = det.isPowerEnabled(indices[iPower]);
// turn them off to be able to set the power dacs without issue
@@ -609,100 +632,90 @@ TEST_CASE("dac", "[.detectorintegration][dacs]") {
// this is the first command touching power dacs, should not be
// -100
if (det_type == defs::XILINX_CHIPTESTBOARD ||
det_type == defs::CHIPTESTBOARD) {
REQUIRE(prev_val.any(-100) == false);
REQUIRE(prev_val.any(-1) == false);
REQUIRE(prev_val.any(0) == false);
}
REQUIRE(prev_val.any(-100) == false);
REQUIRE(prev_val.any(-1) == false);
REQUIRE(prev_val.any(0) == false);
REQUIRE_THROWS(
caller.call("dac", {names[iPower], "-2"}, -1, PUT));
caller.call("powerdac", {names[iPower], "-2"}, -1, PUT));
REQUIRE_THROWS(
caller.call("dac", {names[iPower], "-100"}, -1, PUT));
caller.call("powerdac", {names[iPower], "-100"}, -1, PUT));
REQUIRE_THROWS(
caller.call("dac", {names[iPower], "-1"}, -1, PUT));
caller.call("powerdac", {names[iPower], "-1"}, -1, PUT));
REQUIRE_THROWS(
caller.call("dac", {names[iPower], "0"}, -1, PUT));
caller.call("powerdac", {names[iPower], "0"}, -1, PUT));
REQUIRE_THROWS(
caller.call("dac", {names[iPower], "4096"}, -1, PUT));
// not mV
caller.call("powerdac", {names[iPower], "4096"}, -1, PUT));
// dont need mV
REQUIRE_THROWS(caller.call(
"powerdac", {names[iPower], "1200", "mV"}, -1, PUT));
REQUIRE_THROWS(
caller.call("dac", {names[iPower], "1200"}, -1, PUT));
REQUIRE_THROWS(caller.call("dac", {names[iPower]}, -1, GET));
caller.call("powerdac", {names[iPower], "mV"}, -1, GET));
// min
if (names[iPower] == "v_io")
REQUIRE_THROWS(caller.call(
"dac", {names[iPower], "1199", "mV"}, -1, PUT));
"powerdac", {names[iPower], "1199"}, -1, PUT));
else {
if (det_type == defs::XILINX_CHIPTESTBOARD) {
REQUIRE_THROWS(caller.call(
"dac", {names[iPower], "1040", "mV"}, -1, PUT));
"powerdac", {names[iPower], "1040"}, -1, PUT));
} else {
REQUIRE_THROWS(caller.call(
"dac", {names[iPower], "635", "mV"}, -1, PUT));
"powerdac", {names[iPower], "635"}, -1, PUT));
}
}
// max
if (det_type == defs::XILINX_CHIPTESTBOARD) {
REQUIRE_THROWS(caller.call(
"dac", {names[iPower], "2662", "mV"}, -1, PUT));
"powerdac", {names[iPower], "2662"}, -1, PUT));
} else {
REQUIRE_THROWS(caller.call(
"dac", {names[iPower], "2469", "mV"}, -1, PUT));
"powerdac", {names[iPower], "2469"}, -1, PUT));
}
{
std::ostringstream oss1, oss2;
caller.call("dac", {names[iPower], "1200", "mV"}, -1, PUT,
caller.call("powerdac", {names[iPower], "1200"}, -1, PUT,
oss1);
REQUIRE(oss1.str() ==
"dac " + names[iPower] + " 1200 mV\n");
caller.call("dac", {names[iPower], "mV"}, -1, GET, oss2);
REQUIRE(oss2.str() ==
"dac " + names[iPower] + " 1200 mV\n");
REQUIRE(oss1.str() == "dac " + names[iPower] + " 1200\n");
caller.call("powerdac", {names[iPower]}, -1, GET, oss2);
REQUIRE(oss2.str() == "dac " + names[iPower] + " 1200\n");
}
{
// power name
det.setPowerName(indices[iPower],
"pwrname_" + names[iPower]);
std::ostringstream oss1, oss2;
caller.call("dac",
{"pwrname_" + names[iPower], "1200", "mV"}, -1,
PUT, oss1);
caller.call("powerdac",
{"pwrname_" + names[iPower], "1200"}, -1, PUT,
oss1);
REQUIRE(oss1.str() ==
"dac pwrname_" + names[iPower] + " 1200 mV\n");
caller.call("dac", {"pwrname_" + names[iPower], "mV"}, -1,
"dac pwrname_" + names[iPower] + " 1200\n");
caller.call("powerdac", {"pwrname_" + names[iPower]}, -1,
GET, oss2);
REQUIRE(oss2.str() ==
"dac pwrname_" + names[iPower] + " 1200 mV\n");
}
// throw if trying to set dac when power is on
// trying to set dac when power is on
{
det.setPowerEnabled(std::vector{indices[iPower]}, true);
REQUIRE_THROWS(caller.call(
"dac", {names[iPower], "1200", "mV"}, -1, PUT));
std::ostringstream oss1, oss2;
caller.call("powerdac", {names[iPower], "1200"}, -1, PUT,
oss1);
REQUIRE(oss1.str() == "dac " + names[iPower] + " 1200\n");
caller.call("powerdac", {names[iPower]}, -1, GET, oss2);
REQUIRE(oss2.str() == "dac " + names[iPower] + " 1200\n");
}
// Reset all dacs to previous value
for (int imod = 0; imod != det.size(); ++imod) {
det.setPowerEnabled(std::vector{indices[iPower]}, false,
{imod});
det.setDAC(indices[iPower], prev_val[imod], true, {imod});
det.setPowerEnabled(std::vector{indices[iPower]},
prev_val_power[imod], {imod});
}
}
// test get of vchip
if (det_type == defs::CHIPTESTBOARD) {
REQUIRE_THROWS(
caller.call("dac", {"v_chip", "1700", "mV"}, -1, PUT));
REQUIRE_THROWS(caller.call("dac", {"v_chip"}, -1, GET));
REQUIRE_NOTHROW(caller.call("dac", {"v_chip", "mV"}, -1, GET));
} else {
REQUIRE_THROWS(caller.call("dac", {"v_chip", "mV"}, -1, GET));
// Reset all dacs to previous value
det.setPowerDAC(indices[iPower], prev_val, true);
det.setPowerEnabled(std::vector{indices[iPower]},
prev_val_power);
}
}
} else {
REQUIRE_THROWS(caller.call("powerdac", {"v_a"}, -1, GET));
}
}
@@ -1178,9 +1191,6 @@ TEST_CASE("v_abcd", "[.detectorintegration]") {
// removed in favor of "dac" and "power" commands
std::vector<std::string> cmds{"v_a", "v_b", "v_c", "v_d", "v_io", "v_chip"};
std::vector<defs::dacIndex> indices{defs::V_POWER_A, defs::V_POWER_B,
defs::V_POWER_C, defs::V_POWER_D,
defs::V_POWER_IO, defs::V_POWER_CHIP};
for (size_t i = 0; i < cmds.size(); ++i) {
try {
@@ -1201,15 +1211,11 @@ TEST_CASE("power", "[.detectorintegration]") {
det_type == defs::XILINX_CHIPTESTBOARD) {
std::vector<std::string> cmds{"v_a", "v_b", "v_c", "v_d", "v_io"};
std::vector<defs::dacIndex> indices{defs::V_POWER_A, defs::V_POWER_B,
defs::V_POWER_C, defs::V_POWER_D,
defs::V_POWER_IO};
auto indices = det->getPowerList();
std::vector<bool> prev_val(cmds.size());
for (size_t iPower = 0; iPower < cmds.size(); ++iPower) {
prev_val[iPower] = det.isPowerEnabled(indices[iPower])
.tsquash("Inconsistent power enabled state");
det.setPowerEnabled(std::vector{indices[iPower]}, false);
}
REQUIRE_THROWS(caller.call("power", {"vrandom"}, -1, GET));
+3
View File
@@ -37,6 +37,8 @@ std::string ToString(const defs::externalSignalFlag s);
std::string ToString(const defs::readoutMode s);
std::string ToString(const defs::dacIndex s);
std::string ToString(const std::vector<defs::dacIndex> &vec);
std::string ToString(const defs::powerIndex s);
std::string ToString(const std::vector<defs::powerIndex> &vec);
std::string ToString(const defs::burstMode s);
std::string ToString(const defs::timingSourceType s);
std::string ToString(const defs::M3_GainCaps s);
@@ -317,6 +319,7 @@ template <> defs::fileFormat StringTo(const std::string &s);
template <> defs::externalSignalFlag StringTo(const std::string &s);
template <> defs::readoutMode StringTo(const std::string &s);
template <> defs::dacIndex StringTo(const std::string &s);
template <> defs::powerIndex StringTo(const std::string &s);
template <> defs::burstMode StringTo(const std::string &s);
template <> defs::timingSourceType StringTo(const std::string &s);
template <> defs::M3_GainCaps StringTo(const std::string &s);
+14 -12
View File
@@ -396,18 +396,6 @@ typedef struct {
TEMPERATURE_FPGA2,
TEMPERATURE_FPGA3,
TRIMBIT_SCAN,
V_POWER_A = 100,
V_POWER_B = 101,
V_POWER_C = 102,
V_POWER_D = 103,
V_POWER_IO = 104,
V_POWER_CHIP = 105,
I_POWER_A = 106,
I_POWER_B = 107,
I_POWER_C = 108,
I_POWER_D = 109,
I_POWER_IO = 110,
V_LIMIT = 111,
SLOW_ADC0 = 1000,
SLOW_ADC1,
SLOW_ADC2,
@@ -419,6 +407,20 @@ typedef struct {
SLOW_ADC_TEMP
};
enum powerIndex {
V_POWER_A,
V_POWER_B,
V_POWER_C,
V_POWER_D,
V_POWER_IO,
V_POWER_CHIP,
I_POWER_A,
I_POWER_B,
I_POWER_C,
I_POWER_D,
I_POWER_IO
};
/**
detector settings indexes
*/
+48 -24
View File
@@ -519,18 +519,6 @@ std::string ToString(const defs::dacIndex s) {
return std::string("vipre_cds");
case defs::IBIAS_SFP:
return std::string("ibias_sfp");
case defs::V_POWER_A:
return std::string("v_a");
case defs::V_POWER_B:
return std::string("v_b");
case defs::V_POWER_C:
return std::string("v_c");
case defs::V_POWER_D:
return std::string("v_d");
case defs::V_POWER_IO:
return std::string("v_io");
case defs::V_POWER_CHIP:
return std::string("v_chip");
case defs::TRIMBIT_SCAN:
return std::string("trimbits");
case defs::HIGH_VOLTAGE:
@@ -575,6 +563,38 @@ std::string ToString(const std::vector<defs::dacIndex> &vec) {
return os.str();
}
std::string ToString(const defs::powerIndex s) {
switch (s) {
case defs::V_POWER_A:
return std::string("v_a");
case defs::V_POWER_B:
return std::string("v_b");
case defs::V_POWER_C:
return std::string("v_c");
case defs::V_POWER_D:
return std::string("v_d");
case defs::V_POWER_IO:
return std::string("v_io");
case defs::V_POWER_CHIP:
return std::string("v_chip");
default:
return std::string("Unknown");
}
}
std::string ToString(const std::vector<defs::powerIndex> &vec) {
std::ostringstream os;
os << '[';
if (!vec.empty()) {
auto it = vec.begin();
os << ToString(*it++);
while (it != vec.end())
os << ", " << ToString(*it++);
}
os << ']';
return os.str();
}
std::string ToString(const defs::burstMode s) {
switch (s) {
case defs::BURST_INTERNAL:
@@ -1012,18 +1032,6 @@ template <> defs::dacIndex StringTo(const std::string &s) {
return defs::VIPRE_CDS;
if (s == "ibias_sfp")
return defs::IBIAS_SFP;
if (s == "v_a")
return defs::V_POWER_A;
if (s == "v_b")
return defs::V_POWER_B;
if (s == "v_c")
return defs::V_POWER_C;
if (s == "v_d")
return defs::V_POWER_D;
if (s == "v_io")
return defs::V_POWER_IO;
if (s == "v_chip")
return defs::V_POWER_CHIP;
if (s == "trimbits")
return defs::TRIMBIT_SCAN;
if (s == "highvoltage")
@@ -1053,6 +1061,22 @@ template <> defs::dacIndex StringTo(const std::string &s) {
throw RuntimeError("Unknown dac Index " + s);
}
template <> defs::powerIndex StringTo(const std::string &s) {
if (s == "v_a")
return defs::V_POWER_A;
if (s == "v_b")
return defs::V_POWER_B;
if (s == "v_c")
return defs::V_POWER_C;
if (s == "v_d")
return defs::V_POWER_D;
if (s == "v_io")
return defs::V_POWER_IO;
if (s == "v_chip")
return defs::V_POWER_CHIP;
throw RuntimeError("Unknown power Index " + s);
}
template <> defs::burstMode StringTo(const std::string &s) {
if (s == "burst_internal")
return defs::BURST_INTERNAL;