mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
wip
This commit is contained in:
@ -55,7 +55,9 @@ std::ostream &operator<<(std::ostream &os,
|
||||
std::string ToString(const slsDetectorDefs::currentSrcParameters &r);
|
||||
std::ostream &operator<<(std::ostream &os,
|
||||
const slsDetectorDefs::currentSrcParameters &r);
|
||||
|
||||
std::string ToString(const slsDetectorDefs::udpDestination &r);
|
||||
std::ostream &operator<<(std::ostream &os,
|
||||
const slsDetectorDefs::udpDestination &r);
|
||||
const std::string &ToString(const std::string &s);
|
||||
|
||||
/** Convert std::chrono::duration with specified output unit */
|
||||
|
@ -466,7 +466,7 @@ typedef struct {
|
||||
currentSrcParameters() : enable(0), fix(-1), normal(-1), select(0) {}
|
||||
|
||||
/** [Gotthard2] enable or disable */
|
||||
currentSrcParameters(bool ena)
|
||||
explicit currentSrcParameters(bool ena)
|
||||
: enable(static_cast<int>(ena)), fix(-1), normal(-1), select(0) {}
|
||||
|
||||
/** [Jungfrau](chipv1.0) enable current src with fix or no fix,
|
||||
@ -489,6 +489,35 @@ typedef struct {
|
||||
}
|
||||
} __attribute__((packed));
|
||||
|
||||
struct udpDestination {
|
||||
int entry;
|
||||
uint32_t ip{};
|
||||
uint32_t ip2{};
|
||||
uint64_t mac{};
|
||||
uint64_t mac2{};
|
||||
int port{};
|
||||
int port2{};
|
||||
udpDestination();
|
||||
bool operator==(const udpDestination &other) const {
|
||||
return ((entry == other.entry) && (ip == other.ip) &&
|
||||
(ip2 == other.ip2) && (mac == other.mac) &&
|
||||
(mac2 == other.mac2) && (port == other.port) &&
|
||||
(port2 == other.port2));
|
||||
}
|
||||
udpDestination operator=(const udpDestination &other) const {
|
||||
if (this == &other)
|
||||
return *this;
|
||||
entry = other.entry;
|
||||
ip = other.ip;
|
||||
ip2 = other.ip2;
|
||||
mac = other.mac;
|
||||
mac2 = other.mac2;
|
||||
port = other.port;
|
||||
port2 = other.port2;
|
||||
return *this;
|
||||
}
|
||||
} __attribute__((packed));
|
||||
|
||||
/**
|
||||
* structure to udpate receiver
|
||||
*/
|
||||
|
@ -148,6 +148,31 @@ std::ostream &operator<<(std::ostream &os,
|
||||
return os << ToString(r);
|
||||
}
|
||||
|
||||
std::string ToString(const slsDetectorDefs::udpDestination &r) {
|
||||
std::ostringstream oss;
|
||||
oss << '[' << std::endl
|
||||
<< "entry " << r.entry << std::endl
|
||||
<< "ip " << IpAddr(r.ip) << std::endl
|
||||
<< "mac " << MacAddr(r.mac) << std::endl
|
||||
<< "port " << r.port << std::endl;
|
||||
if (r.port2 != 0) {
|
||||
oss << "port2 " << r.port2 << std::endl;
|
||||
}
|
||||
if (r.ip2 != 0) {
|
||||
oss << "ip2 " << IpAddr(r.ip2) << std::endl;
|
||||
}
|
||||
if (r.mac2 != 0) {
|
||||
oss << "mac2 " << MacAddr(r.mac2) << std::endl;
|
||||
}
|
||||
oss << ']';
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &os,
|
||||
const slsDetectorDefs::udpDestination &r) {
|
||||
return os << ToString(r);
|
||||
}
|
||||
|
||||
std::string ToString(const defs::runStatus s) {
|
||||
switch (s) {
|
||||
case defs::ERROR:
|
||||
|
Reference in New Issue
Block a user