mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-21 00:58:01 +02:00
updated i3gbe to lll
This commit is contained in:
@ -36,7 +36,7 @@ std::string ToString(const defs::dacIndex s);
|
||||
std::string ToString(const std::vector<defs::dacIndex> &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);
|
||||
|
@ -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<int32_t>(a) |
|
||||
inline slsDetectorDefs::streamingInterface
|
||||
operator|(const slsDetectorDefs::streamingInterface &a,
|
||||
const slsDetectorDefs::streamingInterface &b) {
|
||||
return slsDetectorDefs::streamingInterface(static_cast<int32_t>(a) |
|
||||
static_cast<int32_t>(b));
|
||||
};
|
||||
|
||||
inline slsDetectorDefs::ethernetInterface
|
||||
operator&(const slsDetectorDefs::ethernetInterface &a,
|
||||
const slsDetectorDefs::ethernetInterface &b) {
|
||||
return slsDetectorDefs::ethernetInterface(static_cast<int32_t>(a) &
|
||||
inline slsDetectorDefs::streamingInterface
|
||||
operator&(const slsDetectorDefs::streamingInterface &a,
|
||||
const slsDetectorDefs::streamingInterface &b) {
|
||||
return slsDetectorDefs::streamingInterface(static_cast<int32_t>(a) &
|
||||
static_cast<int32_t>(b));
|
||||
};
|
||||
#endif
|
||||
|
@ -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) {
|
||||
|
@ -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");
|
||||
}
|
Reference in New Issue
Block a user