mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-22 03:40:04 +02:00
wip
This commit is contained in:
parent
f72f678d45
commit
c4c16ad9c0
@ -269,3 +269,5 @@ int set_dbit_pipeline(int);
|
|||||||
int get_dbit_pipeline(int);
|
int get_dbit_pipeline(int);
|
||||||
int get_module_id(int);
|
int get_module_id(int);
|
||||||
int set_module_id(int);
|
int set_module_id(int);
|
||||||
|
int get_dest_udp_list(int);
|
||||||
|
int set_dest_udp_list(int);
|
@ -394,6 +394,8 @@ void function_table() {
|
|||||||
flist[F_GET_DBIT_PIPELINE] = &get_dbit_pipeline;
|
flist[F_GET_DBIT_PIPELINE] = &get_dbit_pipeline;
|
||||||
flist[F_GET_MODULE_ID] = &get_module_id;
|
flist[F_GET_MODULE_ID] = &get_module_id;
|
||||||
flist[F_SET_MODULE_ID] = &set_module_id;
|
flist[F_SET_MODULE_ID] = &set_module_id;
|
||||||
|
flist[F_GET_DEST_UDP_LIST] = &get_dest_udp_list;
|
||||||
|
flist[F_SET_DEST_UDP_LIST] = &set_dest_udp_list;
|
||||||
|
|
||||||
// check
|
// check
|
||||||
if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) {
|
if (NUM_DET_FUNCTIONS >= RECEIVER_ENUM_START) {
|
||||||
@ -8978,3 +8980,145 @@ int set_module_id(int file_des) {
|
|||||||
#endif
|
#endif
|
||||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int get_dest_udp_list(int file_des) {
|
||||||
|
ret = OK;
|
||||||
|
memset(mess, 0, sizeof(mess));
|
||||||
|
uint32_t arg = 0;
|
||||||
|
uint32_t retvals[5] = {0, 0, 0, 0, 0};
|
||||||
|
uint64_t retvals64[2] = {0, 0};
|
||||||
|
LOG(logDEBUG1, ("Getting udp destination list for entry %d\n", arg));
|
||||||
|
|
||||||
|
#if !defined(EIGERD) && !defined(JUNGFRAUD)
|
||||||
|
functionNotImplemented();
|
||||||
|
#else
|
||||||
|
// get only (allow entry 0???? if so, then must talk to receiver)
|
||||||
|
retvals[] = getCurrentSource();
|
||||||
|
LOG(logDEBUG1, ("current source enable retval: %u\n", retvals[0]));
|
||||||
|
#ifdef JUNGFRAUD
|
||||||
|
if (retvals[0]) {
|
||||||
|
retvals[1] = getFixCurrentSource();
|
||||||
|
retvals[2] = getNormalCurrentSource();
|
||||||
|
retval_select = getSelectCurrentSource();
|
||||||
|
}
|
||||||
|
LOG(logDEBUG1, ("current source parameters retval: [enable:%d fix:%d, "
|
||||||
|
"normal:%d, select:%lld]\n",
|
||||||
|
retvals[0], retvals[1], retvals[2], retval_select));
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
Server_SendResult(file_des, INT32, NULL, 0);
|
||||||
|
if (ret != FAIL) {
|
||||||
|
sendData(file_des, retvals, sizeof(retvals), INT32);
|
||||||
|
sendData(file_des, &retval_select, sizeof(retval_select), INT64);
|
||||||
|
}
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
int set_dest_udp_list(int file_des) {
|
||||||
|
ret = OK;
|
||||||
|
memset(mess, 0, sizeof(mess));
|
||||||
|
uint64_t select = 0;
|
||||||
|
int args[3] = {-1, -1, -1};
|
||||||
|
if (receiveData(file_des, args, sizeof(args), INT32) < 0)
|
||||||
|
return printSocketReadError();
|
||||||
|
if (receiveData(file_des, &select, sizeof(select), INT64) < 0)
|
||||||
|
return printSocketReadError();
|
||||||
|
int enable = args[0];
|
||||||
|
int fix = args[1];
|
||||||
|
int normal = args[2];
|
||||||
|
|
||||||
|
LOG(logINFOBLUE, ("Setting current source [enable:%d, fix:%d, select:%lld, "
|
||||||
|
"normal:%d]\n",
|
||||||
|
enable, fix, (long long int)select, normal));
|
||||||
|
|
||||||
|
#if !defined(GOTTHARD2D) && !defined(JUNGFRAUD)
|
||||||
|
functionNotImplemented();
|
||||||
|
#else
|
||||||
|
// only set
|
||||||
|
if (Server_VerifyLock() == OK) {
|
||||||
|
if (enable != 0 && enable != 1) {
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess, "Could not enable/disable current source. Enable can "
|
||||||
|
"be 0 or 1 only.\n");
|
||||||
|
LOG(logERROR, (mess));
|
||||||
|
}
|
||||||
|
// disable
|
||||||
|
else if (enable == 0 && (fix != -1 || normal != -1)) {
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(
|
||||||
|
mess,
|
||||||
|
"Could not disable current source. Requires no parameters.\n");
|
||||||
|
LOG(logERROR, (mess));
|
||||||
|
}
|
||||||
|
// enable
|
||||||
|
else if (enable == 1) {
|
||||||
|
#ifdef GOTTHARD2D
|
||||||
|
// no parameters allowed
|
||||||
|
if (fix != -1 || normal != -1) {
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess, "Could not enable current source. Fix and normal "
|
||||||
|
"are invalid parameters for this detector.\n");
|
||||||
|
LOG(logERROR, (mess));
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
int chipVersion = getChipVersion();
|
||||||
|
if (ret == OK) {
|
||||||
|
if (chipVersion == 11) {
|
||||||
|
// require both
|
||||||
|
if ((fix != 0 && fix != 1) ||
|
||||||
|
(normal != 0 && normal != 1)) {
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess, "Could not enable current source. Invalid "
|
||||||
|
"or insufficient parameters (fix or "
|
||||||
|
"normal). or Options: 0 or 1.\n");
|
||||||
|
LOG(logERROR, (mess));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// chipv1.0
|
||||||
|
else {
|
||||||
|
// require only fix
|
||||||
|
if (fix != 0 && fix != 1) {
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,
|
||||||
|
"Could not enable current source. Invalid value "
|
||||||
|
"for parameter (fix). Options: 0 or 1.\n");
|
||||||
|
LOG(logERROR, (mess));
|
||||||
|
} else if (normal != -1) {
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess, "Could not enable current source. Invalid "
|
||||||
|
"parmaeter (normal). Require only fix and "
|
||||||
|
"select for chipv1.0.\n");
|
||||||
|
LOG(logERROR, (mess));
|
||||||
|
}
|
||||||
|
// select can only be 0-63
|
||||||
|
else if (select > MAX_SELECT_CHIP10_VAL) {
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess,
|
||||||
|
"Could not enable current source. Invalid value "
|
||||||
|
"for parameter (select). Options: 0-63.\n");
|
||||||
|
LOG(logERROR, (mess));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ret == OK) {
|
||||||
|
#ifdef JUNGFRAUD
|
||||||
|
if (enable == 0) {
|
||||||
|
disableCurrentSource();
|
||||||
|
} else {
|
||||||
|
enableCurrentSource(fix, select, normal);
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
setCurrentSource(enable);
|
||||||
|
#endif
|
||||||
|
int retval = getCurrentSource();
|
||||||
|
LOG(logDEBUG1, ("current source enable retval: %u\n", retval));
|
||||||
|
validate(&ret, mess, enable, retval, "set current source enable",
|
||||||
|
DEC);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||||
|
}
|
||||||
|
@ -667,7 +667,7 @@ class Detector {
|
|||||||
void setSourceUDPMAC2(const MacAddr mac, Positions pos = {});
|
void setSourceUDPMAC2(const MacAddr mac, Positions pos = {});
|
||||||
|
|
||||||
Result<defs::udpDestination>
|
Result<defs::udpDestination>
|
||||||
getDestinationUDPList(const int entry, Positions pos = {}) const;
|
getDestinationUDPList(const uint32_t entry, Positions pos = {}) const;
|
||||||
|
|
||||||
void setDestinationUDPList(const defs::udpDestination, const int module_id);
|
void setDestinationUDPList(const defs::udpDestination, const int module_id);
|
||||||
|
|
||||||
|
@ -1380,40 +1380,69 @@ IpAddr CmdProxy::getIpFromAuto() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
defs::udpDestination CmdProxy::getUdpList() {
|
defs::udpDestination CmdProxy::getUdpList() {
|
||||||
defs::udpDestination dest{};
|
uint32_t entry{};
|
||||||
|
uint32_t port{};
|
||||||
|
uint32_t port2{};
|
||||||
|
uint32_t ip{};
|
||||||
|
uint32_t ip2{};
|
||||||
|
uint64_t mac{};
|
||||||
|
uint64_t mac2{};
|
||||||
|
|
||||||
|
bool hasEntry = false;
|
||||||
|
|
||||||
for (auto it : args) {
|
for (auto it : args) {
|
||||||
size_t pos = it.find('=');
|
size_t pos = it.find('=');
|
||||||
std::string key = it.substr(0, pos);
|
std::string key = it.substr(0, pos);
|
||||||
std::string value = it.substr(pos + 1);
|
std::string value = it.substr(pos + 1);
|
||||||
if (key == "ip") {
|
if (key == "entry") {
|
||||||
|
entry = StringTo<int>(value);
|
||||||
|
hasEntry = true;
|
||||||
|
} else if (key == "ip") {
|
||||||
if (value == "auto") {
|
if (value == "auto") {
|
||||||
auto val = getIpFromAuto();
|
auto val = getIpFromAuto();
|
||||||
LOG(logINFO) << "Setting udp_dstip of detector " << det_id
|
LOG(logINFO) << "Setting udp_dstip of detector " << det_id
|
||||||
<< " to " << val;
|
<< " to " << val;
|
||||||
dest.ip = val.uint32();
|
ip = val.uint32();
|
||||||
} else {
|
} else {
|
||||||
dest.ip = IpAddr(value).uint32();
|
ip = IpAddr(value).uint32();
|
||||||
}
|
}
|
||||||
} else if (key == "ip2") {
|
} else if (key == "ip2") {
|
||||||
if (value == "auto") {
|
if (value == "auto") {
|
||||||
auto val = getIpFromAuto();
|
auto val = getIpFromAuto();
|
||||||
LOG(logINFO) << "Setting udp_dstip2 of detector " << det_id
|
LOG(logINFO) << "Setting udp_dstip2 of detector " << det_id
|
||||||
<< " to " << val;
|
<< " to " << val;
|
||||||
dest.ip2 = val.uint32();
|
ip2 = val.uint32();
|
||||||
} else {
|
} else {
|
||||||
dest.ip2 = IpAddr(value).uint32();
|
ip2 = IpAddr(value).uint32();
|
||||||
}
|
}
|
||||||
} else if (key == "mac") {
|
} else if (key == "mac") {
|
||||||
dest.mac = MacAddr(value).uint64();
|
mac = MacAddr(value).uint64();
|
||||||
} else if (key == "mac2") {
|
} else if (key == "mac2") {
|
||||||
dest.mac2 = MacAddr(value).uint64();
|
mac2 = MacAddr(value).uint64();
|
||||||
} else if (key == "port") {
|
} else if (key == "port") {
|
||||||
dest.port = StringTo<int>(value);
|
port = StringTo<uint32_t>(value);
|
||||||
} else if (key == "port2") {
|
} else if (key == "port2") {
|
||||||
dest.port2 = StringTo<int>(value);
|
port2 = StringTo<uint32_t>(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return dest;
|
// necessary arguments
|
||||||
|
if (hasEntry && ip != 0 && mac != 0 && port != 0) {
|
||||||
|
if (ip2 == 0 && mac2 == 0) {
|
||||||
|
// default (no second interface)
|
||||||
|
if (port2 == 0) {
|
||||||
|
return defs::udpDestination(entry, port, ip, mac);
|
||||||
|
}
|
||||||
|
// eiger (second udp port)
|
||||||
|
else {
|
||||||
|
return defs::udpDestination(entry, port, ip, mac, port2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// jungfrau and gotthard2 (second interface)
|
||||||
|
if (ip2 != 0 && mac2 != 0 && port2 != 0) {
|
||||||
|
return defs::udpDestination(entry, port, ip, mac, port2, ip2, mac2);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw sls::RuntimeError("Insufficient arguments");
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string CmdProxy::UDPDestinationList(int action) {
|
std::string CmdProxy::UDPDestinationList(int action) {
|
||||||
|
@ -909,7 +909,7 @@ void Detector::setSourceUDPMAC2(const MacAddr mac, Positions pos) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Result<defs::udpDestination>
|
Result<defs::udpDestination>
|
||||||
Detector::getDestinationUDPList(const int entry, Positions pos) const {
|
Detector::getDestinationUDPList(const uint32_t entry, Positions pos) const {
|
||||||
return pimpl->Parallel(&Module::getDestinationUDPList, pos, entry);
|
return pimpl->Parallel(&Module::getDestinationUDPList, pos, entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -940,21 +940,26 @@ void Module::setSourceUDPMAC2(const sls::MacAddr mac) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
slsDetectorDefs::udpDestination
|
slsDetectorDefs::udpDestination
|
||||||
Module::getDestinationUDPList(const int entry) const {
|
Module::getDestinationUDPList(const uint32_t entry) const {
|
||||||
// return sendToDetector<udpDestination>(F_GET_DEST_UDP_LIST);
|
return sendToDetector<udpDestination>(F_GET_DEST_UDP_LIST, entry);
|
||||||
return bla;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Module::setDestinationUDPList(const slsDetectorDefs::udpDestination dest) {
|
void Module::setDestinationUDPList(const slsDetectorDefs::udpDestination dest) {
|
||||||
LOG(logINFO) << "setting stuff to " << dest;
|
// set them in the default way so the receivers are also set up
|
||||||
bla.entry = dest.entry;
|
if (dest.entry_ == 0) {
|
||||||
bla.ip = dest.ip;
|
setDestinationUDPPort(dest.port_);
|
||||||
bla.ip2 = dest.ip2;
|
setDestinationUDPIP(dest.ip_);
|
||||||
bla.mac = dest.mac;
|
setDestinationUDPMAC(dest.mac_);
|
||||||
bla.mac2 = dest.mac2;
|
if (dest.port_ != 0) {
|
||||||
bla.port = dest.port;
|
setDestinationUDPPort2(dest.port2_);
|
||||||
bla.port2 = dest.port2;
|
}
|
||||||
// sendToDetector(F_SET_DEST_UDP_LIST, dest, nullptr);
|
if (dest.ip2_ != 0) {
|
||||||
|
setDestinationUDPIP2(dest.ip2_);
|
||||||
|
setDestinationUDPMAC2(dest.mac2_);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
sendToDetector(F_SET_DEST_UDP_LIST, dest, nullptr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sls::IpAddr Module::getDestinationUDPIP() const {
|
sls::IpAddr Module::getDestinationUDPIP() const {
|
||||||
|
@ -222,7 +222,7 @@ class Module : public virtual slsDetectorDefs {
|
|||||||
void setSourceUDPMAC(const sls::MacAddr mac);
|
void setSourceUDPMAC(const sls::MacAddr mac);
|
||||||
sls::MacAddr getSourceUDPMAC2() const;
|
sls::MacAddr getSourceUDPMAC2() const;
|
||||||
void setSourceUDPMAC2(const sls::MacAddr mac);
|
void setSourceUDPMAC2(const sls::MacAddr mac);
|
||||||
udpDestination getDestinationUDPList(const int entry) const;
|
udpDestination getDestinationUDPList(const uint32_t entry) const;
|
||||||
void setDestinationUDPList(const defs::udpDestination dest);
|
void setDestinationUDPList(const defs::udpDestination dest);
|
||||||
sls::IpAddr getDestinationUDPIP() const;
|
sls::IpAddr getDestinationUDPIP() const;
|
||||||
void setDestinationUDPIP(const sls::IpAddr ip);
|
void setDestinationUDPIP(const sls::IpAddr ip);
|
||||||
@ -745,7 +745,6 @@ class Module : public virtual slsDetectorDefs {
|
|||||||
|
|
||||||
const int moduleId;
|
const int moduleId;
|
||||||
mutable sls::SharedMemory<sharedSlsDetector> shm{0, 0};
|
mutable sls::SharedMemory<sharedSlsDetector> shm{0, 0};
|
||||||
udpDestination bla{};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace sls
|
} // namespace sls
|
@ -457,64 +457,63 @@ typedef struct {
|
|||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
struct currentSrcParameters {
|
struct currentSrcParameters {
|
||||||
int enable;
|
int enable_;
|
||||||
int fix;
|
int fix_;
|
||||||
int normal;
|
int normal_;
|
||||||
uint64_t select;
|
uint64_t select_;
|
||||||
|
|
||||||
/** [Gotthard2][Jungfrau] disable */
|
/** [Gotthard2][Jungfrau] disable */
|
||||||
currentSrcParameters() : enable(0), fix(-1), normal(-1), select(0) {}
|
currentSrcParameters()
|
||||||
|
: enable_(0), fix_(-1), normal_(-1), select_(0) {}
|
||||||
|
|
||||||
/** [Gotthard2] enable or disable */
|
/** [Gotthard2] enable or disable */
|
||||||
explicit currentSrcParameters(bool ena)
|
explicit currentSrcParameters(bool enable)
|
||||||
: enable(static_cast<int>(ena)), fix(-1), normal(-1), select(0) {}
|
: enable_(static_cast<int>(enable)), fix_(-1), normal_(-1),
|
||||||
|
select_(0) {}
|
||||||
|
|
||||||
/** [Jungfrau](chipv1.0) enable current src with fix or no fix,
|
/** [Jungfrau](chipv1.0) enable current src with fix or no fix,
|
||||||
* selectColumn is 0 to 63 columns only */
|
* select is 0 to 63 columns only */
|
||||||
currentSrcParameters(bool fixCurrent, uint64_t selectColumn)
|
currentSrcParameters(bool fix, uint64_t select)
|
||||||
: enable(1), fix(static_cast<int>(fixCurrent)), normal(-1),
|
: enable_(1), fix_(static_cast<int>(fix)), normal_(-1),
|
||||||
select(selectColumn) {}
|
select_(select) {}
|
||||||
|
|
||||||
/** [Jungfrau](chipv1.1) enable current src, fixCurrent[fix|no fix],
|
/** [Jungfrau](chipv1.1) enable current src, fix[fix|no fix],
|
||||||
* selectColumn is a mask of 63 bits (muliple columns can be selected
|
* select is a mask of 63 bits (muliple columns can be selected
|
||||||
* simultaneously, normalCurrent [normal|low] */
|
* simultaneously, normal [normal|low] */
|
||||||
currentSrcParameters(bool fixCurrent, uint64_t selectColumn,
|
currentSrcParameters(bool fix, uint64_t select, bool normal)
|
||||||
bool normalCurrent)
|
: enable_(1), fix_(static_cast<int>(fix)),
|
||||||
: enable(1), fix(static_cast<int>(fixCurrent)),
|
normal_(static_cast<int>(normal)), select_(select) {}
|
||||||
normal(static_cast<int>(normalCurrent)), select(selectColumn) {}
|
|
||||||
|
|
||||||
bool operator==(const currentSrcParameters &other) const {
|
bool operator==(const currentSrcParameters &other) const {
|
||||||
return ((enable == other.enable) && (fix == other.fix) &&
|
return ((enable_ == other.enable_) && (fix_ == other.fix_) &&
|
||||||
(normal == other.normal) && (select == other.select));
|
(normal_ == other.normal_) && (select_ == other.select_));
|
||||||
}
|
}
|
||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
struct udpDestination {
|
struct udpDestination {
|
||||||
int entry;
|
uint32_t entry_{};
|
||||||
uint32_t ip{};
|
uint32_t port_{};
|
||||||
uint32_t ip2{};
|
uint32_t port2_{};
|
||||||
uint64_t mac{};
|
uint32_t ip_{};
|
||||||
uint64_t mac2{};
|
uint32_t ip2_{};
|
||||||
int port{};
|
uint64_t mac_{};
|
||||||
int port2{};
|
uint64_t mac2_{};
|
||||||
udpDestination();
|
udpDestination() {}
|
||||||
|
udpDestination(uint32_t entry, uint32_t port, uint32_t ip, uint64_t mac)
|
||||||
|
: entry_(entry), port_(port), ip_(ip), mac_(mac) {}
|
||||||
|
udpDestination(uint32_t entry, uint32_t port, uint32_t ip, uint64_t mac,
|
||||||
|
uint32_t port2)
|
||||||
|
: entry_(entry), port_(port), port2_(port2), ip_(ip), mac_(mac) {}
|
||||||
|
udpDestination(uint32_t entry, uint32_t port, uint32_t ip, uint64_t mac,
|
||||||
|
uint32_t port2, uint32_t ip2, uint64_t mac2)
|
||||||
|
: entry_(entry), port_(port), port2_(port2), ip_(ip), ip2_(ip2),
|
||||||
|
mac_(mac), mac2_(mac2) {}
|
||||||
|
|
||||||
bool operator==(const udpDestination &other) const {
|
bool operator==(const udpDestination &other) const {
|
||||||
return ((entry == other.entry) && (ip == other.ip) &&
|
return ((entry_ == other.entry_) && (port_ == other.port_) &&
|
||||||
(ip2 == other.ip2) && (mac == other.mac) &&
|
(port2_ == other.port2_) && (ip_ == other.ip_) &&
|
||||||
(mac2 == other.mac2) && (port == other.port) &&
|
(ip2_ == other.ip2_) && (mac_ == other.mac_) &&
|
||||||
(port2 == other.port2));
|
(mac2_ == other.mac2_));
|
||||||
}
|
|
||||||
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));
|
} __attribute__((packed));
|
||||||
|
|
||||||
|
@ -245,6 +245,8 @@ enum detFuncs {
|
|||||||
F_GET_DBIT_PIPELINE,
|
F_GET_DBIT_PIPELINE,
|
||||||
F_GET_MODULE_ID,
|
F_GET_MODULE_ID,
|
||||||
F_SET_MODULE_ID,
|
F_SET_MODULE_ID,
|
||||||
|
F_GET_DEST_UDP_LIST,
|
||||||
|
F_SET_DEST_UDP_LIST,
|
||||||
|
|
||||||
NUM_DET_FUNCTIONS,
|
NUM_DET_FUNCTIONS,
|
||||||
RECEIVER_ENUM_START = 256, /**< detector function should not exceed this
|
RECEIVER_ENUM_START = 256, /**< detector function should not exceed this
|
||||||
@ -597,6 +599,8 @@ const char* getFunctionNameFromEnum(enum detFuncs func) {
|
|||||||
case F_GET_DBIT_PIPELINE: return "F_GET_DBIT_PIPELINE";
|
case F_GET_DBIT_PIPELINE: return "F_GET_DBIT_PIPELINE";
|
||||||
case F_GET_MODULE_ID: return "F_GET_MODULE_ID";
|
case F_GET_MODULE_ID: return "F_GET_MODULE_ID";
|
||||||
case F_SET_MODULE_ID: return "F_SET_MODULE_ID";
|
case F_SET_MODULE_ID: return "F_SET_MODULE_ID";
|
||||||
|
case F_GET_DEST_UDP_LIST: return "F_GET_DEST_UDP_LIST";
|
||||||
|
case F_SET_DEST_UDP_LIST: return "F_SET_DEST_UDP_LIST";
|
||||||
|
|
||||||
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
|
case NUM_DET_FUNCTIONS: return "NUM_DET_FUNCTIONS";
|
||||||
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
|
case RECEIVER_ENUM_START: return "RECEIVER_ENUM_START";
|
||||||
|
@ -116,25 +116,25 @@ std::ostream &operator<<(std::ostream &os,
|
|||||||
|
|
||||||
std::string ToString(const slsDetectorDefs::currentSrcParameters &r) {
|
std::string ToString(const slsDetectorDefs::currentSrcParameters &r) {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
if (r.fix < -1 || r.fix > 1 || r.normal < -1 || r.normal > 1) {
|
if (r.fix_ < -1 || r.fix_ > 1 || r.normal_ < -1 || r.normal_ > 1) {
|
||||||
throw sls::RuntimeError(
|
throw sls::RuntimeError(
|
||||||
"Invalid current source parameters. Cannot print.");
|
"Invalid current source parameters. Cannot print.");
|
||||||
}
|
}
|
||||||
oss << '[';
|
oss << '[';
|
||||||
if (r.enable) {
|
if (r.enable_) {
|
||||||
oss << "enabled";
|
oss << "enabled";
|
||||||
// [jungfrau]
|
// [jungfrau]
|
||||||
if (r.fix != -1) {
|
if (r.fix_ != -1) {
|
||||||
oss << (r.fix == 1 ? ", fix" : ", nofix");
|
oss << (r.fix_ == 1 ? ", fix" : ", nofix");
|
||||||
}
|
}
|
||||||
// [jungfrau chip v1.1]
|
// [jungfrau chip v1.1]
|
||||||
if (r.normal != -1) {
|
if (r.normal_ != -1) {
|
||||||
oss << ", " << ToStringHex(r.select, 16);
|
oss << ", " << ToStringHex(r.select_, 16);
|
||||||
oss << (r.normal == 1 ? ", normal" : ", low");
|
oss << (r.normal_ == 1 ? ", normal" : ", low");
|
||||||
}
|
}
|
||||||
// [jungfrau chip v1.0]
|
// [jungfrau chip v1.0]
|
||||||
else {
|
else {
|
||||||
oss << ", " << r.select;
|
oss << ", " << r.select_;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
oss << "disabled";
|
oss << "disabled";
|
||||||
@ -151,18 +151,18 @@ std::ostream &operator<<(std::ostream &os,
|
|||||||
std::string ToString(const slsDetectorDefs::udpDestination &r) {
|
std::string ToString(const slsDetectorDefs::udpDestination &r) {
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
oss << '[' << std::endl
|
oss << '[' << std::endl
|
||||||
<< "entry " << r.entry << std::endl
|
<< "entry " << r.entry_ << std::endl
|
||||||
<< "ip " << IpAddr(r.ip) << std::endl
|
<< "ip " << IpAddr(r.ip_) << std::endl
|
||||||
<< "mac " << MacAddr(r.mac) << std::endl
|
<< "mac " << MacAddr(r.mac_) << std::endl
|
||||||
<< "port " << r.port << std::endl;
|
<< "port " << r.port_ << std::endl;
|
||||||
if (r.port2 != 0) {
|
if (r.port2_ != 0) {
|
||||||
oss << "port2 " << r.port2 << std::endl;
|
oss << "port2 " << r.port2_ << std::endl;
|
||||||
}
|
}
|
||||||
if (r.ip2 != 0) {
|
if (r.ip2_ != 0) {
|
||||||
oss << "ip2 " << IpAddr(r.ip2) << std::endl;
|
oss << "ip2 " << IpAddr(r.ip2_) << std::endl;
|
||||||
}
|
}
|
||||||
if (r.mac2 != 0) {
|
if (r.mac2_ != 0) {
|
||||||
oss << "mac2 " << MacAddr(r.mac2) << std::endl;
|
oss << "mac2 " << MacAddr(r.mac2_) << std::endl;
|
||||||
}
|
}
|
||||||
oss << ']';
|
oss << ']';
|
||||||
return oss.str();
|
return oss.str();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user