From 2c53a134cd7e6883bbaf83aab0e8d228a98b27cd Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 6 Aug 2021 16:08:07 +0200 Subject: [PATCH 1/3] updated i3gbe to lll --- python/scripts/generate_enums.py | 6 ++-- python/slsdet/detector.py | 8 ++--- python/src/detector.cpp | 8 ++--- python/src/enums.cpp | 18 +++++----- .../slsDetectorFunctionList.c | 12 +++---- .../include/slsDetectorFunctionList.h | 4 +-- .../src/slsDetectorServer_funcs.c | 12 +++---- slsDetectorSoftware/include/sls/Detector.h | 16 ++++----- slsDetectorSoftware/src/CmdProxy.cpp | 22 ++++++------ slsDetectorSoftware/src/Detector.cpp | 26 +++++++------- slsDetectorSoftware/src/Module.cpp | 4 +-- slsDetectorSoftware/src/Module.h | 4 +-- .../tests/test-CmdProxy-gotthard2.cpp | 34 +++++++++---------- slsSupportLib/include/sls/ToString.h | 4 +-- slsSupportLib/include/sls/sls_detector_defs.h | 26 +++++++------- slsSupportLib/src/ToString.cpp | 26 +++++++------- slsSupportLib/tests/test-ToString.cpp | 12 +++---- 17 files changed, 121 insertions(+), 121 deletions(-) diff --git a/python/scripts/generate_enums.py b/python/scripts/generate_enums.py index 25769e429..ed0d1ecab 100644 --- a/python/scripts/generate_enums.py +++ b/python/scripts/generate_enums.py @@ -11,7 +11,7 @@ import subprocess from parse import remove_comments -allow_bitwise_op = ["ethernetInterface"] +allow_bitwise_op = ["streamingInterface"] op_key = {"operator|": "__or__", "operator&" : "__and__"} @@ -22,7 +22,7 @@ def single_line_enum(line): def extract_enums(lines): - # deal with enum class ethernetInterface : int32_t + # deal with enum class streamingInterface : int32_t # and normal enum burstMode { line_iter = iter(lines) @@ -89,7 +89,7 @@ def generate_enum_string(enums): #Here add the operators for op in operators: - data.append(f"\n\t.def(\"{op_key[op]}\", py::overload_cast< const slsDetectorDefs::ethernetInterface&, const slsDetectorDefs::ethernetInterface&>(&{op}))") + data.append(f"\n\t.def(\"{op_key[op]}\", py::overload_cast< const slsDetectorDefs::streamingInterface&, const slsDetectorDefs::streamingInterface&>(&{op}))") data.append(';\n\n') diff --git a/python/slsdet/detector.py b/python/slsdet/detector.py index 919e9c86f..36433f687 100755 --- a/python/slsdet/detector.py +++ b/python/slsdet/detector.py @@ -7,7 +7,7 @@ timingMode = slsDetectorDefs.timingMode speedLevel = slsDetectorDefs.speedLevel dacIndex = slsDetectorDefs.dacIndex detectorType = slsDetectorDefs.detectorType -ethernetInterface = slsDetectorDefs.ethernetInterface +streamingInterface = slsDetectorDefs.streamingInterface from .utils import element_if_equal, all_equal, get_set_bits, list_to_bitmask from .utils import Geometry, to_geo, element, reduce_time, is_iterable @@ -2340,7 +2340,7 @@ class Detector(CppDetectorApi): Note ---- Default: both off - Options: NONE, I3GBE, 10GBE (debugging) + Options: NONE, LOW_LATENCY_LINK, 10GBE (debugging) Debugging interface also enables second interface in receiver (separate file), which also restarts zmq streaming if enabled. """ return self.getVetoStream() @@ -2356,10 +2356,10 @@ class Detector(CppDetectorApi): """[Gotthard2] Algorithm used for veto Example ---------- - >>> d.vetoalg = defs.DEFAULT_ALGORITHM, defs.I10GBE + >>> d.vetoalg = defs.DEFAULT_ALGORITHM, defs.ETHERNET_10GB """ result = {} - interface = [ethernetInterface.I3GBE, ethernetInterface.I10GBE] + interface = [streamingInterface.LOW_LATENCY_LINK, streamingInterface.ETHERNET_10GB] for eth in interface: result[eth] = element_if_equal(self.getVetoAlgorithm(eth)) return result diff --git a/python/src/detector.cpp b/python/src/detector.cpp index e4762d7a4..fe39e4c03 100644 --- a/python/src/detector.cpp +++ b/python/src/detector.cpp @@ -1075,23 +1075,23 @@ void init_det(py::module &m) { Detector::setVeto, py::arg(), py::arg() = Positions{}) .def("getVetoStream", - (Result(Detector::*)(sls::Positions) + (Result(Detector::*)(sls::Positions) const) & Detector::getVetoStream, py::arg() = Positions{}) .def("setVetoStream", - (void (Detector::*)(const defs::ethernetInterface, + (void (Detector::*)(const defs::streamingInterface, sls::Positions)) & Detector::setVetoStream, py::arg(), py::arg() = Positions{}) .def("getVetoAlgorithm", (Result(Detector::*)( - const defs::ethernetInterface, sls::Positions) const) & + const defs::streamingInterface, sls::Positions) const) & Detector::getVetoAlgorithm, py::arg(), py::arg() = Positions{}) .def("setVetoAlgorithm", (void (Detector::*)(const defs::vetoAlgorithm, - const defs::ethernetInterface, + const defs::streamingInterface, sls::Positions)) & Detector::setVetoAlgorithm, py::arg(), py::arg(), py::arg() = Positions{}) diff --git a/python/src/enums.cpp b/python/src/enums.cpp index 23278cd5d..e2fab169f 100644 --- a/python/src/enums.cpp +++ b/python/src/enums.cpp @@ -278,20 +278,20 @@ void init_enums(py::module &m) { slsDetectorDefs::timingSourceType::TIMING_EXTERNAL) .export_values(); - py::enum_(Defs, "ethernetInterface", + py::enum_(Defs, "streamingInterface", py::arithmetic()) - .value("NONE", slsDetectorDefs::ethernetInterface::NONE) - .value("I3GBE", slsDetectorDefs::ethernetInterface::I3GBE) - .value("I10GBE", slsDetectorDefs::ethernetInterface::I10GBE) - .value("ALL", slsDetectorDefs::ethernetInterface::ALL) + .value("NONE", slsDetectorDefs::streamingInterface::NONE) + .value("LOW_LATENCY_LINK", slsDetectorDefs::streamingInterface::LOW_LATENCY_LINK) + .value("ETHERNET_10GB", slsDetectorDefs::streamingInterface::ETHERNET_10GB) + .value("ALL", slsDetectorDefs::streamingInterface::ALL) .export_values() .def("__or__", - py::overload_cast( + py::overload_cast( &operator|)) .def("__and__", - py::overload_cast( + py::overload_cast( &operator&)); py::enum_(Defs, "vetoAlgorithm") diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c index 605a45c10..971875f29 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c @@ -1716,10 +1716,10 @@ int configureMAC() { "\tDest Port : %d\n\n", src_ip, src_mac, srcport, dst_ip, dst_mac, dstport)); - int i3gbe = getVetoStream(); + int lll = getVetoStream(); int i10gbe = (getNumberofUDPInterfaces() == 2 ? 1 : 0); - if (i3gbe) { + if (lll) { LOG(logINFOGREEN, ("\tVeto (3GbE) : enabled\n\n")); } else { LOG(logINFORED, ("\tVeto (3GbE) : disabled\n\n")); @@ -2606,9 +2606,9 @@ int getVetoStream() { return ((bus_r(CONFIG_REG) & CONFIG_VETO_CH_3GB_ENBL_MSK) ? 1 : 0); } -enum vetoAlgorithm getVetoAlgorithm(enum ethernetInterface interface) { +enum vetoAlgorithm getVetoAlgorithm(enum streamingInterface interface) { // 3gbe - if (interface == I3GBE) { + if (interface == LOW_LATENCY_LINK) { int retval = ((bus_r(CONFIG_REG) & CONFIG_VETO_CH_3GB_ALG_MSK) >> CONFIG_VETO_CH_3GB_ALG_OFST); switch (retval) { @@ -2633,14 +2633,14 @@ enum vetoAlgorithm getVetoAlgorithm(enum ethernetInterface interface) { } } -void setVetoAlgorithm(enum ethernetInterface interface, +void setVetoAlgorithm(enum streamingInterface interface, enum vetoAlgorithm alg) { uint32_t addr = CONFIG_REG; uint32_t value = bus_r(addr); switch (alg) { // more to follow case DEFAULT_ALGORITHM: - if (interface == I3GBE) { + if (interface == LOW_LATENCY_LINK) { LOG(logINFO, ("Setting default veto algorithm for 3Gbe\n")); value &= (~CONFIG_VETO_CH_3GB_ALG_MSK); value |= CONFIG_VETO_CH_3GB_ALG_DEFAULT_VAL; diff --git a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h index 58090a24d..d0b09ee53 100644 --- a/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h +++ b/slsDetectorServers/slsDetectorServer/include/slsDetectorFunctionList.h @@ -542,8 +542,8 @@ void setVeto(int enable); int getVeto(); void setVetoStream(int value); int getVetoStream(); -enum vetoAlgorithm getVetoAlgorithm(enum ethernetInterface interface); -void setVetoAlgorithm(enum ethernetInterface interface, enum vetoAlgorithm alg); +enum vetoAlgorithm getVetoAlgorithm(enum streamingInterface interface); +void setVetoAlgorithm(enum streamingInterface interface, enum vetoAlgorithm alg); void setBadChannels(int nch, int *channels); int *getBadChannels(int *nch); #endif diff --git a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c index 3ce2cacb7..ca97020cc 100644 --- a/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c +++ b/slsDetectorServers/slsDetectorServer/src/slsDetectorServer_funcs.c @@ -8372,7 +8372,7 @@ int get_master(int file_des){ int get_veto_stream(int file_des) { ret = OK; memset(mess, 0, sizeof(mess)); - enum ethernetInterface retval = NONE; + enum streamingInterface retval = NONE; LOG(logDEBUG1, ("Getting veto stream\n")); @@ -8389,7 +8389,7 @@ int get_veto_stream(int file_des) { int set_veto_stream(int file_des) { ret = OK; memset(mess, 0, sizeof(mess)); - enum ethernetInterface arg = 0; + enum streamingInterface arg = 0; if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0) return printSocketReadError(); @@ -8421,7 +8421,7 @@ int set_veto_stream(int file_des) { int get_veto_algorithm(int file_des) { ret = OK; memset(mess, 0, sizeof(mess)); - enum ethernetInterface arg = NONE; + enum streamingInterface arg = NONE; enum vetoAlgorithm retval = DEFAULT_ALGORITHM; if (receiveData(file_des, &arg, sizeof(arg), INT32) < 0) return printSocketReadError(); @@ -8432,7 +8432,7 @@ int get_veto_algorithm(int file_des) { functionNotImplemented(); #else // get only - if (arg != I3GBE && arg != I10GBE) { + if (arg != LOW_LATENCY_LINK && arg != ETHERNET_10GB) { ret = FAIL; sprintf(mess, "Could not get vetoalgorithm. Invalid interface %d.\n", arg); @@ -8453,7 +8453,7 @@ int set_veto_algorithm(int file_des) { return printSocketReadError(); enum vetoAlgorithm alg = args[0]; - enum ethernetInterface interface = args[1]; + enum streamingInterface interface = args[1]; LOG(logINFO, ("Setting vetoalgorithm (interface: %d): %u\n", (int)interface, (int)alg)); @@ -8462,7 +8462,7 @@ int set_veto_algorithm(int file_des) { #else // only set if (Server_VerifyLock() == OK) { - if (interface != I3GBE && interface != I10GBE) { + if (interface != LOW_LATENCY_LINK && interface != ETHERNET_10GB) { ret = FAIL; sprintf(mess, "Could not set vetoalgorithm. Invalid interface %d.\n", diff --git a/slsDetectorSoftware/include/sls/Detector.h b/slsDetectorSoftware/include/sls/Detector.h index c05ac6d04..105aca9be 100644 --- a/slsDetectorSoftware/include/sls/Detector.h +++ b/slsDetectorSoftware/include/sls/Detector.h @@ -1248,26 +1248,26 @@ class Detector { void setVeto(const bool enable, Positions pos = {}); /** [Gotthard2] */ - Result getVetoStream(Positions pos = {}) const; + Result getVetoStream(Positions pos = {}) const; - /** [Gotthard2] Options: NONE (Default), I3GBE, I10GBE (debugging), ALL + /** [Gotthard2] Options: NONE (Default), LOW_LATENCY_LINK, ETHERNET_10GB (debugging), ALL * Enable or disable the 2 veto streaming interfaces available. Can - * concatenate more than one interface. \n3GbE (2.5GbE) is the default - * interface to work with. \n10GbE is for debugging and also enables second + * concatenate more than one interface. \nLOW_LATENCY_LINK is the default + * interface to work with. \nETHERNET_10GB is for debugging and also enables second * interface in receiver for listening to veto packets (writes a separate * file if writing enabled). Also restarts client and receiver zmq sockets * if zmq streaming enabled.*/ - void setVetoStream(const defs::ethernetInterface value, Positions pos = {}); + void setVetoStream(const defs::streamingInterface value, Positions pos = {}); /** [Gotthard2] */ Result - getVetoAlgorithm(const defs::ethernetInterface value, + getVetoAlgorithm(const defs::streamingInterface value, Positions pos = {}) const; /** [Gotthard2] Options(vetoAlgorithm): DEFAULT_ALGORITHM. - * Options(ethernetInterface): I3GBE, I10GBE */ + * Options(streamingInterface): LOW_LATENCY_LINK, ETHERNET_10GB */ void setVetoAlgorithm(const defs::vetoAlgorithm alg, - const defs::ethernetInterface value, + const defs::streamingInterface value, Positions pos = {}); /** [Gotthard2] */ diff --git a/slsDetectorSoftware/src/CmdProxy.cpp b/slsDetectorSoftware/src/CmdProxy.cpp index f44885396..d81e106ee 100644 --- a/slsDetectorSoftware/src/CmdProxy.cpp +++ b/slsDetectorSoftware/src/CmdProxy.cpp @@ -1806,9 +1806,9 @@ std::string CmdProxy::VetoStreaming(int action) { std::ostringstream os; os << cmd << ' '; if (action == defs::HELP_ACTION) { - os << "[none|3gbe|10gbe|...]\n\t[Gotthard2] Enable or disable the 2 " + os << "[none|lll|10gbe|...]\n\t[Gotthard2] Enable or disable the 2 " "veto streaming interfaces available. Can include more than one " - "interface. \n\tDefault: none. 3GbE (2.5GbE) is the default " + "interface. \n\tDefault: none. lll (low latency link) is the default " "interface to work with. \n\t10GbE is for debugging and also " "enables second interface in receiver for listening to veto " "packets (writes a separate file if writing enabled). Also " @@ -1825,7 +1825,7 @@ std::string CmdProxy::VetoStreaming(int action) { if (args.empty()) { WrongNumberOfParameters(1); } - defs::ethernetInterface interface = defs::ethernetInterface::NONE; + defs::streamingInterface interface = defs::streamingInterface::NONE; for (const auto &arg : args) { if (arg == "none") { if (args.size() > 1) { @@ -1836,7 +1836,7 @@ std::string CmdProxy::VetoStreaming(int action) { } break; } - interface = interface | (StringTo(arg)); + interface = interface | (StringTo(arg)); } det->setVetoStream(interface, std::vector{det_id}); os << ToString(interface) << '\n'; @@ -1850,16 +1850,16 @@ std::string CmdProxy::VetoAlgorithm(int action) { std::ostringstream os; os << cmd << ' '; if (action == defs::HELP_ACTION) { - os << "[default] [3gbe|10gbe]\n\t[Gotthard2] Set the veto " + os << "[default] [lll|10gbe]\n\t[Gotthard2] Set the veto " "algorithm." << '\n'; } else if (action == defs::GET_ACTION) { if (args.size() != 1) { WrongNumberOfParameters(1); } - defs::ethernetInterface interface = - StringTo(args[0]); - if (interface == defs::ethernetInterface::NONE) { + defs::streamingInterface interface = + StringTo(args[0]); + if (interface == defs::streamingInterface::NONE) { throw sls::RuntimeError( "Must specify an interface to set algorithm"); } @@ -1870,9 +1870,9 @@ std::string CmdProxy::VetoAlgorithm(int action) { WrongNumberOfParameters(2); } defs::vetoAlgorithm alg = StringTo(args[0]); - defs::ethernetInterface interface = - StringTo(args[1]); - if (interface == defs::ethernetInterface::NONE) { + defs::streamingInterface interface = + StringTo(args[1]); + if (interface == defs::streamingInterface::NONE) { throw sls::RuntimeError( "Must specify an interface to set algorithm"); } diff --git a/slsDetectorSoftware/src/Detector.cpp b/slsDetectorSoftware/src/Detector.cpp index 866af9362..c8d342114 100644 --- a/slsDetectorSoftware/src/Detector.cpp +++ b/slsDetectorSoftware/src/Detector.cpp @@ -1565,34 +1565,34 @@ void Detector::setVeto(bool enable, Positions pos) { pimpl->Parallel(&Module::setVeto, pos, enable); } -Result Detector::getVetoStream(Positions pos) const { +Result Detector::getVetoStream(Positions pos) const { // 3gbe auto r3 = pimpl->Parallel(&Module::getVetoStream, pos); // 10gbe (debugging interface) opens 2nd udp interface in receiver auto r10 = getNumberofUDPInterfaces_(pos); - Result res(r3.size()); + Result res(r3.size()); for (unsigned int i = 0; i < res.size(); ++i) { - res[i] = (r3[i] ? defs::ethernetInterface::I3GBE - : defs::ethernetInterface::NONE); + res[i] = (r3[i] ? defs::streamingInterface::LOW_LATENCY_LINK + : defs::streamingInterface::NONE); if (r10[i] == 2) { - res[i] = res[i] | defs::ethernetInterface::I10GBE; + res[i] = res[i] | defs::streamingInterface::ETHERNET_10GB; } } return res; } -void Detector::setVetoStream(defs::ethernetInterface interface, Positions pos) { +void Detector::setVetoStream(defs::streamingInterface interface, Positions pos) { // 3gbe - bool i3gbe = (interface & defs::ethernetInterface::I3GBE) == - defs::ethernetInterface::I3GBE; - pimpl->Parallel(&Module::setVetoStream, pos, i3gbe); + bool LOW_LATENCY_LINK = (interface & defs::streamingInterface::LOW_LATENCY_LINK) == + defs::streamingInterface::LOW_LATENCY_LINK; + pimpl->Parallel(&Module::setVetoStream, pos, LOW_LATENCY_LINK); // 10gbe (debugging interface) opens 2nd udp interface in receiver int old_numinterfaces = getNumberofUDPInterfaces_(pos).tsquash( "retrieved inconsistent number of udp interfaces"); - int numinterfaces = ((interface & defs::ethernetInterface::I10GBE) == - defs::ethernetInterface::I10GBE) + int numinterfaces = ((interface & defs::streamingInterface::ETHERNET_10GB) == + defs::streamingInterface::ETHERNET_10GB) ? 2 : 1; if (numinterfaces != old_numinterfaces) { @@ -1601,13 +1601,13 @@ void Detector::setVetoStream(defs::ethernetInterface interface, Positions pos) { } Result -Detector::getVetoAlgorithm(const defs::ethernetInterface interface, +Detector::getVetoAlgorithm(const defs::streamingInterface interface, Positions pos) const { return pimpl->Parallel(&Module::getVetoAlgorithm, pos, interface); } void Detector::setVetoAlgorithm(const defs::vetoAlgorithm alg, - defs::ethernetInterface interface, + defs::streamingInterface interface, Positions pos) { pimpl->Parallel(&Module::setVetoAlgorithm, pos, alg, interface); } diff --git a/slsDetectorSoftware/src/Module.cpp b/slsDetectorSoftware/src/Module.cpp index 2221092c3..3cc85b9a9 100644 --- a/slsDetectorSoftware/src/Module.cpp +++ b/slsDetectorSoftware/src/Module.cpp @@ -1879,14 +1879,14 @@ void Module::setVetoStream(const bool value) { } slsDetectorDefs::vetoAlgorithm Module::getVetoAlgorithm( - const slsDetectorDefs::ethernetInterface interface) const { + const slsDetectorDefs::streamingInterface interface) const { return sendToDetector(F_GET_VETO_ALGORITHM, static_cast(interface)); } void Module::setVetoAlgorithm( const slsDetectorDefs::vetoAlgorithm alg, - const slsDetectorDefs::ethernetInterface interface) { + const slsDetectorDefs::streamingInterface interface) { int args[]{static_cast(alg), static_cast(interface)}; sendToDetector(F_SET_VETO_ALGORITHM, args, nullptr); } diff --git a/slsDetectorSoftware/src/Module.h b/slsDetectorSoftware/src/Module.h index a05e49012..4e14ec12e 100644 --- a/slsDetectorSoftware/src/Module.h +++ b/slsDetectorSoftware/src/Module.h @@ -409,9 +409,9 @@ class Module : public virtual slsDetectorDefs { bool getVetoStream() const; void setVetoStream(const bool value); slsDetectorDefs::vetoAlgorithm - getVetoAlgorithm(const slsDetectorDefs::ethernetInterface interface) const; + getVetoAlgorithm(const slsDetectorDefs::streamingInterface interface) const; void setVetoAlgorithm(const slsDetectorDefs::vetoAlgorithm alg, - const slsDetectorDefs::ethernetInterface interface); + const slsDetectorDefs::streamingInterface interface); int getADCConfiguration(const int chipIndex, const int adcIndex) const; void setADCConfiguration(const int chipIndex, const int adcIndex, int value); diff --git a/slsDetectorSoftware/tests/test-CmdProxy-gotthard2.cpp b/slsDetectorSoftware/tests/test-CmdProxy-gotthard2.cpp index 089d8b68b..133795b10 100644 --- a/slsDetectorSoftware/tests/test-CmdProxy-gotthard2.cpp +++ b/slsDetectorSoftware/tests/test-CmdProxy-gotthard2.cpp @@ -657,25 +657,25 @@ TEST_CASE("vetostream", "[.cmd]") { } { std::ostringstream oss; - proxy.Call("vetostream", {"3gbe"}, -1, PUT, oss); - REQUIRE(oss.str() == "vetostream 3gbe\n"); + proxy.Call("vetostream", {"lll"}, -1, PUT, oss); + REQUIRE(oss.str() == "vetostream lll\n"); } { std::ostringstream oss; proxy.Call("vetostream", {}, -1, GET, oss); - REQUIRE(oss.str() == "vetostream 3gbe\n"); + REQUIRE(oss.str() == "vetostream lll\n"); } { std::ostringstream oss; - proxy.Call("vetostream", {"3gbe", "10gbe"}, -1, PUT, oss); - REQUIRE(oss.str() == "vetostream 3gbe, 10gbe\n"); + proxy.Call("vetostream", {"lll", "10gbe"}, -1, PUT, oss); + REQUIRE(oss.str() == "vetostream lll, 10gbe\n"); } { std::ostringstream oss; proxy.Call("vetostream", {}, -1, GET, oss); - REQUIRE(oss.str() == "vetostream 3gbe, 10gbe\n"); + REQUIRE(oss.str() == "vetostream lll, 10gbe\n"); } - REQUIRE_THROWS(proxy.Call("vetostream", {"3gbe", "none"}, -1, PUT)); + REQUIRE_THROWS(proxy.Call("vetostream", {"lll", "none"}, -1, PUT)); for (int i = 0; i != det.size(); ++i) { det.setVetoStream(prev_val[i], {i}); } @@ -691,18 +691,18 @@ TEST_CASE("vetoalg", "[.cmd]") { CmdProxy proxy(&det); auto det_type = det.getDetectorType().squash(); if (det_type == defs::GOTTHARD2) { - auto prev_val_3g = det.getVetoAlgorithm(defs::ethernetInterface::I3GBE); + auto prev_val_3g = det.getVetoAlgorithm(defs::streamingInterface::LOW_LATENCY_LINK); auto prev_val_10g = - det.getVetoAlgorithm(defs::ethernetInterface::I10GBE); + det.getVetoAlgorithm(defs::streamingInterface::ETHERNET_10GB); { std::ostringstream oss; - proxy.Call("vetoalg", {"default", "3gbe"}, -1, PUT, oss); - REQUIRE(oss.str() == "vetoalg default 3gbe\n"); + proxy.Call("vetoalg", {"default", "lll"}, -1, PUT, oss); + REQUIRE(oss.str() == "vetoalg default lll\n"); } { std::ostringstream oss; - proxy.Call("vetoalg", {"3gbe"}, -1, GET, oss); - REQUIRE(oss.str() == "vetoalg default 3gbe\n"); + proxy.Call("vetoalg", {"lll"}, -1, GET, oss); + REQUIRE(oss.str() == "vetoalg default lll\n"); } { std::ostringstream oss; @@ -715,16 +715,16 @@ TEST_CASE("vetoalg", "[.cmd]") { REQUIRE(oss.str() == "vetoalg default 10gbe\n"); } REQUIRE_THROWS( - proxy.Call("vetoalg", {"default", "3gbe", "10gbe"}, -1, PUT)); + proxy.Call("vetoalg", {"default", "lll", "10gbe"}, -1, PUT)); REQUIRE_THROWS(proxy.Call("vetoalg", {"default", "none"}, -1, PUT)); for (int i = 0; i != det.size(); ++i) { - det.setVetoAlgorithm(prev_val_3g[i], defs::ethernetInterface::I3GBE, + det.setVetoAlgorithm(prev_val_3g[i], defs::streamingInterface::LOW_LATENCY_LINK, {i}); det.setVetoAlgorithm(prev_val_10g[i], - defs::ethernetInterface::I10GBE, {i}); + defs::streamingInterface::ETHERNET_10GB, {i}); } } else { - REQUIRE_THROWS(proxy.Call("vetoalg", {"3gbe"}, -1, GET)); + REQUIRE_THROWS(proxy.Call("vetoalg", {"lll"}, -1, GET)); REQUIRE_THROWS(proxy.Call("vetoalg", {"none"}, -1, PUT)); } REQUIRE_THROWS(proxy.Call("vetoalg", {"dfgd"}, -1, GET)); diff --git a/slsSupportLib/include/sls/ToString.h b/slsSupportLib/include/sls/ToString.h index 868ac94ec..9ebaee5c0 100644 --- a/slsSupportLib/include/sls/ToString.h +++ b/slsSupportLib/include/sls/ToString.h @@ -36,7 +36,7 @@ std::string ToString(const defs::dacIndex s); std::string ToString(const std::vector &vec); std::string ToString(const defs::burstMode s); std::string ToString(const defs::timingSourceType s); -std::string ToString(const defs::ethernetInterface s); +std::string ToString(const defs::streamingInterface s); std::string ToString(const defs::vetoAlgorithm s); std::string ToString(const slsDetectorDefs::xy &coord); @@ -299,7 +299,7 @@ template <> defs::readoutMode StringTo(const std::string &s); template <> defs::dacIndex StringTo(const std::string &s); template <> defs::burstMode StringTo(const std::string &s); template <> defs::timingSourceType StringTo(const std::string &s); -template <> defs::ethernetInterface StringTo(const std::string &s); +template <> defs::streamingInterface StringTo(const std::string &s); template <> defs::vetoAlgorithm StringTo(const std::string &s); template <> uint32_t StringTo(const std::string &s); diff --git a/slsSupportLib/include/sls/sls_detector_defs.h b/slsSupportLib/include/sls/sls_detector_defs.h index 8cbaf372c..ed2cce244 100644 --- a/slsSupportLib/include/sls/sls_detector_defs.h +++ b/slsSupportLib/include/sls/sls_detector_defs.h @@ -395,14 +395,14 @@ typedef struct { enum timingSourceType { TIMING_INTERNAL, TIMING_EXTERNAL }; #ifdef __cplusplus - enum class ethernetInterface { + enum class streamingInterface { #else - enum ethernetInterface { + enum streamingInterface { #endif NONE = 0, - I3GBE = 1 << 0, - I10GBE = 1 << 1, - ALL = I3GBE | I10GBE + LOW_LATENCY_LINK = 1 << 0, + ETHERNET_10GB = 1 << 1, + ALL = LOW_LATENCY_LINK | ETHERNET_10GB }; enum vetoAlgorithm { DEFAULT_ALGORITHM }; @@ -498,17 +498,17 @@ typedef struct { #ifdef __cplusplus }; -inline slsDetectorDefs::ethernetInterface -operator|(const slsDetectorDefs::ethernetInterface &a, - const slsDetectorDefs::ethernetInterface &b) { - return slsDetectorDefs::ethernetInterface(static_cast(a) | +inline slsDetectorDefs::streamingInterface +operator|(const slsDetectorDefs::streamingInterface &a, + const slsDetectorDefs::streamingInterface &b) { + return slsDetectorDefs::streamingInterface(static_cast(a) | static_cast(b)); }; -inline slsDetectorDefs::ethernetInterface -operator&(const slsDetectorDefs::ethernetInterface &a, - const slsDetectorDefs::ethernetInterface &b) { - return slsDetectorDefs::ethernetInterface(static_cast(a) & +inline slsDetectorDefs::streamingInterface +operator&(const slsDetectorDefs::streamingInterface &a, + const slsDetectorDefs::streamingInterface &b) { + return slsDetectorDefs::streamingInterface(static_cast(a) & static_cast(b)); }; #endif diff --git a/slsSupportLib/src/ToString.cpp b/slsSupportLib/src/ToString.cpp index 4c038541a..b6b593460 100644 --- a/slsSupportLib/src/ToString.cpp +++ b/slsSupportLib/src/ToString.cpp @@ -519,18 +519,18 @@ std::string ToString(const defs::timingSourceType s) { } } -std::string ToString(const defs::ethernetInterface s) { +std::string ToString(const defs::streamingInterface s) { std::ostringstream os; std::string rs; switch (s) { - case defs::ethernetInterface::NONE: + case defs::streamingInterface::NONE: return std::string("none"); default: - if ((s & defs::ethernetInterface::I3GBE) != - defs::ethernetInterface::NONE) - os << "3gbe, "; - if ((s & defs::ethernetInterface::I10GBE) != - defs::ethernetInterface::NONE) + if ((s & defs::streamingInterface::LOW_LATENCY_LINK) != + defs::streamingInterface::NONE) + os << "lll, "; + if ((s & defs::streamingInterface::ETHERNET_10GB) != + defs::streamingInterface::NONE) os << "10gbe, "; auto rs = os.str(); rs.erase(rs.end() - 2, rs.end()); @@ -887,17 +887,17 @@ template <> defs::timingSourceType StringTo(const std::string &s) { throw sls::RuntimeError("Unknown timing source type " + s); } -template <> defs::ethernetInterface StringTo(const std::string &s) { +template <> defs::streamingInterface StringTo(const std::string &s) { std::string rs = s; if (s.find(',') != std::string::npos) rs.erase(rs.find(',')); if (rs == "none") - return defs::ethernetInterface::NONE; - if (rs == "3gbe") - return defs::ethernetInterface::I3GBE; + return defs::streamingInterface::NONE; + if (rs == "lll") + return defs::streamingInterface::LOW_LATENCY_LINK; if (rs == "10gbe") - return defs::ethernetInterface::I10GBE; - throw sls::RuntimeError("Unknown ethernetInterface type " + s); + return defs::streamingInterface::ETHERNET_10GB; + throw sls::RuntimeError("Unknown streamingInterface type " + s); } template <> defs::vetoAlgorithm StringTo(const std::string &s) { diff --git a/slsSupportLib/tests/test-ToString.cpp b/slsSupportLib/tests/test-ToString.cpp index c8e720734..1fcddb2da 100644 --- a/slsSupportLib/tests/test-ToString.cpp +++ b/slsSupportLib/tests/test-ToString.cpp @@ -324,10 +324,10 @@ TEST_CASE("Print a member of patternParameters") { REQUIRE(ToString(pat->limits) == "[4, 100]"); } -TEST_CASE("ethernetInterface") { - REQUIRE(ToString(sls::defs::ethernetInterface::NONE) == "none"); - REQUIRE(ToString(sls::defs::ethernetInterface::I10GBE) == "10gbe"); - REQUIRE(ToString(sls::defs::ethernetInterface::I3GBE) == "3gbe"); - REQUIRE(ToString(sls::defs::ethernetInterface::I3GBE | - sls::defs::ethernetInterface::I10GBE) == "3gbe, 10gbe"); +TEST_CASE("streamingInterface") { + REQUIRE(ToString(sls::defs::streamingInterface::NONE) == "none"); + REQUIRE(ToString(sls::defs::streamingInterface::ETHERNET_10GB) == "10gbe"); + REQUIRE(ToString(sls::defs::streamingInterface::LOW_LATENCY_LINK) == "lll"); + REQUIRE(ToString(sls::defs::streamingInterface::LOW_LATENCY_LINK | + sls::defs::streamingInterface::ETHERNET_10GB) == "lll, 10gbe"); } \ No newline at end of file From f9dc668ba4616734a4ad1a5e96b28bd5f08609e5 Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 6 Aug 2021 16:12:20 +0200 Subject: [PATCH 2/3] binaries in --- .../bin/ctbDetectorServer_developer | Bin 270204 -> 270204 bytes .../bin/gotthardDetectorServer_developer | Bin 220048 -> 220048 bytes .../bin/jungfrauDetectorServer_developer | Bin 236120 -> 236120 bytes .../bin/moenchDetectorServer_developer | Bin 257716 -> 257716 bytes .../bin/mythen3DetectorServer_developer | Bin 242696 -> 242696 bytes slsSupportLib/include/sls/versionAPI.h | 10 +++++----- 6 files changed, 5 insertions(+), 5 deletions(-) diff --git a/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer b/slsDetectorServers/ctbDetectorServer/bin/ctbDetectorServer_developer index 258e18f7ed1c324913c554b5c06292b0e5803c80..8d0cf5c284422eb2d7a50b5482b00b1e8b52c8a2 100755 GIT binary patch delta 57 zcmeyfPvFl!fe9KciM-C{(;35(#h+GE@pftYD~ Jj2pAUO#nK85&HlD diff --git a/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer b/slsDetectorServers/gotthardDetectorServer/bin/gotthardDetectorServer_developer index 689a040a42509a814454ecd36010283042735bcb..46176904234fdd3974de992aa68626c2948fac8e 100755 GIT binary patch delta 74 zcmbQRop%BdX|N>nI-5`bxPeJxqe~8l6dMO)0^xjANSqaRZaYMwc88DJ6Es1jZK(3<3;b0Ax8lRAgXysKmbc6vqSu XCMEXf7|Zq;OGY4O+8$%cY@!4JRU{P> diff --git a/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer b/slsDetectorServers/jungfrauDetectorServer/bin/jungfrauDetectorServer_developer index 2219036ea7b452b55b8ede1d605b2fad3200885b..0497e605dd58eb610dae57484424fa450eac7fb0 100755 GIT binary patch delta 74 zcmcbyh401|z6lyEiM-BM(+i(5No;fx;E-bDU`$|q!N4HE00uyo!$U;|hKFn%oAWqy ZjG5Rtn&()z&#`6%Vy5kLteN-30RR;x6zBi| delta 74 zcmcbyh401|z6lyE2|wdlrWZbAlGx}Xz#*l?&X~aXf`LJR0StgFhlh#`3=fsqH|KHa Z7&9rcH_x$dpJUAk#7x`gSTpa50{~OA76||V diff --git a/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer b/slsDetectorServers/moenchDetectorServer/bin/moenchDetectorServer_developer index 65acee737d3efc4077a8eefe57c9528148ae0fd4..b601701b96cdf12052ce491c06515a444dbc8b41 100755 GIT binary patch delta 57 zcmdmTmw(G${s|f^iM-A>(?9AkOKfym!O6tNG5H;*7?9e`#${m)q?;XV+Z}8fftYE# JgDrE(MgS7B5X1lg delta 57 zcmdmTmw(G${s|f^2|wf5rhn97me}aBf|E&!eeyd_F(9>>jmyFqNH;s!wmaA|0x{Ee J2V3TnjQ~NV5#;~? diff --git a/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer b/slsDetectorServers/mythen3DetectorServer/bin/mythen3DetectorServer_developer index 1787025154d8f4058bafbffe929e53a4040564a1..31fb66e8d972964e05cb3d2a22248671b2b4544f 100755 GIT binary patch delta 51 zcmeBp!PoJEZ-a<3a|>hBWPfF~$+pV;AogZ|W!`)cqd9(3d;BCuAZFSgKZ$vzA^^(q B5v%|J delta 51 zcmeBp!PoJEZ-a<3^O2K{ll_&|Cfh3WgV>w>m3i|)jOO@B?eUWsftYD~{3Pa;iU1`f B6u|%h diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index 5744f2bf0..818045996 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -3,10 +3,10 @@ #define APILIB 0x210225 #define APIRECEIVER 0x210225 #define APIGUI 0x210225 -#define APICTB 0x210722 -#define APIGOTTHARD 0x210722 -#define APIJUNGFRAU 0x210722 -#define APIMOENCH 0x210722 #define APIEIGER 0x210727 -#define APIMYTHEN3 0x210727 +#define APICTB 0x210806 +#define APIGOTTHARD 0x210806 #define APIGOTTHARD2 0x210806 +#define APIJUNGFRAU 0x210806 +#define APIMYTHEN3 0x210806 +#define APIMOENCH 0x210806 From 6c1f09b8f593eecb970c1ffdef0eb15124b36c5e Mon Sep 17 00:00:00 2001 From: Dhanya Thattil Date: Fri, 6 Aug 2021 16:12:49 +0200 Subject: [PATCH 3/3] binaries in --- .../bin/eigerDetectorServer_developer | Bin 378367 -> 378367 bytes slsSupportLib/include/sls/versionAPI.h | 2 +- 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer b/slsDetectorServers/eigerDetectorServer/bin/eigerDetectorServer_developer index 299baad7c99c891e6a5d03d6ddc691d1c6c975e5..4761c380df33f6ee311417979299dfc500d595f2 100755 GIT binary patch delta 63 zcmez0E&jh-d;^md69?P$3v7&1lix{-z}U@xQrrEc7&DrH0_{8IFaj|X5HkZY%k~{} HSlu-NqPrF7 delta 63 zcmez0E&jh-d;^md6TABK3v7&1lix{-z}U@xQrrEc7&DrH0_{8IFaj|X5HkZY%k~{} HSlu-Nu^1Le diff --git a/slsSupportLib/include/sls/versionAPI.h b/slsSupportLib/include/sls/versionAPI.h index 818045996..b89933f47 100644 --- a/slsSupportLib/include/sls/versionAPI.h +++ b/slsSupportLib/include/sls/versionAPI.h @@ -3,10 +3,10 @@ #define APILIB 0x210225 #define APIRECEIVER 0x210225 #define APIGUI 0x210225 -#define APIEIGER 0x210727 #define APICTB 0x210806 #define APIGOTTHARD 0x210806 #define APIGOTTHARD2 0x210806 #define APIJUNGFRAU 0x210806 #define APIMYTHEN3 0x210806 #define APIMOENCH 0x210806 +#define APIEIGER 0x210806