mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 01:58:00 +02:00
udp_numdst readonly, udp_cleardst added
This commit is contained in:
@ -671,8 +671,7 @@ class Detector {
|
||||
/** [Jungfrau][Eiger] */
|
||||
Result<int> getNumberofUDPDestinations(Positions pos = {}) const;
|
||||
|
||||
/**[Jungfrau][Eiger] Options 1-32 */
|
||||
void setNumberofUDPDestinations(const int value, Positions pos = {});
|
||||
void clearUDPDestination(Positions pos = {});
|
||||
|
||||
/** [Jungfrau] */
|
||||
Result<int> getFirstUDPDestination(Positions pos = {}) const;
|
||||
|
@ -861,6 +861,7 @@ class CmdProxy {
|
||||
{"selinterface", &CmdProxy::selinterface},
|
||||
{"udp_dstlist", &CmdProxy::UDPDestinationList},
|
||||
{"udp_numdst", &CmdProxy::udp_numdst},
|
||||
{"udp_cleardst", &CmdProxy::udp_cleardst},
|
||||
{"udp_firstdst", &CmdProxy::udp_firstdst},
|
||||
{"udp_srcip", &CmdProxy::udp_srcip},
|
||||
{"udp_srcip2", &CmdProxy::udp_srcip2},
|
||||
@ -1542,6 +1543,9 @@ class CmdProxy {
|
||||
"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, clearUDPDestination,
|
||||
"\n\tClears udp destination details on the detector.");
|
||||
|
||||
INTEGER_COMMAND_VEC_ID(
|
||||
udp_firstdst, getFirstUDPDestination, setFirstUDPDestination,
|
||||
StringTo<int>,
|
||||
|
@ -921,8 +921,8 @@ Result<int> Detector::getNumberofUDPDestinations(Positions pos) const {
|
||||
return pimpl->Parallel(&Module::getNumberofUDPDestinations, pos);
|
||||
}
|
||||
|
||||
void Detector::setNumberofUDPDestinations(const int value, Positions pos) {
|
||||
pimpl->Parallel(&Module::setNumberofUDPDestinations, pos, value);
|
||||
void Detector::clearUDPDestination(Positions pos) {
|
||||
pimpl->Parallel(&Module::clearUDPDestination, pos);
|
||||
}
|
||||
|
||||
Result<int> Detector::getFirstUDPDestination(Positions pos) const {
|
||||
|
@ -970,9 +970,7 @@ int Module::getNumberofUDPDestinations() const {
|
||||
return sendToDetector<int>(F_GET_NUM_DEST_UDP);
|
||||
}
|
||||
|
||||
void Module::setNumberofUDPDestinations(const int value) {
|
||||
sendToDetector(F_SET_NUM_DEST_UDP, value, nullptr);
|
||||
}
|
||||
void Module::clearUDPDestination() { sendToDetector(F_CLEAR_ALL_UDP_DEST); }
|
||||
|
||||
int Module::getFirstUDPDestination() const {
|
||||
return sendToDetector<int>(F_GET_UDP_FIRST_DEST);
|
||||
|
@ -224,7 +224,7 @@ class Module : public virtual slsDetectorDefs {
|
||||
sls::UdpDestination getDestinationUDPList(const uint32_t entry) const;
|
||||
void setDestinationUDPList(const sls::UdpDestination dest);
|
||||
int getNumberofUDPDestinations() const;
|
||||
void setNumberofUDPDestinations(const int value);
|
||||
void clearUDPDestination();
|
||||
int getFirstUDPDestination() const;
|
||||
void setFirstUDPDestination(const int value);
|
||||
sls::IpAddr getDestinationUDPIP() const;
|
||||
|
@ -2229,33 +2229,20 @@ TEST_CASE("udp_numdst", "[.cmd]") {
|
||||
CmdProxy proxy(&det);
|
||||
auto det_type = det.getDetectorType().squash();
|
||||
if (det_type == defs::JUNGFRAU || det_type == defs::EIGER) {
|
||||
auto prev_val = det.getNumberofUDPDestinations();
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("udp_numdst", {"10"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "udp_numdst 10\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("udp_numdst", {}, -1, GET, oss);
|
||||
REQUIRE(oss.str() == "udp_numdst 10\n");
|
||||
}
|
||||
{
|
||||
std::ostringstream oss;
|
||||
proxy.Call("udp_numdst", {"32"}, -1, PUT, oss);
|
||||
REQUIRE(oss.str() == "udp_numdst 32\n");
|
||||
}
|
||||
REQUIRE_THROWS(proxy.Call("udp_numdst", {"0"}, -1, PUT));
|
||||
REQUIRE_THROWS(proxy.Call("udp_numdst", {"33"}, -1, PUT));
|
||||
|
||||
for (int i = 0; i != det.size(); ++i) {
|
||||
det.setNumberofUDPDestinations(prev_val[i], {i});
|
||||
}
|
||||
REQUIRE_NOTHROW(proxy.Call("udp_numdst", {}, -1, GET));
|
||||
} else {
|
||||
REQUIRE_THROWS(proxy.Call("udp_numdst", {}, -1, GET));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("udp_cleardst", "[.cmd]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
REQUIRE_THROWS(proxy.Call("udp_cleardst", {}, -1, GET));
|
||||
REQUIRE_NOTHROW(proxy.Call("udp_cleardst", {}, -1, PUT));
|
||||
}
|
||||
|
||||
TEST_CASE("udp_firstdst", "[.cmd]") {
|
||||
Detector det;
|
||||
CmdProxy proxy(&det);
|
||||
|
Reference in New Issue
Block a user