From 1f46266183bdcbbb8df9e80fbf809042205731a1 Mon Sep 17 00:00:00 2001 From: Alice Date: Wed, 1 Oct 2025 20:20:29 +0200 Subject: [PATCH] clang-format --- include/aare/RawMasterFile.hpp | 9 +- include/aare/defs.hpp | 228 +++++++++++++++-------------- src/RawFile.test.cpp | 6 +- src/RawMasterFile.cpp | 37 +++-- src/RawMasterFile.test.cpp | 11 +- src/defs.cpp | 260 +++++++++++++++++++++------------ 6 files changed, 315 insertions(+), 236 deletions(-) diff --git a/include/aare/RawMasterFile.hpp b/include/aare/RawMasterFile.hpp index 3454a30..e741f01 100644 --- a/include/aare/RawMasterFile.hpp +++ b/include/aare/RawMasterFile.hpp @@ -42,7 +42,7 @@ class RawFileNameComponents { class ScanParameters { bool m_enabled = false; - DACIndex m_dac = DACIndex::DAC_2; + DACIndex m_dac = DACIndex::DAC_2; int m_start = 0; int m_stop = 0; int m_step = 0; @@ -50,7 +50,8 @@ class ScanParameters { public: ScanParameters(const std::string &par); - ScanParameters(const bool enabled, const DACIndex dac, const int start, const int stop, const int step, const int64_t settleTime); + ScanParameters(const bool enabled, const DACIndex dac, const int start, + const int stop, const int step, const int64_t settleTime); ScanParameters() = default; ScanParameters(const ScanParameters &) = default; ScanParameters &operator=(const ScanParameters &) = default; @@ -59,9 +60,9 @@ class ScanParameters { int stop() const; int step() const; DACIndex dac() const; - bool enabled() const; + bool enabled() const; int64_t settleTime() const; - void increment_stop(); + void increment_stop(); }; /** diff --git a/include/aare/defs.hpp b/include/aare/defs.hpp index ab37f33..7ae6269 100644 --- a/include/aare/defs.hpp +++ b/include/aare/defs.hpp @@ -216,118 +216,119 @@ enum class DetectorType { }; /** -* @brief detector dacs indexes -*/ + * @brief Enum class to define the Digital to Analog converter + * The values are the same as in slsDetectorPackage + */ enum DACIndex { - DAC_0, - DAC_1, - DAC_2, - DAC_3, - DAC_4, - DAC_5, - DAC_6, - DAC_7, - DAC_8, - DAC_9, - DAC_10, - DAC_11, - DAC_12, - DAC_13, - DAC_14, - DAC_15, - DAC_16, - DAC_17, - VSVP, - VTRIM, - VRPREAMP, - VRSHAPER, - VSVN, - VTGSTV, - VCMP_LL, - VCMP_LR, - VCAL, - VCMP_RL, - RXB_RB, - RXB_LB, - VCMP_RR, - VCP, - VCN, - VISHAPER, - VTHRESHOLD, - IO_DELAY, - VREF_DS, - VOUT_CM, - VIN_CM, - VREF_COMP, - VB_COMP, - VDD_PROT, - VIN_COM, - VREF_PRECH, - VB_PIXBUF, - VB_DS, - VREF_H_ADC, - VB_COMP_FE, - VB_COMP_ADC, - VCOM_CDS, - VREF_RSTORE, - VB_OPA_1ST, - VREF_COMP_FE, - VCOM_ADC1, - VREF_L_ADC, - VREF_CDS, - VB_CS, - VB_OPA_FD, - VCOM_ADC2, - VCASSH, - VTH2, - VRSHAPER_N, - VIPRE_OUT, - VTH3, - VTH1, - VICIN, - VCAS, - VCAL_N, - VIPRE, - VCAL_P, - VDCSH, - VBP_COLBUF, - VB_SDA, - VCASC_SFP, - VIPRE_CDS, - IBIAS_SFP, - ADC_VPP, - HIGH_VOLTAGE, - TEMPERATURE_ADC, - TEMPERATURE_FPGA, - TEMPERATURE_FPGAEXT, - TEMPERATURE_10GE, - TEMPERATURE_DCDC, - TEMPERATURE_SODL, - TEMPERATURE_SODR, - 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, - SLOW_ADC3, - SLOW_ADC4, - SLOW_ADC5, - SLOW_ADC6, - SLOW_ADC7, - SLOW_ADC_TEMP + DAC_0, + DAC_1, + DAC_2, + DAC_3, + DAC_4, + DAC_5, + DAC_6, + DAC_7, + DAC_8, + DAC_9, + DAC_10, + DAC_11, + DAC_12, + DAC_13, + DAC_14, + DAC_15, + DAC_16, + DAC_17, + VSVP, + VTRIM, + VRPREAMP, + VRSHAPER, + VSVN, + VTGSTV, + VCMP_LL, + VCMP_LR, + VCAL, + VCMP_RL, + RXB_RB, + RXB_LB, + VCMP_RR, + VCP, + VCN, + VISHAPER, + VTHRESHOLD, + IO_DELAY, + VREF_DS, + VOUT_CM, + VIN_CM, + VREF_COMP, + VB_COMP, + VDD_PROT, + VIN_COM, + VREF_PRECH, + VB_PIXBUF, + VB_DS, + VREF_H_ADC, + VB_COMP_FE, + VB_COMP_ADC, + VCOM_CDS, + VREF_RSTORE, + VB_OPA_1ST, + VREF_COMP_FE, + VCOM_ADC1, + VREF_L_ADC, + VREF_CDS, + VB_CS, + VB_OPA_FD, + VCOM_ADC2, + VCASSH, + VTH2, + VRSHAPER_N, + VIPRE_OUT, + VTH3, + VTH1, + VICIN, + VCAS, + VCAL_N, + VIPRE, + VCAL_P, + VDCSH, + VBP_COLBUF, + VB_SDA, + VCASC_SFP, + VIPRE_CDS, + IBIAS_SFP, + ADC_VPP, + HIGH_VOLTAGE, + TEMPERATURE_ADC, + TEMPERATURE_FPGA, + TEMPERATURE_FPGAEXT, + TEMPERATURE_10GE, + TEMPERATURE_DCDC, + TEMPERATURE_SODL, + TEMPERATURE_SODR, + 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, + SLOW_ADC3, + SLOW_ADC4, + SLOW_ADC5, + SLOW_ADC6, + SLOW_ADC7, + SLOW_ADC_TEMP }; enum class TimingMode { Auto, Trigger }; @@ -346,7 +347,8 @@ template <> FrameDiscardPolicy StringTo(const std::string & /*mode*/); using DataTypeVariants = std::variant; -constexpr uint16_t ADC_MASK = 0x3FFF; // used to mask out the gain bits in Jungfrau +constexpr uint16_t ADC_MASK = + 0x3FFF; // used to mask out the gain bits in Jungfrau /** * @brief Convert a string to a DACIndex @@ -354,6 +356,6 @@ constexpr uint16_t ADC_MASK = 0x3FFF; // used to mask out the gain bits in Jungf * @return DACIndex * @throw invalid argument error if the string does not match any DACIndex */ -template<> DACIndex StringTo(const std::string &arg); +template <> DACIndex StringTo(const std::string &arg); } // namespace aare \ No newline at end of file diff --git a/src/RawFile.test.cpp b/src/RawFile.test.cpp index 603738a..e72405c 100644 --- a/src/RawFile.test.cpp +++ b/src/RawFile.test.cpp @@ -99,7 +99,8 @@ TEST_CASE("Read data from a jungfrau 500k single port raw file", } TEST_CASE("Read frame numbers from a raw file", "[.with-data]") { - auto fpath = test_data_path() / "raw/eiger" / "eiger_500k_16bit_master_0.json"; + auto fpath = + test_data_path() / "raw/eiger" / "eiger_500k_16bit_master_0.json"; REQUIRE(std::filesystem::exists(fpath)); // we know this file has 3 frames with frame numbers 14, 15, 16 @@ -288,8 +289,7 @@ TEST_CASE("check find_geometry", "[.with-data]") { } } -TEST_CASE("Open multi module file with ROI", - "[.with-data]") { +TEST_CASE("Open multi module file with ROI", "[.with-data]") { auto fpath = test_data_path() / "raw/SingleChipROI/Data_master_0.json"; REQUIRE(std::filesystem::exists(fpath)); diff --git a/src/RawMasterFile.cpp b/src/RawMasterFile.cpp index b9d1385..6d39f16 100644 --- a/src/RawMasterFile.cpp +++ b/src/RawMasterFile.cpp @@ -64,7 +64,11 @@ const std::string &RawFileNameComponents::base_name() const { const std::string &RawFileNameComponents::ext() const { return m_ext; } int RawFileNameComponents::file_index() const { return m_file_index; } -ScanParameters::ScanParameters(const bool enabled, const DACIndex dac, const int start, const int stop, const int step, const int64_t settleTime) : m_enabled(enabled), m_dac(dac), m_start(start), m_stop(stop), m_step(step), m_settleTime(settleTime) {}; +ScanParameters::ScanParameters(const bool enabled, const DACIndex dac, + const int start, const int stop, const int step, + const int64_t settleTime) + : m_enabled(enabled), m_dac(dac), m_start(start), m_stop(stop), + m_step(step), m_settleTime(settleTime){}; // "[enabled\ndac dac 4\nstart 500\nstop 2200\nstep 5\nsettleTime 100us\n]" ScanParameters::ScanParameters(const std::string &par) { @@ -91,7 +95,7 @@ void ScanParameters::increment_stop() { m_stop += 1; } int ScanParameters::step() const { return m_step; } DACIndex ScanParameters::dac() const { return m_dac; } bool ScanParameters::enabled() const { return m_enabled; } -int64_t ScanParameters::settleTime() const {return m_settleTime; } +int64_t ScanParameters::settleTime() const { return m_settleTime; } RawMasterFile::RawMasterFile(const std::filesystem::path &fpath) : m_fnc(fpath) { @@ -185,8 +189,9 @@ void RawMasterFile::parse_json(const std::filesystem::path &fpath) { j["Geometry"]["x"]}; // TODO: isnt it only available for version > 7.1? // - try block default should be 1x1 - m_image_size_in_bytes = v < 8.0 ? j["Image Size in bytes"] : j["Image Size"]; - + m_image_size_in_bytes = + v < 8.0 ? j["Image Size in bytes"] : j["Image Size"]; + m_frames_in_file = j["Frames in File"]; m_pixels_y = j["Pixels"]["y"]; m_pixels_x = j["Pixels"]["x"]; @@ -259,13 +264,18 @@ void RawMasterFile::parse_json(const std::filesystem::path &fpath) { // keep the optional empty } try { - if(v < 8.0) { + if (v < 8.0) { std::string scan_parameters = j.at("Scan Parameters"); m_scan_parameters = ScanParameters(scan_parameters); - } - else { + } else { auto json_obj = j.at("Scan Parameters"); - m_scan_parameters = ScanParameters(json_obj.at("enable").get(), static_cast(json_obj.at("dacInd").get()), json_obj.at("start offset").get(), json_obj.at("stop offset").get(), json_obj.at("step size").get(), json_obj.at("dac settle time ns").get()); + m_scan_parameters = ScanParameters( + json_obj.at("enable").get(), + static_cast(json_obj.at("dacInd").get()), + json_obj.at("start offset").get(), + json_obj.at("stop offset").get(), + json_obj.at("step size").get(), + json_obj.at("dac settle time ns").get()); } if (v < 7.21) { m_scan_parameters @@ -283,18 +293,17 @@ void RawMasterFile::parse_json(const std::filesystem::path &fpath) { else if (m_type == DetectorType::Eiger) { m_udp_interfaces_per_module = {1, 2}; } - } + } try { ROI tmp_roi; - if(v < 8.0) { + if (v < 8.0) { auto obj = j.at("Receiver Roi"); tmp_roi.xmin = obj.at("xmin"); tmp_roi.xmax = obj.at("xmax"); tmp_roi.ymin = obj.at("ymin"); tmp_roi.ymax = obj.at("ymax"); - } - else { - //TODO: for now only handle single ROI + } else { + // TODO: for now only handle single ROI auto obj = j.at("Receiver Rois"); tmp_roi.xmin = obj[0].at("xmin"); tmp_roi.xmax = obj[0].at("xmax"); @@ -315,7 +324,7 @@ void RawMasterFile::parse_json(const std::filesystem::path &fpath) { } catch (const json::out_of_range &e) { LOG(TLogLevel::logERROR) << e.what() << std::endl; - // leave the optional empty + // leave the optional empty } // Update detector type for Moench diff --git a/src/RawMasterFile.test.cpp b/src/RawMasterFile.test.cpp index 5d8a6c6..43e87b9 100644 --- a/src/RawMasterFile.test.cpp +++ b/src/RawMasterFile.test.cpp @@ -224,12 +224,14 @@ TEST_CASE("Parse a master file in .raw format", "[.integration]") { // Packets Caught Mask : 64 bytes } -TEST_CASE("Parse a master file in new .json format", "[.integration][.width-data]") { +TEST_CASE("Parse a master file in new .json format", + "[.integration][.width-data]") { - auto file_path = test_data_path() / "raw" / "newmythen03" / "run_87_master_0.json"; + auto file_path = + test_data_path() / "raw" / "newmythen03" / "run_87_master_0.json"; REQUIRE(std::filesystem::exists(file_path)); - RawMasterFile f(file_path); + RawMasterFile f(file_path); // Version : 8.0 REQUIRE(f.version() == "8.0"); @@ -245,7 +247,7 @@ TEST_CASE("Parse a master file in new .json format", "[.integration][.width-data REQUIRE(f.scan_parameters().enabled() == false); REQUIRE(f.scan_parameters().dac() == DACIndex::DAC_0); - REQUIRE(f.scan_parameters().start() == 0); + REQUIRE(f.scan_parameters().start() == 0); REQUIRE(f.scan_parameters().stop() == 0); REQUIRE(f.scan_parameters().step() == 0); REQUIRE(f.scan_parameters().settleTime() == 0); @@ -326,4 +328,3 @@ TEST_CASE("Read eiger master file", "[.integration]") { // } // } } - diff --git a/src/defs.cpp b/src/defs.cpp index e4cca6a..40e6568 100644 --- a/src/defs.cpp +++ b/src/defs.cpp @@ -115,120 +115,186 @@ template <> FrameDiscardPolicy StringTo(const std::string &arg) { // template <> TimingMode StringTo(std::string mode); -template<> DACIndex StringTo(const std::string &arg) { - if(arg == "dac 0") - return DACIndex::DAC_0; - else if(arg == "dac 1") +template <> DACIndex StringTo(const std::string &arg) { + if (arg == "dac 0") + return DACIndex::DAC_0; + else if (arg == "dac 1") return DACIndex::DAC_1; - else if(arg == "dac 2") + else if (arg == "dac 2") return DACIndex::DAC_2; - else if(arg == "dac 3") - return DACIndex::DAC_3; - else if(arg == "dac 4") + else if (arg == "dac 3") + return DACIndex::DAC_3; + else if (arg == "dac 4") return DACIndex::DAC_4; - else if(arg == "dac 5") + else if (arg == "dac 5") return DACIndex::DAC_5; - else if(arg == "dac 6") - return DACIndex::DAC_6; - else if(arg == "dac 7") + else if (arg == "dac 6") + return DACIndex::DAC_6; + else if (arg == "dac 7") return DACIndex::DAC_7; - else if(arg == "dac 8") + else if (arg == "dac 8") return DACIndex::DAC_8; - else if(arg == "dac 9") - return DACIndex::DAC_9; - else if(arg == "dac 10") + else if (arg == "dac 9") + return DACIndex::DAC_9; + else if (arg == "dac 10") return DACIndex::DAC_10; - else if(arg == "dac 11") + else if (arg == "dac 11") return DACIndex::DAC_11; - else if(arg == "dac 12") - return DACIndex::DAC_12; - else if(arg == "dac 13") + else if (arg == "dac 12") + return DACIndex::DAC_12; + else if (arg == "dac 13") return DACIndex::DAC_13; - else if(arg == "dac 14") + else if (arg == "dac 14") return DACIndex::DAC_14; - else if(arg == "dac 15") - return DACIndex::DAC_15; - else if(arg == "dac 16") + else if (arg == "dac 15") + return DACIndex::DAC_15; + else if (arg == "dac 16") return DACIndex::DAC_16; - else if(arg == "dac 17") + else if (arg == "dac 17") return DACIndex::DAC_17; - else if(arg == "vsvp") + else if (arg == "vsvp") return DACIndex::VSVP; - else if(arg == "vtrim") + else if (arg == "vtrim") return DACIndex::VTRIM; - else if(arg == "vrpreamp") + else if (arg == "vrpreamp") return DACIndex::VRPREAMP; - else if(arg == "vrshaper") + else if (arg == "vrshaper") return DACIndex::VRSHAPER; - else if (arg == "vsvn") return DACIndex::VSVN; - else if (arg == "vtgstv") return DACIndex::VTGSTV; - else if (arg == "vcmp_ll") return DACIndex::VCMP_LL; - else if (arg == "vcmp_lr") return DACIndex::VCMP_LR; - else if (arg == "vcal") return DACIndex::VCAL; - else if (arg == "vcmp_rl") return DACIndex::VCMP_RL; - else if (arg == "rxb_rb") return DACIndex::RXB_RB; - else if (arg == "rxb_lb") return DACIndex::RXB_LB; - else if (arg == "vcmp_rr") return DACIndex::VCMP_RR; - else if (arg == "vcp") return DACIndex::VCP; - else if (arg == "vcn") return DACIndex::VCN; - else if (arg == "vishaper") return DACIndex::VISHAPER; - else if (arg == "vthreshold") return DACIndex::VTHRESHOLD; - else if (arg == "vref_ds") return DACIndex::VREF_DS; - else if (arg == "vout_cm") return DACIndex::VOUT_CM; - else if (arg == "vin_cm") return DACIndex::VIN_CM; - else if (arg == "vref_comp") return DACIndex::VREF_COMP; - else if (arg == "vb_comp") return DACIndex::VB_COMP; - else if (arg == "vdd_prot") return DACIndex::VDD_PROT; - else if (arg == "vin_com") return DACIndex::VIN_COM; - else if (arg == "vref_prech") return DACIndex::VREF_PRECH; - else if (arg == "vb_pixbuf") return DACIndex::VB_PIXBUF; - else if (arg == "vb_ds") return DACIndex::VB_DS; - else if (arg == "vref_h_adc") return DACIndex::VREF_H_ADC; - else if (arg == "vb_comp_fe") return DACIndex::VB_COMP_FE; - else if (arg == "vb_comp_adc") return DACIndex::VB_COMP_ADC; - else if (arg == "vcom_cds") return DACIndex::VCOM_CDS; - else if (arg == "vref_rstore") return DACIndex::VREF_RSTORE; - else if (arg == "vb_opa_1st") return DACIndex::VB_OPA_1ST; - else if (arg == "vref_comp_fe") return DACIndex::VREF_COMP_FE; - else if (arg == "vcom_adc1") return DACIndex::VCOM_ADC1; - else if (arg == "vref_l_adc") return DACIndex::VREF_L_ADC; - else if (arg == "vref_cds") return DACIndex::VREF_CDS; - else if (arg == "vb_cs") return DACIndex::VB_CS; - else if (arg == "vb_opa_fd") return DACIndex::VB_OPA_FD; - else if (arg == "vcom_adc2") return DACIndex::VCOM_ADC2; - else if (arg == "vcassh") return DACIndex::VCASSH; - else if (arg == "vth2") return DACIndex::VTH2; - else if (arg == "vrshaper_n") return DACIndex::VRSHAPER_N; - else if (arg == "vipre_out") return DACIndex::VIPRE_OUT; - else if (arg == "vth3") return DACIndex::VTH3; - else if (arg == "vth1") return DACIndex::VTH1; - else if (arg == "vicin") return DACIndex::VICIN; - else if (arg == "vcas") return DACIndex::VCAS; - else if (arg == "vcal_n") return DACIndex::VCAL_N; - else if (arg == "vipre") return DACIndex::VIPRE; - else if (arg == "vcal_p") return DACIndex::VCAL_P; - else if (arg == "vdcsh") return DACIndex::VDCSH; - else if (arg == "vbp_colbuf") return DACIndex::VBP_COLBUF; - else if (arg == "vb_sda") return DACIndex::VB_SDA; - else if (arg == "vcasc_sfp") return DACIndex::VCASC_SFP; - else if (arg == "vipre_cds") return DACIndex::VIPRE_CDS; - else if (arg == "ibias_sfp") return DACIndex::IBIAS_SFP; - else if (arg == "trimbits") return DACIndex::TRIMBIT_SCAN; - else if (arg == "highvoltage") return DACIndex::HIGH_VOLTAGE; - else if (arg == "iodelay") return DACIndex::IO_DELAY; - else if (arg == "temp_adc") return DACIndex::TEMPERATURE_ADC; - else if (arg == "temp_fpga") return DACIndex::TEMPERATURE_FPGA; - else if (arg == "temp_fpgaext") return DACIndex::TEMPERATURE_FPGAEXT; - else if (arg == "temp_10ge") return DACIndex::TEMPERATURE_10GE; - else if (arg == "temp_dcdc") return DACIndex::TEMPERATURE_DCDC; - else if (arg == "temp_sodl") return DACIndex::TEMPERATURE_SODL; - else if (arg == "temp_sodr") return DACIndex::TEMPERATURE_SODR; - else if (arg == "temp_fpgafl") return DACIndex::TEMPERATURE_FPGA2; - else if (arg == "temp_fpgafr") return DACIndex::TEMPERATURE_FPGA3; - else if (arg == "temp_slowadc") + else if (arg == "vsvn") + return DACIndex::VSVN; + else if (arg == "vtgstv") + return DACIndex::VTGSTV; + else if (arg == "vcmp_ll") + return DACIndex::VCMP_LL; + else if (arg == "vcmp_lr") + return DACIndex::VCMP_LR; + else if (arg == "vcal") + return DACIndex::VCAL; + else if (arg == "vcmp_rl") + return DACIndex::VCMP_RL; + else if (arg == "rxb_rb") + return DACIndex::RXB_RB; + else if (arg == "rxb_lb") + return DACIndex::RXB_LB; + else if (arg == "vcmp_rr") + return DACIndex::VCMP_RR; + else if (arg == "vcp") + return DACIndex::VCP; + else if (arg == "vcn") + return DACIndex::VCN; + else if (arg == "vishaper") + return DACIndex::VISHAPER; + else if (arg == "vthreshold") + return DACIndex::VTHRESHOLD; + else if (arg == "vref_ds") + return DACIndex::VREF_DS; + else if (arg == "vout_cm") + return DACIndex::VOUT_CM; + else if (arg == "vin_cm") + return DACIndex::VIN_CM; + else if (arg == "vref_comp") + return DACIndex::VREF_COMP; + else if (arg == "vb_comp") + return DACIndex::VB_COMP; + else if (arg == "vdd_prot") + return DACIndex::VDD_PROT; + else if (arg == "vin_com") + return DACIndex::VIN_COM; + else if (arg == "vref_prech") + return DACIndex::VREF_PRECH; + else if (arg == "vb_pixbuf") + return DACIndex::VB_PIXBUF; + else if (arg == "vb_ds") + return DACIndex::VB_DS; + else if (arg == "vref_h_adc") + return DACIndex::VREF_H_ADC; + else if (arg == "vb_comp_fe") + return DACIndex::VB_COMP_FE; + else if (arg == "vb_comp_adc") + return DACIndex::VB_COMP_ADC; + else if (arg == "vcom_cds") + return DACIndex::VCOM_CDS; + else if (arg == "vref_rstore") + return DACIndex::VREF_RSTORE; + else if (arg == "vb_opa_1st") + return DACIndex::VB_OPA_1ST; + else if (arg == "vref_comp_fe") + return DACIndex::VREF_COMP_FE; + else if (arg == "vcom_adc1") + return DACIndex::VCOM_ADC1; + else if (arg == "vref_l_adc") + return DACIndex::VREF_L_ADC; + else if (arg == "vref_cds") + return DACIndex::VREF_CDS; + else if (arg == "vb_cs") + return DACIndex::VB_CS; + else if (arg == "vb_opa_fd") + return DACIndex::VB_OPA_FD; + else if (arg == "vcom_adc2") + return DACIndex::VCOM_ADC2; + else if (arg == "vcassh") + return DACIndex::VCASSH; + else if (arg == "vth2") + return DACIndex::VTH2; + else if (arg == "vrshaper_n") + return DACIndex::VRSHAPER_N; + else if (arg == "vipre_out") + return DACIndex::VIPRE_OUT; + else if (arg == "vth3") + return DACIndex::VTH3; + else if (arg == "vth1") + return DACIndex::VTH1; + else if (arg == "vicin") + return DACIndex::VICIN; + else if (arg == "vcas") + return DACIndex::VCAS; + else if (arg == "vcal_n") + return DACIndex::VCAL_N; + else if (arg == "vipre") + return DACIndex::VIPRE; + else if (arg == "vcal_p") + return DACIndex::VCAL_P; + else if (arg == "vdcsh") + return DACIndex::VDCSH; + else if (arg == "vbp_colbuf") + return DACIndex::VBP_COLBUF; + else if (arg == "vb_sda") + return DACIndex::VB_SDA; + else if (arg == "vcasc_sfp") + return DACIndex::VCASC_SFP; + else if (arg == "vipre_cds") + return DACIndex::VIPRE_CDS; + else if (arg == "ibias_sfp") + return DACIndex::IBIAS_SFP; + else if (arg == "trimbits") + return DACIndex::TRIMBIT_SCAN; + else if (arg == "highvoltage") + return DACIndex::HIGH_VOLTAGE; + else if (arg == "iodelay") + return DACIndex::IO_DELAY; + else if (arg == "temp_adc") + return DACIndex::TEMPERATURE_ADC; + else if (arg == "temp_fpga") + return DACIndex::TEMPERATURE_FPGA; + else if (arg == "temp_fpgaext") + return DACIndex::TEMPERATURE_FPGAEXT; + else if (arg == "temp_10ge") + return DACIndex::TEMPERATURE_10GE; + else if (arg == "temp_dcdc") + return DACIndex::TEMPERATURE_DCDC; + else if (arg == "temp_sodl") + return DACIndex::TEMPERATURE_SODL; + else if (arg == "temp_sodr") + return DACIndex::TEMPERATURE_SODR; + else if (arg == "temp_fpgafl") + return DACIndex::TEMPERATURE_FPGA2; + else if (arg == "temp_fpgafr") + return DACIndex::TEMPERATURE_FPGA3; + else if (arg == "temp_slowadc") return DACIndex::SLOW_ADC_TEMP; - else - throw std::invalid_argument("Could not decode DACIndex from: \"" + arg + "\""); + else + throw std::invalid_argument("Could not decode DACIndex from: \"" + arg + + "\""); } } // namespace aare \ No newline at end of file