g2 and m3 round robin (#559)

* g2 and m3: round robin
This commit is contained in:
Dhanya Thattil
2022-10-18 15:51:23 +02:00
committed by GitHub
parent 46bb9bc2d7
commit e7879ee365
20 changed files with 290 additions and 193 deletions

View File

@ -718,15 +718,17 @@ class Detector {
void setDestinationUDPList(const UdpDestination, const int module_id);
/** [Jungfrau][Eiger] */
/** [Jungfrau][Eiger][Mythen3][Gotthard2] */
Result<int> getNumberofUDPDestinations(Positions pos = {}) const;
void clearUDPDestinations(Positions pos = {});
/** [Jungfrau] */
/** [Jungfrau][Mythen3][Gotthard2] */
Result<int> getFirstUDPDestination(Positions pos = {}) const;
/**[Jungfrau] Options 0-31 (or number of udp destinations) */
/**[Jungfrau][Gotthard2] Options 0-31 (or number of udp destinations)\n
* [Mythen3] Options 0-63 (or number of udp destinations)
*/
void setFirstUDPDestination(const int value, Positions pos = {});
Result<IpAddr> getDestinationUDPIP(Positions pos = {}) const;

View File

@ -1519,9 +1519,10 @@ std::string CmdProxy::UDPDestinationList(int action) {
"\n\t[mac=xx:xx:xx:xx:xx:xx] "
"[(optional)mac2=xx:xx:xx:xx:xx:xx]\n\t[port=value] "
"[(optional)port2=value\n\tThe order of ip, mac and port does "
"not matter. entry_value can be >0 only for Eiger and Jungfrau "
"where round robin is implemented. If 'auto' used, then ip is "
"set to ip of rx_hostname."
"not matter. entry_value can be >0 only for "
"[Eiger][Jungfrau][Mythen3][Gotthard2] where round robin is "
"implemented. If 'auto' used, then ip is set to ip of "
"rx_hostname."
<< '\n';
} else if (action == defs::GET_ACTION) {
if (!args.empty()) {

View File

@ -1600,9 +1600,9 @@ class CmdProxy {
GET_COMMAND(
udp_numdst, getNumberofUDPDestinations,
"\n\t[Jungfrau][Eiger] One can enter upto 32 "
"destinations that the detector will stream images "
"out in a round robin fashion. This is get only command. Default: 1");
"\n\t[Jungfrau][Eiger][Mythen3][Gotthard2] One can enter upto 32 (64 "
"for Mythen3) destinations that the detector will stream images out in "
"a round robin fashion. This is get only command. Default: 1");
EXECUTE_SET_COMMAND(udp_cleardst, clearUDPDestinations,
"\n\tClears udp destination details on the detector.");
@ -1610,11 +1610,11 @@ class CmdProxy {
INTEGER_COMMAND_VEC_ID(
udp_firstdst, getFirstUDPDestination, setFirstUDPDestination,
StringTo<int>,
"[0 - 31 (or number of udp destinations)]\n\t[Jungfrau] One can set "
"which is the first "
"destination that the detector will stream images "
"out from in a round robin fashion. The entry must not have been "
"empty. Default: 0");
"\n[0 - 31 (or number of udp "
"destinations)]\n\t[Jungfrau][Gotthard2]\n[0-63]\n\t[Mythen3]\n\n\t "
"One can set which is the first destination that the detector will "
"stream images out from in a round robin fashion. The entry must not "
"have been empty. Default: 0");
INTEGER_COMMAND_VEC_ID(
udp_srcmac, getSourceUDPMAC, setSourceUDPMAC, MacAddr,

View File

@ -2394,7 +2394,8 @@ TEST_CASE("udp_dstlist", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::EIGER) {
if (det_type == defs::JUNGFRAU || det_type == defs::EIGER ||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) {
REQUIRE_NOTHROW(proxy.Call("udp_dstlist", {}, 0, GET, std::cout, 0));
REQUIRE_THROWS(proxy.Call(
"udp_dstlist", {"ip=0.0.0.0", "mac=00:00:00:00:00:00", "port=1233"},
@ -2408,7 +2409,8 @@ TEST_CASE("udp_numdst", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU || det_type == defs::EIGER) {
if (det_type == defs::JUNGFRAU || det_type == defs::EIGER ||
det_type == defs::MYTHEN3 || det_type == defs::GOTTHARD2) {
REQUIRE_NOTHROW(proxy.Call("udp_numdst", {}, -1, GET));
} else {
REQUIRE_THROWS(proxy.Call("udp_numdst", {}, -1, GET));
@ -2427,7 +2429,8 @@ TEST_CASE("udp_firstdst", "[.cmd]") {
Detector det;
CmdProxy proxy(&det);
auto det_type = det.getDetectorType().squash();
if (det_type == defs::JUNGFRAU) {
if (det_type == defs::JUNGFRAU || det_type == defs::MYTHEN3 ||
det_type == defs::GOTTHARD2) {
auto prev_val = det.getFirstUDPDestination();
{
std::ostringstream oss;