mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 13:57:13 +02:00
Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
d81587646e | |||
5508f0135d | |||
f2b8aa9dbd | |||
e554099bd9 | |||
001fcf03d9 | |||
1c6369a5a8 | |||
4012f139ec | |||
630b7cd539 | |||
3ebb3e7508 | |||
a1c4eb6d05 | |||
b9b5c623ec | |||
41dc8329ab | |||
c3499c0b93 | |||
578528eb59 | |||
0658d1c843 | |||
ce6dc589c8 | |||
0b45fdfed8 | |||
9217d9f22c | |||
7d4e2470a3 |
12
examples/jungfrau_rr.config
Normal file
12
examples/jungfrau_rr.config
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
hostname bchip258+
|
||||||
|
0:rx_hostname pc13784:1954+pc13784:1955+
|
||||||
|
|
||||||
|
udp_srcip 10.0.2.184
|
||||||
|
udp_dstip 10.0.2.1
|
||||||
|
|
||||||
|
0:0 udp_dstport 50000
|
||||||
|
0:1 udp_dstport 50001
|
||||||
|
|
||||||
|
|
||||||
|
#0:0 udp_dstlist port=50001
|
||||||
|
#0:1 udp_dstlist port=50002
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -9220,8 +9220,25 @@ int clear_all_udp_dst(int file_des) {
|
|||||||
if (check_detector_idle("clear all udp destinations") == OK) {
|
if (check_detector_idle("clear all udp destinations") == OK) {
|
||||||
memset(udpDetails, 0, sizeof(udpDetails));
|
memset(udpDetails, 0, sizeof(udpDetails));
|
||||||
// minimum 1 destination in fpga
|
// minimum 1 destination in fpga
|
||||||
numUdpDestinations = 1;
|
int numdest = 1;
|
||||||
configure_mac();
|
// set number of destinations
|
||||||
|
#if defined(JUNGFRAUD) || defined(EIGERD)
|
||||||
|
if (setNumberofDestinations(numdest) == FAIL) {
|
||||||
|
ret = FAIL;
|
||||||
|
strcpy(mess, "Could not clear udp destinations to 1 entry.\n");
|
||||||
|
LOG(logERROR, (mess));
|
||||||
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
numUdpDestinations = numdest;
|
||||||
|
LOG(logINFOBLUE, ("Number of UDP Destinations: %d\n",
|
||||||
|
numUdpDestinations));
|
||||||
|
ret = configureMAC();
|
||||||
|
if (ret == FAIL) {
|
||||||
|
strcpy(mess, "Could not clear all destinations in the fpga.\n");
|
||||||
|
LOG(logERROR, (mess));
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return Server_SendResult(file_des, INT32, NULL, 0);
|
return Server_SendResult(file_des, INT32, NULL, 0);
|
||||||
|
@ -699,48 +699,60 @@ class Detector {
|
|||||||
/**[Jungfrau] Options 0-31 (or number of udp destinations) */
|
/**[Jungfrau] Options 0-31 (or number of udp destinations) */
|
||||||
void setFirstUDPDestination(const int value, Positions pos = {});
|
void setFirstUDPDestination(const int value, Positions pos = {});
|
||||||
|
|
||||||
Result<IpAddr> getDestinationUDPIP(Positions pos = {}) const;
|
Result<IpAddr> getDestinationUDPIP(Positions pos = {},
|
||||||
|
const int rx_index = 0) const;
|
||||||
|
|
||||||
/** IP of the interface in receiver that the detector sends data to */
|
/** IP of the interface in receiver that the detector sends data to */
|
||||||
void setDestinationUDPIP(const IpAddr ip, Positions pos = {});
|
void setDestinationUDPIP(const IpAddr ip, Positions pos = {},
|
||||||
|
const int rx_index = 0);
|
||||||
|
|
||||||
/** [Jungfrau] bottom half \n [Gotthard2] veto debugging */
|
/** [Jungfrau] bottom half \n [Gotthard2] veto debugging */
|
||||||
Result<IpAddr> getDestinationUDPIP2(Positions pos = {}) const;
|
Result<IpAddr> getDestinationUDPIP2(Positions pos = {},
|
||||||
|
const int rx_index = 0) const;
|
||||||
|
|
||||||
/** [Jungfrau] bottom half \n [Gotthard2] veto debugging */
|
/** [Jungfrau] bottom half \n [Gotthard2] veto debugging */
|
||||||
void setDestinationUDPIP2(const IpAddr ip, Positions pos = {});
|
void setDestinationUDPIP2(const IpAddr ip, Positions pos = {},
|
||||||
|
const int rx_index = 0);
|
||||||
|
|
||||||
Result<MacAddr> getDestinationUDPMAC(Positions pos = {}) const;
|
Result<MacAddr> getDestinationUDPMAC(Positions pos = {},
|
||||||
|
const int rxIndex = 0) const;
|
||||||
|
|
||||||
/** Mac address of the receiver (destination) udp interface. Not mandatory
|
/** Mac address of the receiver (destination) udp interface. Not mandatory
|
||||||
* to set as setDestinationUDPIP (udp_dstip) retrieves it from slsReceiver
|
* to set as setDestinationUDPIP (udp_dstip) retrieves it from slsReceiver
|
||||||
* process but must be set if you use a custom receiver (not slsReceiver).
|
* process but must be set if you use a custom receiver (not slsReceiver).
|
||||||
*/
|
*/
|
||||||
void setDestinationUDPMAC(const MacAddr mac, Positions pos = {});
|
void setDestinationUDPMAC(const MacAddr mac, Positions pos = {},
|
||||||
|
const int rx_index = 0);
|
||||||
|
|
||||||
/** [Jungfrau] bottom half \n [Gotthard2] veto debugging */
|
/** [Jungfrau] bottom half \n [Gotthard2] veto debugging */
|
||||||
Result<MacAddr> getDestinationUDPMAC2(Positions pos = {}) const;
|
Result<MacAddr> getDestinationUDPMAC2(Positions pos = {},
|
||||||
|
const int rx_index = 0) const;
|
||||||
|
|
||||||
/* [Jungfrau][Gotthard2] Mac address of the receiver (destination) udp
|
/* [Jungfrau][Gotthard2] Mac address of the receiver (destination) udp
|
||||||
interface 2. \n Not mandatory to set as udp_dstip2 retrieves it from
|
interface 2. \n Not mandatory to set as udp_dstip2 retrieves it from
|
||||||
slsReceiver process but must be set if you use a custom receiver (not
|
slsReceiver process but must be set if you use a custom receiver (not
|
||||||
slsReceiver). \n [Jungfrau] bottom half \n [Gotthard2] veto debugging \n
|
slsReceiver). \n [Jungfrau] bottom half \n [Gotthard2] veto debugging \n
|
||||||
*/
|
*/
|
||||||
void setDestinationUDPMAC2(const MacAddr mac, Positions pos = {});
|
void setDestinationUDPMAC2(const MacAddr mac, Positions pos = {},
|
||||||
|
const int rx_index = 0);
|
||||||
|
|
||||||
Result<int> getDestinationUDPPort(Positions pos = {}) const;
|
Result<int> getDestinationUDPPort(Positions pos = {},
|
||||||
|
const int rx_index = 0) const;
|
||||||
|
|
||||||
/** Default is 50001. \n If module_id is -1, ports for each module is
|
/** Default is 50001. \n If module_id is -1, ports for each module is
|
||||||
* calculated (incremented by 1 if no 2nd interface) */
|
* calculated (incremented by 1 if no 2nd interface) */
|
||||||
void setDestinationUDPPort(int port, int module_id = -1);
|
void setDestinationUDPPort(int port, int module_id = -1,
|
||||||
|
const int rxIndex = 0);
|
||||||
|
|
||||||
/** [Eiger] right port[Jungfrau] bottom half [Gotthard2] veto debugging */
|
/** [Eiger] right port[Jungfrau] bottom half [Gotthard2] veto debugging */
|
||||||
Result<int> getDestinationUDPPort2(Positions pos = {}) const;
|
Result<int> getDestinationUDPPort2(Positions pos = {},
|
||||||
|
const int rx_index = 0) const;
|
||||||
|
|
||||||
/** [Eiger] right port[Jungfrau] bottom half [Gotthard2] veto debugging \n
|
/** [Eiger] right port[Jungfrau] bottom half [Gotthard2] veto debugging \n
|
||||||
* Default is 50002. \n If module_id is -1, ports for each module is
|
* Default is 50002. \n If module_id is -1, ports for each module is
|
||||||
* calculated (incremented by 1 if no 2nd interface)*/
|
* calculated (incremented by 1 if no 2nd interface)*/
|
||||||
void setDestinationUDPPort2(int port, int module_id = -1);
|
void setDestinationUDPPort2(int port, int module_id = -1,
|
||||||
|
const int rxIndex = 0);
|
||||||
|
|
||||||
/** Reconfigures Detector with UDP destination. More for debugging as the
|
/** Reconfigures Detector with UDP destination. More for debugging as the
|
||||||
* configuration is done automatically when the detector has sufficient UDP
|
* configuration is done automatically when the detector has sufficient UDP
|
||||||
@ -752,7 +764,8 @@ class Detector {
|
|||||||
* information */
|
* information */
|
||||||
void validateUDPConfiguration(Positions pos = {});
|
void validateUDPConfiguration(Positions pos = {});
|
||||||
|
|
||||||
Result<std::string> printRxConfiguration(Positions pos = {}) const;
|
Result<std::string> printRxConfiguration(Positions pos = {},
|
||||||
|
const int rx_index = 0) const;
|
||||||
|
|
||||||
/** [Eiger][CTB][Moench][Mythen3] */
|
/** [Eiger][CTB][Moench][Mythen3] */
|
||||||
Result<bool> getTenGiga(Positions pos = {}) const;
|
Result<bool> getTenGiga(Positions pos = {}) const;
|
||||||
@ -811,7 +824,8 @@ class Detector {
|
|||||||
/** true when slsReceiver is used */
|
/** true when slsReceiver is used */
|
||||||
Result<bool> getUseReceiverFlag(Positions pos = {}) const;
|
Result<bool> getUseReceiverFlag(Positions pos = {}) const;
|
||||||
|
|
||||||
Result<std::string> getRxHostname(Positions pos = {}) const;
|
Result<std::string> getRxHostname(Positions pos = {},
|
||||||
|
const int rx_index = 0) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets receiver hostname or IP address for each module. \n Used for TCP
|
* Sets receiver hostname or IP address for each module. \n Used for TCP
|
||||||
@ -819,20 +833,24 @@ class Detector {
|
|||||||
* Also updates receiver with detector parameters. \n Also resets any prior
|
* Also updates receiver with detector parameters. \n Also resets any prior
|
||||||
* receiver property (not on detector). \n receiver is receiver hostname or
|
* receiver property (not on detector). \n receiver is receiver hostname or
|
||||||
* IP address, can include tcp port eg. hostname:port
|
* IP address, can include tcp port eg. hostname:port
|
||||||
|
*
|
||||||
|
* rxIndex of -1 is rewritten as 0 (for backwards compatibility)
|
||||||
*/
|
*/
|
||||||
void setRxHostname(const std::string &receiver, Positions pos = {});
|
void setRxHostname(const std::string &receiver, Positions pos = {}, const int rxIndex = 0);
|
||||||
|
|
||||||
/** multiple rx hostnames. Single element will set it for all */
|
/** - single element, assumes rxIndex is 0 (for backwards compatibility).
|
||||||
void setRxHostname(const std::vector<std::string> &name);
|
* - muliple element with pos empty or -1, sets each element for each module (1:1 for backwards compatibility, rxIndex = 0)
|
||||||
|
* multiple element for specific position, each element for each RR rxr */
|
||||||
|
void setRxHostname(const std::vector<std::string> &name, Positions pos);
|
||||||
|
|
||||||
Result<int> getRxPort(Positions pos = {}) const;
|
Result<int> getRxPort(Positions pos = {}, const int rx_index = 0) const;
|
||||||
|
|
||||||
/** TCP port for client-receiver communication. \n
|
/** TCP port for client-receiver communication. \n
|
||||||
* Default is 1954. \n Must be different if multiple receivers on same pc.
|
* Default is 1954. \n Must be different if multiple receivers on same pc.
|
||||||
* \n Must be first command to set a receiver parameter to be able to
|
* \n Must be first command to set a receiver parameter to be able to
|
||||||
* communicate. \n Multi command will automatically increment port for
|
* communicate. \n Multi command will automatically increment port for
|
||||||
* individual modules.*/
|
* individual modules.*/
|
||||||
void setRxPort(int port, int module_id = -1);
|
void setRxPort(int port, int module_id = -1, const int rx_index = 0);
|
||||||
|
|
||||||
Result<int> getRxFifoDepth(Positions pos = {}) const;
|
Result<int> getRxFifoDepth(Positions pos = {}) const;
|
||||||
|
|
||||||
@ -1010,13 +1028,15 @@ class Detector {
|
|||||||
*/
|
*/
|
||||||
void setRxZmqPort(int port, int module_id = -1);
|
void setRxZmqPort(int port, int module_id = -1);
|
||||||
|
|
||||||
Result<IpAddr> getRxZmqIP(Positions pos = {}) const;
|
Result<IpAddr> getRxZmqIP(Positions pos = {},
|
||||||
|
const int rx_index = 0) const;
|
||||||
|
|
||||||
/** Zmq Ip Address from which data is to be streamed out of the receiver. \n
|
/** Zmq Ip Address from which data is to be streamed out of the receiver. \n
|
||||||
* Also restarts receiver zmq streaming if enabled. \n Default is from
|
* Also restarts receiver zmq streaming if enabled. \n Default is from
|
||||||
* rx_hostname. \n Modified only when using an intermediate process between
|
* rx_hostname. \n Modified only when using an intermediate process between
|
||||||
* receiver. */
|
* receiver. */
|
||||||
void setRxZmqIP(const IpAddr ip, Positions pos = {});
|
void setRxZmqIP(const IpAddr ip, Positions pos = {},
|
||||||
|
const int rx_index = 0);
|
||||||
|
|
||||||
Result<int> getClientZmqPort(Positions pos = {}) const;
|
Result<int> getClientZmqPort(Positions pos = {}) const;
|
||||||
|
|
||||||
|
@ -1484,7 +1484,7 @@ std::string CmdProxy::UDPDestinationList(int action) {
|
|||||||
}
|
}
|
||||||
if (rx_id < 0 || rx_id >= MAX_UDP_DESTINATION) {
|
if (rx_id < 0 || rx_id >= MAX_UDP_DESTINATION) {
|
||||||
throw sls::RuntimeError(
|
throw sls::RuntimeError(
|
||||||
"Invalid receiver index to set round robin entry.");
|
std::string("Invalid receiver index ") + std::to_string(rx_id) + std::string(" to set round robin entry."));
|
||||||
}
|
}
|
||||||
auto t = getUdpEntry();
|
auto t = getUdpEntry();
|
||||||
det->setDestinationUDPList(t, det_id);
|
det->setDestinationUDPList(t, det_id);
|
||||||
@ -1504,7 +1504,7 @@ std::string CmdProxy::UDPDestinationIP(int action) {
|
|||||||
"rx_hostname."
|
"rx_hostname."
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
auto t = det->getDestinationUDPIP(std::vector<int>{det_id});
|
auto t = det->getDestinationUDPIP(std::vector<int>{det_id}, rx_id);
|
||||||
if (!args.empty()) {
|
if (!args.empty()) {
|
||||||
WrongNumberOfParameters(0);
|
WrongNumberOfParameters(0);
|
||||||
}
|
}
|
||||||
@ -1517,11 +1517,11 @@ std::string CmdProxy::UDPDestinationIP(int action) {
|
|||||||
auto val = getIpFromAuto();
|
auto val = getIpFromAuto();
|
||||||
LOG(logINFO) << "Setting udp_dstip of detector " << det_id << " to "
|
LOG(logINFO) << "Setting udp_dstip of detector " << det_id << " to "
|
||||||
<< val;
|
<< val;
|
||||||
det->setDestinationUDPIP(val, std::vector<int>{det_id});
|
det->setDestinationUDPIP(val, std::vector<int>{det_id}, rx_id);
|
||||||
os << val << '\n';
|
os << val << '\n';
|
||||||
} else {
|
} else {
|
||||||
auto val = IpAddr(args[0]);
|
auto val = IpAddr(args[0]);
|
||||||
det->setDestinationUDPIP(val, std::vector<int>{det_id});
|
det->setDestinationUDPIP(val, std::vector<int>{det_id}, rx_id);
|
||||||
os << args.front() << '\n';
|
os << args.front() << '\n';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1540,7 +1540,7 @@ std::string CmdProxy::UDPDestinationIP2(int action) {
|
|||||||
"\n\t[Gotthard2] veto debugging. "
|
"\n\t[Gotthard2] veto debugging. "
|
||||||
<< '\n';
|
<< '\n';
|
||||||
} else if (action == defs::GET_ACTION) {
|
} else if (action == defs::GET_ACTION) {
|
||||||
auto t = det->getDestinationUDPIP2(std::vector<int>{det_id});
|
auto t = det->getDestinationUDPIP2(std::vector<int>{det_id}, rx_id);
|
||||||
if (!args.empty()) {
|
if (!args.empty()) {
|
||||||
WrongNumberOfParameters(0);
|
WrongNumberOfParameters(0);
|
||||||
}
|
}
|
||||||
@ -1553,11 +1553,11 @@ std::string CmdProxy::UDPDestinationIP2(int action) {
|
|||||||
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;
|
||||||
det->setDestinationUDPIP2(val, std::vector<int>{det_id});
|
det->setDestinationUDPIP2(val, std::vector<int>{det_id}, rx_id);
|
||||||
os << val << '\n';
|
os << val << '\n';
|
||||||
} else {
|
} else {
|
||||||
auto val = IpAddr(args[0]);
|
auto val = IpAddr(args[0]);
|
||||||
det->setDestinationUDPIP2(val, std::vector<int>{det_id});
|
det->setDestinationUDPIP2(val, std::vector<int>{det_id}, rx_id);
|
||||||
os << args.front() << '\n';
|
os << args.front() << '\n';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -1593,33 +1593,54 @@ std::string CmdProxy::ReceiverHostname(int action) {
|
|||||||
}
|
}
|
||||||
// multiple arguments
|
// multiple arguments
|
||||||
if (args.size() > 1) {
|
if (args.size() > 1) {
|
||||||
// multiple in mulitple
|
if (rx_id != -1) {
|
||||||
|
throw sls::RuntimeError(
|
||||||
|
"Cannot add multiple receivers at RR level");
|
||||||
|
}
|
||||||
|
// multiple arguments (multiple rxr each)// backwards compatibility
|
||||||
if (args[0].find('+') != std::string::npos) {
|
if (args[0].find('+') != std::string::npos) {
|
||||||
throw sls::RuntimeError(
|
if (det_id != -1) {
|
||||||
"Cannot add multiple receivers at module level");
|
throw sls::RuntimeError(
|
||||||
|
"Cannot add multiple receivers for multiple modules at module level");
|
||||||
|
}
|
||||||
|
for (int i = 0; i < (int)args.size(); ++i) {
|
||||||
|
auto t = sls::split(args[i], '+');
|
||||||
|
det->setRxHostname(t, {i});
|
||||||
|
os << ToString(t) << '\n';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (det_id != -1) {
|
// multiple arguments (single rxr each) (for both: each module and RR)
|
||||||
throw sls::RuntimeError(
|
else {
|
||||||
"Cannot add multiple receivers at module level");
|
det->setRxHostname(args, {det_id});
|
||||||
|
os << ToString(args) << '\n';
|
||||||
}
|
}
|
||||||
det->setRxHostname(args);
|
|
||||||
os << ToString(args) << '\n';
|
|
||||||
}
|
}
|
||||||
// single argument
|
// single argument
|
||||||
else {
|
else {
|
||||||
// multiple receivers concatenated with +
|
// multiple receivers concatenated with +
|
||||||
if (args[0].find('+') != std::string::npos) {
|
if (args[0].find('+') != std::string::npos) {
|
||||||
if (det_id != -1) {
|
|
||||||
throw sls::RuntimeError(
|
|
||||||
"Cannot add multiple receivers at module level");
|
|
||||||
}
|
|
||||||
auto t = sls::split(args[0], '+');
|
auto t = sls::split(args[0], '+');
|
||||||
det->setRxHostname(t);
|
if (t.size() <= 0) {
|
||||||
os << ToString(t) << '\n';
|
throw sls::RuntimeError("Invalid argument for rx_hostname");
|
||||||
|
}
|
||||||
|
// single receiver
|
||||||
|
if (t.size() == 1) {
|
||||||
|
det->setRxHostname(t[0], std::vector<int>{det_id});
|
||||||
|
os << ToString(t[0]) << '\n';
|
||||||
|
}
|
||||||
|
// multiple receivers
|
||||||
|
else {
|
||||||
|
if (rx_id != -1) {
|
||||||
|
throw sls::RuntimeError(
|
||||||
|
"Cannot add multiple receivers at RR level");
|
||||||
|
}
|
||||||
|
det->setRxHostname(t, {det_id});
|
||||||
|
os << ToString(t) << '\n';
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// single receiver
|
// single receiver
|
||||||
else {
|
else {
|
||||||
det->setRxHostname(args[0], std::vector<int>{det_id});
|
det->setRxHostname(args[0], std::vector<int>{det_id}, rx_id);
|
||||||
os << ToString(args) << '\n';
|
os << ToString(args) << '\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -185,8 +185,34 @@
|
|||||||
return os.str(); \
|
return os.str(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define INTEGER_COMMAND_VEC_ID_RX(CMDNAME, GETFCN, SETFCN, CONV, HLPSTR) \
|
||||||
|
std::string CMDNAME(const int action) { \
|
||||||
|
std::ostringstream os; \
|
||||||
|
os << cmd << ' '; \
|
||||||
|
if (action == slsDetectorDefs::HELP_ACTION) \
|
||||||
|
os << HLPSTR << '\n'; \
|
||||||
|
else if (action == slsDetectorDefs::GET_ACTION) { \
|
||||||
|
if (!args.empty()) { \
|
||||||
|
WrongNumberOfParameters(0); \
|
||||||
|
} \
|
||||||
|
auto t = det->GETFCN(std::vector<int>{det_id}, rx_id); \
|
||||||
|
os << OutString(t) << '\n'; \
|
||||||
|
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
||||||
|
if (args.size() != 1) { \
|
||||||
|
WrongNumberOfParameters(1); \
|
||||||
|
} \
|
||||||
|
auto val = CONV(args[0]); \
|
||||||
|
det->SETFCN(val, std::vector<int>{det_id}, rx_id); \
|
||||||
|
os << args.front() << '\n'; \
|
||||||
|
} else { \
|
||||||
|
throw sls::RuntimeError("Unknown action"); \
|
||||||
|
} \
|
||||||
|
return os.str(); \
|
||||||
|
}
|
||||||
|
|
||||||
/** int or enum */
|
/** int or enum */
|
||||||
#define INTEGER_COMMAND_VEC_ID_GET(CMDNAME, GETFCN, SETFCN, CONV, HLPSTR) \
|
#define INTEGER_COMMAND_VEC_ID_PUT_SINGLE_ID(CMDNAME, GETFCN, SETFCN, CONV, \
|
||||||
|
HLPSTR) \
|
||||||
std::string CMDNAME(const int action) { \
|
std::string CMDNAME(const int action) { \
|
||||||
std::ostringstream os; \
|
std::ostringstream os; \
|
||||||
os << cmd << ' '; \
|
os << cmd << ' '; \
|
||||||
@ -211,6 +237,32 @@
|
|||||||
return os.str(); \
|
return os.str(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define INTEGER_COMMAND_VEC_ID_P_RX_SINGLE_ID(CMDNAME, GETFCN, SETFCN, CONV, \
|
||||||
|
HLPSTR) \
|
||||||
|
std::string CMDNAME(const int action) { \
|
||||||
|
std::ostringstream os; \
|
||||||
|
os << cmd << ' '; \
|
||||||
|
if (action == slsDetectorDefs::HELP_ACTION) \
|
||||||
|
os << HLPSTR << '\n'; \
|
||||||
|
else if (action == slsDetectorDefs::GET_ACTION) { \
|
||||||
|
if (!args.empty()) { \
|
||||||
|
WrongNumberOfParameters(0); \
|
||||||
|
} \
|
||||||
|
auto t = det->GETFCN(std::vector<int>{det_id}, rx_id); \
|
||||||
|
os << OutString(t) << '\n'; \
|
||||||
|
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
||||||
|
if (args.size() != 1) { \
|
||||||
|
WrongNumberOfParameters(1); \
|
||||||
|
} \
|
||||||
|
auto val = CONV(args[0]); \
|
||||||
|
det->SETFCN(val, det_id, rx_id); \
|
||||||
|
os << args.front() << '\n'; \
|
||||||
|
} else { \
|
||||||
|
throw sls::RuntimeError("Unknown action"); \
|
||||||
|
} \
|
||||||
|
return os.str(); \
|
||||||
|
}
|
||||||
|
|
||||||
/** int or enum */
|
/** int or enum */
|
||||||
#define INTEGER_COMMAND_SINGLE_ID(CMDNAME, GETFCN, SETFCN, CONV, HLPSTR) \
|
#define INTEGER_COMMAND_SINGLE_ID(CMDNAME, GETFCN, SETFCN, CONV, HLPSTR) \
|
||||||
std::string CMDNAME(const int action) { \
|
std::string CMDNAME(const int action) { \
|
||||||
@ -461,6 +513,26 @@
|
|||||||
return os.str(); \
|
return os.str(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define GET_COMMAND_RX(CMDNAME, GETFCN, HLPSTR) \
|
||||||
|
std::string CMDNAME(const int action) { \
|
||||||
|
std::ostringstream os; \
|
||||||
|
os << cmd << ' '; \
|
||||||
|
if (action == slsDetectorDefs::HELP_ACTION) \
|
||||||
|
os << HLPSTR << '\n'; \
|
||||||
|
else if (action == slsDetectorDefs::GET_ACTION) { \
|
||||||
|
if (!args.empty()) { \
|
||||||
|
WrongNumberOfParameters(0); \
|
||||||
|
} \
|
||||||
|
auto t = det->GETFCN(std::vector<int>{det_id}); \
|
||||||
|
os << OutString(t) << '\n'; \
|
||||||
|
} else if (action == slsDetectorDefs::PUT_ACTION) { \
|
||||||
|
throw sls::RuntimeError("Cannot put"); \
|
||||||
|
} else { \
|
||||||
|
throw sls::RuntimeError("Unknown action"); \
|
||||||
|
} \
|
||||||
|
return os.str(); \
|
||||||
|
}
|
||||||
|
|
||||||
/** get only no id (vector, not result) */
|
/** get only no id (vector, not result) */
|
||||||
#define GET_COMMAND_NOID(CMDNAME, GETFCN, HLPSTR) \
|
#define GET_COMMAND_NOID(CMDNAME, GETFCN, HLPSTR) \
|
||||||
std::string CMDNAME(const int action) { \
|
std::string CMDNAME(const int action) { \
|
||||||
@ -1282,7 +1354,7 @@ class CmdProxy {
|
|||||||
"interfaces must be set to 2. slsReceiver and slsDetectorGui "
|
"interfaces must be set to 2. slsReceiver and slsDetectorGui "
|
||||||
"does not handle.");
|
"does not handle.");
|
||||||
|
|
||||||
INTEGER_COMMAND_VEC_ID_GET(
|
INTEGER_COMMAND_VEC_ID_PUT_SINGLE_ID(
|
||||||
master, getMaster, setMaster, StringTo<int>,
|
master, getMaster, setMaster, StringTo<int>,
|
||||||
"[0, 1]\n\t[Eiger] Sets half module to master and "
|
"[0, 1]\n\t[Eiger] Sets half module to master and "
|
||||||
"others to slaves.\n\t[Gotthard][Gotthard2][Mythen3][Eiger] "
|
"others to slaves.\n\t[Gotthard][Gotthard2][Mythen3][Eiger] "
|
||||||
@ -1617,14 +1689,14 @@ class CmdProxy {
|
|||||||
"[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the top "
|
"[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the top "
|
||||||
"half or inner (source) udp interface. ");
|
"half or inner (source) udp interface. ");
|
||||||
|
|
||||||
INTEGER_COMMAND_VEC_ID(
|
INTEGER_COMMAND_VEC_ID_RX(
|
||||||
udp_dstmac, getDestinationUDPMAC, setDestinationUDPMAC, MacAddr,
|
udp_dstmac, getDestinationUDPMAC, setDestinationUDPMAC, MacAddr,
|
||||||
"[x:x:x:x:x:x]\n\tMac address of the receiver (destination) udp "
|
"[x:x:x:x:x:x]\n\tMac address of the receiver (destination) udp "
|
||||||
"interface. Not mandatory to set as udp_dstip retrieves it from "
|
"interface. Not mandatory to set as udp_dstip retrieves it from "
|
||||||
"slsReceiver process, but must be set if you use a custom receiver "
|
"slsReceiver process, but must be set if you use a custom receiver "
|
||||||
"(not slsReceiver).");
|
"(not slsReceiver).");
|
||||||
|
|
||||||
INTEGER_COMMAND_VEC_ID(
|
INTEGER_COMMAND_VEC_ID_RX(
|
||||||
udp_dstmac2, getDestinationUDPMAC2, setDestinationUDPMAC2, MacAddr,
|
udp_dstmac2, getDestinationUDPMAC2, setDestinationUDPMAC2, MacAddr,
|
||||||
"[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the receiver (destination) "
|
"[x:x:x:x:x:x]\n\t[Jungfrau] Mac address of the receiver (destination) "
|
||||||
"udp interface 2. Not mandatory to set as udp_dstip2 retrieves it from "
|
"udp interface 2. Not mandatory to set as udp_dstip2 retrieves it from "
|
||||||
@ -1633,14 +1705,14 @@ class CmdProxy {
|
|||||||
"[Gotthard2] veto "
|
"[Gotthard2] veto "
|
||||||
"debugging.");
|
"debugging.");
|
||||||
|
|
||||||
INTEGER_COMMAND_VEC_ID_GET(
|
INTEGER_COMMAND_VEC_ID_P_RX_SINGLE_ID(
|
||||||
udp_dstport, getDestinationUDPPort, setDestinationUDPPort,
|
udp_dstport, getDestinationUDPPort, setDestinationUDPPort,
|
||||||
StringTo<int>,
|
StringTo<int>,
|
||||||
"[n]\n\tPort number of the receiver (destination) udp "
|
"[n]\n\tPort number of the receiver (destination) udp "
|
||||||
"interface. Default is 50001. \n\tIf multi command, ports for each "
|
"interface. Default is 50001. \n\tIf multi command, ports for each "
|
||||||
"module is calculated (incremented by 1 if no 2nd interface)");
|
"module is calculated (incremented by 1 if no 2nd interface)");
|
||||||
|
|
||||||
INTEGER_COMMAND_VEC_ID_GET(
|
INTEGER_COMMAND_VEC_ID_P_RX_SINGLE_ID(
|
||||||
udp_dstport2, getDestinationUDPPort2, setDestinationUDPPort2,
|
udp_dstport2, getDestinationUDPPort2, setDestinationUDPPort2,
|
||||||
StringTo<int>,
|
StringTo<int>,
|
||||||
"[n]\n\t[Jungfrau][Eiger][Gotthard2] Port number of the "
|
"[n]\n\t[Jungfrau][Eiger][Gotthard2] Port number of the "
|
||||||
@ -1662,8 +1734,8 @@ class CmdProxy {
|
|||||||
"valid. If not configured, it will throw with error message "
|
"valid. If not configured, it will throw with error message "
|
||||||
"requesting missing udp information.");
|
"requesting missing udp information.");
|
||||||
|
|
||||||
GET_COMMAND(rx_printconfig, printRxConfiguration,
|
GET_COMMAND_RX(rx_printconfig, printRxConfiguration,
|
||||||
"\n\tPrints the receiver configuration.");
|
"\n\tPrints the receiver configuration.");
|
||||||
|
|
||||||
INTEGER_COMMAND_VEC_ID(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
tengiga, getTenGiga, setTenGiga, StringTo<int>,
|
tengiga, getTenGiga, setTenGiga, StringTo<int>,
|
||||||
@ -1699,7 +1771,7 @@ class CmdProxy {
|
|||||||
|
|
||||||
/* Receiver Config */
|
/* Receiver Config */
|
||||||
|
|
||||||
INTEGER_COMMAND_VEC_ID_GET(
|
INTEGER_COMMAND_VEC_ID_P_RX_SINGLE_ID(
|
||||||
rx_tcpport, getRxPort, setRxPort, StringTo<int>,
|
rx_tcpport, getRxPort, setRxPort, StringTo<int>,
|
||||||
"[port]\n\tTCP port for client-receiver communication. Default is "
|
"[port]\n\tTCP port for client-receiver communication. Default is "
|
||||||
"1954. Must be different if multiple receivers on same pc. Must be "
|
"1954. Must be different if multiple receivers on same pc. Must be "
|
||||||
@ -1824,7 +1896,7 @@ class CmdProxy {
|
|||||||
"default, which streams the first frame in an acquisition, "
|
"default, which streams the first frame in an acquisition, "
|
||||||
"and then depending on the rx zmq frequency/ timer");
|
"and then depending on the rx zmq frequency/ timer");
|
||||||
|
|
||||||
INTEGER_COMMAND_VEC_ID_GET(
|
INTEGER_COMMAND_VEC_ID_PUT_SINGLE_ID(
|
||||||
rx_zmqport, getRxZmqPort, setRxZmqPort, StringTo<int>,
|
rx_zmqport, getRxZmqPort, setRxZmqPort, StringTo<int>,
|
||||||
"[port]\n\tZmq port for data to be streamed out of the receiver. Also "
|
"[port]\n\tZmq port for data to be streamed out of the receiver. Also "
|
||||||
"restarts receiver zmq streaming if enabled. Default is 30001. "
|
"restarts receiver zmq streaming if enabled. Default is 30001. "
|
||||||
@ -1832,7 +1904,7 @@ class CmdProxy {
|
|||||||
"client(gui). Must be different for every detector (and udp port). "
|
"client(gui). Must be different for every detector (and udp port). "
|
||||||
"Multi command will automatically increment for individual modules.");
|
"Multi command will automatically increment for individual modules.");
|
||||||
|
|
||||||
INTEGER_COMMAND_VEC_ID_GET(
|
INTEGER_COMMAND_VEC_ID_PUT_SINGLE_ID(
|
||||||
zmqport, getClientZmqPort, setClientZmqPort, StringTo<int>,
|
zmqport, getClientZmqPort, setClientZmqPort, StringTo<int>,
|
||||||
"[port]\n\tZmq port in client(gui) or intermediate process for data to "
|
"[port]\n\tZmq port in client(gui) or intermediate process for data to "
|
||||||
"be streamed to from receiver. Default connects to receiver zmq "
|
"be streamed to from receiver. Default connects to receiver zmq "
|
||||||
@ -1842,7 +1914,7 @@ class CmdProxy {
|
|||||||
"port). Multi command will automatically increment for individual "
|
"port). Multi command will automatically increment for individual "
|
||||||
"modules.");
|
"modules.");
|
||||||
|
|
||||||
INTEGER_COMMAND_VEC_ID(
|
INTEGER_COMMAND_VEC_ID_RX(
|
||||||
rx_zmqip, getRxZmqIP, setRxZmqIP, IpAddr,
|
rx_zmqip, getRxZmqIP, setRxZmqIP, IpAddr,
|
||||||
"[x.x.x.x]\n\tZmq Ip Address from which data is to be streamed out of "
|
"[x.x.x.x]\n\tZmq Ip Address from which data is to be streamed out of "
|
||||||
"the receiver. Also restarts receiver zmq streaming if enabled. "
|
"the receiver. Also restarts receiver zmq streaming if enabled. "
|
||||||
|
@ -977,67 +977,81 @@ void Detector::setFirstUDPDestination(const int value, Positions pos) {
|
|||||||
pimpl->Parallel(&Module::setFirstUDPDestination, pos, value);
|
pimpl->Parallel(&Module::setFirstUDPDestination, pos, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<IpAddr> Detector::getDestinationUDPIP(Positions pos) const {
|
Result<IpAddr> Detector::getDestinationUDPIP(Positions pos,
|
||||||
return pimpl->Parallel(&Module::getDestinationUDPIP, pos);
|
const int rx_index) const {
|
||||||
|
return pimpl->Parallel(&Module::getDestinationUDPIP, pos, rx_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setDestinationUDPIP(const IpAddr ip, Positions pos) {
|
void Detector::setDestinationUDPIP(const IpAddr ip, Positions pos,
|
||||||
pimpl->Parallel(&Module::setDestinationUDPIP, pos, ip);
|
const int rx_index) {
|
||||||
|
pimpl->Parallel(&Module::setDestinationUDPIP, pos, ip, rx_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<IpAddr> Detector::getDestinationUDPIP2(Positions pos) const {
|
Result<IpAddr> Detector::getDestinationUDPIP2(Positions pos,
|
||||||
return pimpl->Parallel(&Module::getDestinationUDPIP2, pos);
|
const int rx_index) const {
|
||||||
|
return pimpl->Parallel(&Module::getDestinationUDPIP2, pos, rx_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setDestinationUDPIP2(const IpAddr ip, Positions pos) {
|
void Detector::setDestinationUDPIP2(const IpAddr ip, Positions pos,
|
||||||
pimpl->Parallel(&Module::setDestinationUDPIP2, pos, ip);
|
const int rx_index) {
|
||||||
|
pimpl->Parallel(&Module::setDestinationUDPIP2, pos, ip, rx_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<MacAddr> Detector::getDestinationUDPMAC(Positions pos) const {
|
Result<MacAddr> Detector::getDestinationUDPMAC(Positions pos,
|
||||||
return pimpl->Parallel(&Module::getDestinationUDPMAC, pos);
|
const int rx_index) const {
|
||||||
|
return pimpl->Parallel(&Module::getDestinationUDPMAC, pos, rx_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setDestinationUDPMAC(const MacAddr mac, Positions pos) {
|
void Detector::setDestinationUDPMAC(const MacAddr mac, Positions pos,
|
||||||
pimpl->Parallel(&Module::setDestinationUDPMAC, pos, mac);
|
const int rx_index) {
|
||||||
|
pimpl->Parallel(&Module::setDestinationUDPMAC, pos, mac, rx_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<MacAddr> Detector::getDestinationUDPMAC2(Positions pos) const {
|
Result<MacAddr> Detector::getDestinationUDPMAC2(Positions pos,
|
||||||
return pimpl->Parallel(&Module::getDestinationUDPMAC2, pos);
|
const int rx_index) const {
|
||||||
|
return pimpl->Parallel(&Module::getDestinationUDPMAC2, pos, rx_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setDestinationUDPMAC2(const MacAddr mac, Positions pos) {
|
void Detector::setDestinationUDPMAC2(const MacAddr mac, Positions pos,
|
||||||
pimpl->Parallel(&Module::setDestinationUDPMAC2, pos, mac);
|
const int rx_index) {
|
||||||
|
pimpl->Parallel(&Module::setDestinationUDPMAC2, pos, mac, rx_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<int> Detector::getDestinationUDPPort(Positions pos) const {
|
Result<int> Detector::getDestinationUDPPort(Positions pos,
|
||||||
return pimpl->Parallel(&Module::getDestinationUDPPort, pos);
|
const int rx_index) const {
|
||||||
|
return pimpl->Parallel(&Module::getDestinationUDPPort, pos, rx_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setDestinationUDPPort(int port, int module_id) {
|
void Detector::setDestinationUDPPort(int port, int module_id,
|
||||||
|
const int rx_index) {
|
||||||
if (module_id == -1) {
|
if (module_id == -1) {
|
||||||
std::vector<int> port_list = getPortNumbers(port);
|
std::vector<int> port_list = getPortNumbers(port);
|
||||||
for (int idet = 0; idet < size(); ++idet) {
|
for (int idet = 0; idet < size(); ++idet) {
|
||||||
pimpl->Parallel(&Module::setDestinationUDPPort, {idet},
|
pimpl->Parallel(&Module::setDestinationUDPPort, {idet},
|
||||||
port_list[idet]);
|
port_list[idet], rx_index);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pimpl->Parallel(&Module::setDestinationUDPPort, {module_id}, port);
|
pimpl->Parallel(&Module::setDestinationUDPPort, {module_id}, port,
|
||||||
|
rx_index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<int> Detector::getDestinationUDPPort2(Positions pos) const {
|
Result<int> Detector::getDestinationUDPPort2(Positions pos,
|
||||||
return pimpl->Parallel(&Module::getDestinationUDPPort2, pos);
|
const int rx_index) const {
|
||||||
|
return pimpl->Parallel(&Module::getDestinationUDPPort2, pos, rx_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setDestinationUDPPort2(int port, int module_id) {
|
void Detector::setDestinationUDPPort2(int port, int module_id,
|
||||||
|
const int rx_index) {
|
||||||
if (module_id == -1) {
|
if (module_id == -1) {
|
||||||
std::vector<int> port_list = getPortNumbers(port);
|
std::vector<int> port_list = getPortNumbers(port);
|
||||||
for (int idet = 0; idet < size(); ++idet) {
|
for (int idet = 0; idet < size(); ++idet) {
|
||||||
pimpl->Parallel(&Module::setDestinationUDPPort2, {idet},
|
pimpl->Parallel(&Module::setDestinationUDPPort2, {idet},
|
||||||
port_list[idet]);
|
port_list[idet], rx_index);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pimpl->Parallel(&Module::setDestinationUDPPort2, {module_id}, port);
|
pimpl->Parallel(&Module::setDestinationUDPPort2, {module_id}, port,
|
||||||
|
rx_index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1049,8 +1063,9 @@ void Detector::validateUDPConfiguration(Positions pos) {
|
|||||||
pimpl->Parallel(&Module::validateUDPConfiguration, pos);
|
pimpl->Parallel(&Module::validateUDPConfiguration, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<std::string> Detector::printRxConfiguration(Positions pos) const {
|
Result<std::string> Detector::printRxConfiguration(Positions pos,
|
||||||
return pimpl->Parallel(&Module::printReceiverConfiguration, pos);
|
const int rx_index) const {
|
||||||
|
return pimpl->Parallel(&Module::printReceiverConfiguration, pos, rx_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<bool> Detector::getTenGiga(Positions pos) const {
|
Result<bool> Detector::getTenGiga(Positions pos) const {
|
||||||
@ -1099,48 +1114,61 @@ Result<bool> Detector::getUseReceiverFlag(Positions pos) const {
|
|||||||
return pimpl->Parallel(&Module::getUseReceiverFlag, pos);
|
return pimpl->Parallel(&Module::getUseReceiverFlag, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<std::string> Detector::getRxHostname(Positions pos) const {
|
Result<std::string> Detector::getRxHostname(Positions pos,
|
||||||
return pimpl->Parallel(&Module::getReceiverHostname, pos);
|
const int rx_index) const {
|
||||||
|
return pimpl->Parallel(&Module::getReceiverHostname, pos, rx_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setRxHostname(const std::string &receiver, Positions pos) {
|
// rr added using + at module level
|
||||||
pimpl->Parallel(&Module::setReceiverHostname, pos, receiver);
|
void Detector::setRxHostname(const std::string &receiver, Positions pos,
|
||||||
|
const int rxIndex) {
|
||||||
|
// for backwards compatibility
|
||||||
|
if (rxIndex == -1) {
|
||||||
|
pimpl->Parallel(&Module::setReceiverHostname, pos, receiver, 0);
|
||||||
|
} else {
|
||||||
|
pimpl->Parallel(&Module::setReceiverHostname, pos, receiver, rxIndex);
|
||||||
|
}
|
||||||
updateRxRateCorrections();
|
updateRxRateCorrections();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setRxHostname(const std::vector<std::string> &name) {
|
void Detector::setRxHostname(const std::vector<std::string> &name,
|
||||||
// set all to same rx_hostname
|
Positions pos) {
|
||||||
if (name.size() == 1) {
|
// multi module (backwards compatibility: every element for every module)
|
||||||
pimpl->Parallel(&Module::setReceiverHostname, {}, name[0]);
|
if (name.size() > 1 && ((pos.empty() || pos[0] == -1))) {
|
||||||
} else {
|
|
||||||
if ((int)name.size() != size()) {
|
if ((int)name.size() != size()) {
|
||||||
throw RuntimeError(
|
throw RuntimeError(
|
||||||
"Receiver hostnames size " + std::to_string(name.size()) +
|
"Receiver hostnames size " + std::to_string(name.size()) +
|
||||||
" does not match detector size " + std::to_string(size()));
|
" does not match detector size " + std::to_string(size()));
|
||||||
}
|
}
|
||||||
// set each rx_hostname
|
|
||||||
for (int idet = 0; idet < size(); ++idet) {
|
for (int idet = 0; idet < size(); ++idet) {
|
||||||
pimpl->Parallel(&Module::setReceiverHostname, {idet}, name[idet]);
|
pimpl->Parallel(&Module::setReceiverHostname, {idet}, name[idet],
|
||||||
|
0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// setting rr for specific module (backwards compaibility: single element is
|
||||||
|
// only for 0th RR)
|
||||||
|
else {
|
||||||
|
pimpl->Parallel(&Module::setAllReceiverHostnames, {pos}, name);
|
||||||
|
}
|
||||||
updateRxRateCorrections();
|
updateRxRateCorrections();
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<int> Detector::getRxPort(Positions pos) const {
|
Result<int> Detector::getRxPort(Positions pos, const int rx_index) const {
|
||||||
return pimpl->Parallel(&Module::getReceiverPort, pos);
|
return pimpl->Parallel(&Module::getReceiverPort, pos, rx_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setRxPort(int port, int module_id) {
|
void Detector::setRxPort(int port, int module_id, const int rx_index) {
|
||||||
if (module_id == -1) {
|
if (module_id == -1) {
|
||||||
std::vector<int> port_list(size());
|
std::vector<int> port_list(size());
|
||||||
for (auto &it : port_list) {
|
for (auto &it : port_list) {
|
||||||
it = port++;
|
it = port++;
|
||||||
}
|
}
|
||||||
for (int idet = 0; idet < size(); ++idet) {
|
for (int idet = 0; idet < size(); ++idet) {
|
||||||
pimpl->Parallel(&Module::setReceiverPort, {idet}, port_list[idet]);
|
pimpl->Parallel(&Module::setReceiverPort, {idet}, port_list[idet],
|
||||||
|
rx_index);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
pimpl->Parallel(&Module::setReceiverPort, {module_id}, port);
|
pimpl->Parallel(&Module::setReceiverPort, {module_id}, port, rx_index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1338,13 +1366,13 @@ void Detector::setRxZmqPort(int port, int module_id) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Result<IpAddr> Detector::getRxZmqIP(Positions pos) const {
|
Result<IpAddr> Detector::getRxZmqIP(Positions pos, const int rx_index) const {
|
||||||
return pimpl->Parallel(&Module::getReceiverStreamingIP, pos);
|
return pimpl->Parallel(&Module::getReceiverStreamingIP, pos, rx_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Detector::setRxZmqIP(const IpAddr ip, Positions pos) {
|
void Detector::setRxZmqIP(const IpAddr ip, Positions pos, const int rx_index) {
|
||||||
bool previouslyReceiverStreaming = getRxZmqDataStream(pos).squash(false);
|
bool previouslyReceiverStreaming = getRxZmqDataStream(pos).squash(false);
|
||||||
pimpl->Parallel(&Module::setReceiverStreamingIP, pos, ip);
|
pimpl->Parallel(&Module::setReceiverStreamingIP, pos, ip, rx_index);
|
||||||
if (previouslyReceiverStreaming) {
|
if (previouslyReceiverStreaming) {
|
||||||
setRxZmqDataStream(false, pos);
|
setRxZmqDataStream(false, pos);
|
||||||
setRxZmqDataStream(true, pos);
|
setRxZmqDataStream(true, pos);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -17,10 +17,15 @@
|
|||||||
class ServerInterface;
|
class ServerInterface;
|
||||||
|
|
||||||
#define MODULE_SHMAPIVERSION 0x190726
|
#define MODULE_SHMAPIVERSION 0x190726
|
||||||
#define MODULE_SHMVERSION 0x200402
|
#define MODULE_SHMVERSION 0x210913
|
||||||
|
|
||||||
namespace sls {
|
namespace sls {
|
||||||
|
|
||||||
|
struct sharedReceiver {
|
||||||
|
char hostname[MAX_STR_LENGTH]{};
|
||||||
|
int tcpPort{};
|
||||||
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @short structure allocated in shared memory to store Module settings for
|
* @short structure allocated in shared memory to store Module settings for
|
||||||
* IPC and cache
|
* IPC and cache
|
||||||
@ -45,8 +50,11 @@ struct sharedModule {
|
|||||||
slsDetectorDefs::xy nChan;
|
slsDetectorDefs::xy nChan;
|
||||||
slsDetectorDefs::xy nChip;
|
slsDetectorDefs::xy nChip;
|
||||||
int nDacs;
|
int nDacs;
|
||||||
char rxHostname[MAX_STR_LENGTH];
|
|
||||||
int rxTCPPort;
|
/** receiver details for each module */
|
||||||
|
int numReceivers;
|
||||||
|
sharedReceiver receivers[MAX_UDP_DESTINATION];
|
||||||
|
|
||||||
/** if rxHostname and rxTCPPort can be connected to */
|
/** if rxHostname and rxTCPPort can be connected to */
|
||||||
bool useReceiverFlag;
|
bool useReceiverFlag;
|
||||||
/** Listening tcp port from gui (only data) */
|
/** Listening tcp port from gui (only data) */
|
||||||
@ -236,21 +244,21 @@ class Module : public virtual slsDetectorDefs {
|
|||||||
void clearUDPDestinations();
|
void clearUDPDestinations();
|
||||||
int getFirstUDPDestination() const;
|
int getFirstUDPDestination() const;
|
||||||
void setFirstUDPDestination(const int value);
|
void setFirstUDPDestination(const int value);
|
||||||
sls::IpAddr getDestinationUDPIP() const;
|
sls::IpAddr getDestinationUDPIP(const int rxIndex) const;
|
||||||
void setDestinationUDPIP(const sls::IpAddr ip);
|
void setDestinationUDPIP(const sls::IpAddr ip, const int rxIndex);
|
||||||
sls::IpAddr getDestinationUDPIP2() const;
|
sls::IpAddr getDestinationUDPIP2(const int rxIndex) const;
|
||||||
void setDestinationUDPIP2(const sls::IpAddr ip);
|
void setDestinationUDPIP2(const sls::IpAddr ip, const int rxIndex);
|
||||||
sls::MacAddr getDestinationUDPMAC() const;
|
sls::MacAddr getDestinationUDPMAC(const int rxIndex) const;
|
||||||
void setDestinationUDPMAC(const sls::MacAddr mac);
|
void setDestinationUDPMAC(const sls::MacAddr mac, const int rxIndex);
|
||||||
sls::MacAddr getDestinationUDPMAC2() const;
|
sls::MacAddr getDestinationUDPMAC2(const int rxIndex) const;
|
||||||
void setDestinationUDPMAC2(const sls::MacAddr mac);
|
void setDestinationUDPMAC2(const sls::MacAddr mac, const int rxIndex);
|
||||||
int getDestinationUDPPort() const;
|
int getDestinationUDPPort(const int rxIndex) const;
|
||||||
void setDestinationUDPPort(int udpport);
|
void setDestinationUDPPort(int udpport, const int rxIndex);
|
||||||
int getDestinationUDPPort2() const;
|
int getDestinationUDPPort2(const int rxIndex) const;
|
||||||
void setDestinationUDPPort2(int udpport);
|
void setDestinationUDPPort2(int udpport, const int rxIndex);
|
||||||
void reconfigureUDPDestination();
|
void reconfigureUDPDestination();
|
||||||
void validateUDPConfiguration();
|
void validateUDPConfiguration();
|
||||||
std::string printReceiverConfiguration();
|
std::string printReceiverConfiguration(const int rxIndex);
|
||||||
bool getTenGiga() const;
|
bool getTenGiga() const;
|
||||||
void setTenGiga(bool value);
|
void setTenGiga(bool value);
|
||||||
bool getTenGigaFlowControl() const;
|
bool getTenGigaFlowControl() const;
|
||||||
@ -268,10 +276,11 @@ class Module : public virtual slsDetectorDefs {
|
|||||||
* *
|
* *
|
||||||
* ************************************************/
|
* ************************************************/
|
||||||
bool getUseReceiverFlag() const;
|
bool getUseReceiverFlag() const;
|
||||||
std::string getReceiverHostname() const;
|
std::string getReceiverHostname(const int rxIndex) const;
|
||||||
void setReceiverHostname(const std::string &receiver);
|
void setAllReceiverHostnames(const std::vector<std::string> &receiver);
|
||||||
int getReceiverPort() const;
|
void setReceiverHostname(const std::string &receiver, const int rxIndex);
|
||||||
int setReceiverPort(int port_number);
|
int getReceiverPort(const int rxIndex) const;
|
||||||
|
void setReceiverPort(int port_number, const int rxIndex);
|
||||||
int getReceiverFifoDepth() const;
|
int getReceiverFifoDepth() const;
|
||||||
void setReceiverFifoDepth(int n_frames);
|
void setReceiverFifoDepth(int n_frames);
|
||||||
bool getReceiverSilentMode() const;
|
bool getReceiverSilentMode() const;
|
||||||
@ -330,8 +339,8 @@ class Module : public virtual slsDetectorDefs {
|
|||||||
void setReceiverStreamingStartingFrame(int fnum);
|
void setReceiverStreamingStartingFrame(int fnum);
|
||||||
int getReceiverStreamingPort() const;
|
int getReceiverStreamingPort() const;
|
||||||
void setReceiverStreamingPort(int port);
|
void setReceiverStreamingPort(int port);
|
||||||
sls::IpAddr getReceiverStreamingIP() const;
|
sls::IpAddr getReceiverStreamingIP(const int rxIndex) const;
|
||||||
void setReceiverStreamingIP(const sls::IpAddr ip);
|
void setReceiverStreamingIP(const sls::IpAddr ip, const int rxIndex);
|
||||||
int getClientStreamingPort() const;
|
int getClientStreamingPort() const;
|
||||||
void setClientStreamingPort(int port);
|
void setClientStreamingPort(int port);
|
||||||
sls::IpAddr getClientStreamingIP() const;
|
sls::IpAddr getClientStreamingIP() const;
|
||||||
@ -671,43 +680,52 @@ class Module : public virtual slsDetectorDefs {
|
|||||||
Ret sendToDetectorStop(int fnum, const Arg &args) const;
|
Ret sendToDetectorStop(int fnum, const Arg &args) const;
|
||||||
|
|
||||||
/** Send function parameters to receiver */
|
/** Send function parameters to receiver */
|
||||||
void sendToReceiver(int fnum, const void *args, size_t args_size,
|
std::vector<int> getEntryList(const int rxIndex) const;
|
||||||
void *retval, size_t retval_size);
|
void sendToReceiver(const int rxIndex, int fnum, const void *args,
|
||||||
|
size_t args_size, void *retval, size_t retval_size);
|
||||||
|
|
||||||
void sendToReceiver(int fnum, const void *args, size_t args_size,
|
void sendToReceiver(const int rxIndex, int fnum, const void *args,
|
||||||
void *retval, size_t retval_size) const;
|
size_t args_size, void *retval,
|
||||||
|
size_t retval_size) const;
|
||||||
|
|
||||||
template <typename Arg, typename Ret>
|
template <typename Arg, typename Ret>
|
||||||
void sendToReceiver(int fnum, const Arg &args, Ret &retval);
|
void sendToReceiver(const int rxIndex, int fnum, const Arg &args,
|
||||||
|
Ret &retval);
|
||||||
|
|
||||||
template <typename Arg, typename Ret>
|
template <typename Arg, typename Ret>
|
||||||
void sendToReceiver(int fnum, const Arg &args, Ret &retval) const;
|
void sendToReceiver(const int rxIndex, int fnum, const Arg &args,
|
||||||
|
Ret &retval) const;
|
||||||
|
|
||||||
template <typename Arg>
|
template <typename Arg>
|
||||||
void sendToReceiver(int fnum, const Arg &args, std::nullptr_t);
|
void sendToReceiver(const int rxIndex, int fnum, const Arg &args,
|
||||||
|
std::nullptr_t);
|
||||||
|
|
||||||
template <typename Arg>
|
template <typename Arg>
|
||||||
void sendToReceiver(int fnum, const Arg &args, std::nullptr_t) const;
|
void sendToReceiver(const int rxIndex, int fnum, const Arg &args,
|
||||||
|
std::nullptr_t) const;
|
||||||
|
|
||||||
template <typename Ret>
|
template <typename Ret>
|
||||||
void sendToReceiver(int fnum, std::nullptr_t, Ret &retval);
|
void sendToReceiver(const int rxIndex, int fnum, std::nullptr_t,
|
||||||
|
Ret &retval);
|
||||||
|
|
||||||
template <typename Ret>
|
template <typename Ret>
|
||||||
void sendToReceiver(int fnum, std::nullptr_t, Ret &retval) const;
|
void sendToReceiver(const int rxIndex, int fnum, std::nullptr_t,
|
||||||
|
Ret &retval) const;
|
||||||
|
|
||||||
template <typename Ret> Ret sendToReceiver(int fnum);
|
template <typename Ret> Ret sendToReceiver(const int rxIndex, int fnum);
|
||||||
|
|
||||||
template <typename Ret> Ret sendToReceiver(int fnum) const;
|
template <typename Ret>
|
||||||
|
Ret sendToReceiver(const int rxIndex, int fnum) const;
|
||||||
|
|
||||||
void sendToReceiver(int fnum);
|
void sendToReceiver(const int rxIndex, int fnum);
|
||||||
|
|
||||||
void sendToReceiver(int fnum) const;
|
void sendToReceiver(const int rxIndex, int fnum) const;
|
||||||
|
|
||||||
template <typename Ret, typename Arg>
|
template <typename Ret, typename Arg>
|
||||||
Ret sendToReceiver(int fnum, const Arg &args);
|
Ret sendToReceiver(const int rxIndex, int fnum, const Arg &args);
|
||||||
|
|
||||||
template <typename Ret, typename Arg>
|
template <typename Ret, typename Arg>
|
||||||
Ret sendToReceiver(int fnum, const Arg &args) const;
|
Ret sendToReceiver(const int rxIndex, int fnum, const Arg &args) const;
|
||||||
|
|
||||||
/** Get Detector Type from Shared Memory
|
/** Get Detector Type from Shared Memory
|
||||||
verify is if shm size matches existing one */
|
verify is if shm size matches existing one */
|
||||||
@ -725,7 +743,7 @@ class Module : public virtual slsDetectorDefs {
|
|||||||
void checkReceiverVersionCompatibility();
|
void checkReceiverVersionCompatibility();
|
||||||
void setModule(sls_detector_module &module, bool trimbits = true);
|
void setModule(sls_detector_module &module, bool trimbits = true);
|
||||||
int sendModule(sls_detector_module *myMod, sls::ClientSocket &client);
|
int sendModule(sls_detector_module *myMod, sls::ClientSocket &client);
|
||||||
void updateReceiverStreamingIP();
|
void updateReceiverStreamingIP(const int rxIndex);
|
||||||
|
|
||||||
void updateRateCorrection();
|
void updateRateCorrection();
|
||||||
/** Template function to do linear interpolation between two points (Eiger
|
/** Template function to do linear interpolation between two points (Eiger
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
// SPDX-License-Identifier: LGPL-3.0-or-other
|
// SPDX-License-Identifier: LGPL-3.0-or-other
|
||||||
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
// Copyright (C) 2021 Contributors to the SLS Detector Package
|
||||||
/** API versions */
|
/** API versions */
|
||||||
#define GITBRANCH "developer"
|
#define GITBRANCH "developer"
|
||||||
#define APILIB 0x211125
|
#define APILIB 0x211125
|
||||||
#define APIRECEIVER 0x211124
|
#define APIRECEIVER 0x211124
|
||||||
#define APIGUI 0x211124
|
#define APIGUI 0x211124
|
||||||
|
|
||||||
#define APICTB 0x220318
|
#define APICTB 0x220902
|
||||||
#define APIGOTTHARD 0x220318
|
#define APIGOTTHARD 0x220902
|
||||||
#define APIGOTTHARD2 0x220318
|
#define APIGOTTHARD2 0x220902
|
||||||
#define APIJUNGFRAU 0x220318
|
#define APIJUNGFRAU 0x220902
|
||||||
#define APIMYTHEN3 0x220318
|
#define APIMYTHEN3 0x220902
|
||||||
#define APIMOENCH 0x220318
|
#define APIMOENCH 0x220902
|
||||||
#define APIEIGER 0x220318
|
#define APIEIGER 0x220902
|
||||||
|
Reference in New Issue
Block a user