mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-13 05:17:13 +02:00
udp_firstdst for jungfrau
This commit is contained in:
@ -677,6 +677,12 @@ class Detector {
|
||||
/**[Jungfrau][Eiger] Options 1-32 */
|
||||
void setNumberofUDPDestinations(const int value, Positions pos = {});
|
||||
|
||||
/** [Jungfrau][Eiger] */
|
||||
Result<int> getFirstUDPDestination(Positions pos = {}) const;
|
||||
|
||||
/**[Jungfrau][Eiger] Options 0-31 */
|
||||
void setFirstUDPDestination(const int value, Positions pos = {});
|
||||
|
||||
Result<IpAddr> getDestinationUDPIP(Positions pos = {}) const;
|
||||
|
||||
/** IP of the interface in receiver that the detector sends data to */
|
||||
|
@ -859,6 +859,7 @@ class CmdProxy {
|
||||
{"selinterface", &CmdProxy::selinterface},
|
||||
{"udp_dstlist", &CmdProxy::UDPDestinationList},
|
||||
{"udp_numdst", &CmdProxy::udp_numdst},
|
||||
{"udp_firstdst", &CmdProxy::udp_firstdst},
|
||||
{"udp_srcip", &CmdProxy::udp_srcip},
|
||||
{"udp_srcip2", &CmdProxy::udp_srcip2},
|
||||
{"udp_dstip", &CmdProxy::UDPDestinationIP},
|
||||
@ -1539,6 +1540,14 @@ class CmdProxy {
|
||||
"destinations that the detector will stream images "
|
||||
"out in a round robin fashion. Default: 1");
|
||||
|
||||
INTEGER_COMMAND_VEC_ID(
|
||||
udp_firstdst, getFirstUDPDestination, setFirstUDPDestination,
|
||||
StringTo<int>,
|
||||
"[0 - 31]\n\t[Jungfrau][Eiger] 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_srcip, getSourceUDPIP, setSourceUDPIP, IpAddr,
|
||||
"[x.x.x.x]\n\tIp address of the detector (source) udp "
|
||||
|
@ -929,6 +929,14 @@ void Detector::setNumberofUDPDestinations(const int value, Positions pos) {
|
||||
pimpl->Parallel(&Module::setNumberofUDPDestinations, pos, value);
|
||||
}
|
||||
|
||||
Result<int> Detector::getFirstUDPDestination(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getFirstUDPDestination, pos);
|
||||
}
|
||||
|
||||
void Detector::setFirstUDPDestination(const int value, Positions pos) {
|
||||
pimpl->Parallel(&Module::setFirstUDPDestination, pos, value);
|
||||
}
|
||||
|
||||
Result<IpAddr> Detector::getDestinationUDPIP(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getDestinationUDPIP, pos);
|
||||
}
|
||||
|
@ -970,6 +970,14 @@ void Module::setNumberofUDPDestinations(const int value) {
|
||||
sendToDetector(F_SET_NUM_DEST_UDP, value, nullptr);
|
||||
}
|
||||
|
||||
int Module::getFirstUDPDestination() const {
|
||||
return sendToDetector<int>(F_GET_UDP_FIRST_DEST);
|
||||
}
|
||||
|
||||
void Module::setFirstUDPDestination(const int value) {
|
||||
sendToDetector(F_SET_UDP_FIRST_DEST, value, nullptr);
|
||||
}
|
||||
|
||||
sls::IpAddr Module::getDestinationUDPIP() const {
|
||||
return sendToDetector<sls::IpAddr>(F_GET_DEST_UDP_IP);
|
||||
}
|
||||
|
@ -226,6 +226,8 @@ class Module : public virtual slsDetectorDefs {
|
||||
void setDestinationUDPList(const defs::udpDestination dest);
|
||||
int getNumberofUDPDestinations() const;
|
||||
void setNumberofUDPDestinations(const int value);
|
||||
int getFirstUDPDestination() const;
|
||||
void setFirstUDPDestination(const int value);
|
||||
sls::IpAddr getDestinationUDPIP() const;
|
||||
void setDestinationUDPIP(const sls::IpAddr ip);
|
||||
sls::IpAddr getDestinationUDPIP2() const;
|
||||
|
@ -2262,6 +2262,37 @@ TEST_CASE("udp_numdst", "[.cmd]") {
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("udp_firstdst", "[.cmd]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::JUNGFRAU || det_type == defs::EIGER) {
|
||||
auto prev_val = det.getFirstUDPDestination();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("udp_firstdst", {"0"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "udp_firstdst 10\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("udp_firstdst", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "udp_firstdst 0\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("udp_firstdst", {"31"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "udp_firstdst 31\n");
|
||||
}
|
||||
REQUIRE_THROWS(proxy.Call("udp_firstdst", {"33"}, -1, PUT));
|
||||
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setFirstUDPDestination(prev_val[i], {i});
|
||||
}
|
||||
} else {
|
||||
REQUIRE_THROWS(proxy.Call("udp_numdst", {}, -1, GET));
|
||||
}
|
||||
}
|
||||
|
||||
TEST_CASE("udp_dstip", "[.cmd]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
|
Reference in New Issue
Block a user