mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-10 12:00:43 +02:00
fixed for virtual servers rr
This commit is contained in:
@ -1535,6 +1535,7 @@ int configureMAC() {
|
|||||||
|
|
||||||
LOG(logINFOBLUE, ("Configuring MAC\n"));
|
LOG(logINFOBLUE, ("Configuring MAC\n"));
|
||||||
|
|
||||||
|
LOG(logINFO, ("Number of entries: %d\n", numUdpDestinations));
|
||||||
for (int iRxEntry = 0; iRxEntry != MAX_UDP_DESTINATION; ++iRxEntry) {
|
for (int iRxEntry = 0; iRxEntry != MAX_UDP_DESTINATION; ++iRxEntry) {
|
||||||
uint32_t srcip = udpDetails[iRxEntry].srcip;
|
uint32_t srcip = udpDetails[iRxEntry].srcip;
|
||||||
uint32_t dstip = udpDetails[iRxEntry].dstip;
|
uint32_t dstip = udpDetails[iRxEntry].dstip;
|
||||||
@ -1577,7 +1578,6 @@ int configureMAC() {
|
|||||||
iRxEntry));
|
iRxEntry));
|
||||||
return FAIL;
|
return FAIL;
|
||||||
}
|
}
|
||||||
return OK;
|
|
||||||
#else
|
#else
|
||||||
uint16_t dst_port = dstport;
|
uint16_t dst_port = dstport;
|
||||||
if (!top)
|
if (!top)
|
||||||
@ -2496,8 +2496,7 @@ void *start_timer(void *arg) {
|
|||||||
LOG(logDEBUG1, ("Sent right packet: %d\n", i));
|
LOG(logDEBUG1, ("Sent right packet: %d\n", i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG(logINFO, ("Sent frame: %d[%lld]\n", iframes,
|
LOG(logINFO, ("Sent frame %d [#%ld] to E%d\n", iframes, frameNr + iframes, iRxEntry));
|
||||||
(long long unsigned int)(frameNr + iframes)));
|
|
||||||
clock_gettime(CLOCK_REALTIME, &end);
|
clock_gettime(CLOCK_REALTIME, &end);
|
||||||
int64_t timeNs = ((end.tv_sec - begin.tv_sec) * 1E9 +
|
int64_t timeNs = ((end.tv_sec - begin.tv_sec) * 1E9 +
|
||||||
(end.tv_nsec - begin.tv_nsec));
|
(end.tv_nsec - begin.tv_nsec));
|
||||||
|
@ -2343,9 +2343,8 @@ void *start_timer(void *arg) {
|
|||||||
if (!isControlServer) {
|
if (!isControlServer) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
int firstDest = getFirstUDPDestination();
|
||||||
int transmissionDelayUs = getTransmissionDelayFrame() * 1000;
|
int transmissionDelayUs = getTransmissionDelayFrame() * 1000;
|
||||||
|
|
||||||
int numInterfaces = getNumberofUDPInterfaces();
|
int numInterfaces = getNumberofUDPInterfaces();
|
||||||
int64_t periodNs = getPeriod();
|
int64_t periodNs = getPeriod();
|
||||||
int numFrames = (getNumFrames() * getNumTriggers() *
|
int numFrames = (getNumFrames() * getNumTriggers() *
|
||||||
@ -2386,9 +2385,8 @@ void *start_timer(void *arg) {
|
|||||||
{
|
{
|
||||||
uint64_t frameNr = 0;
|
uint64_t frameNr = 0;
|
||||||
getNextFrameNumber(&frameNr);
|
getNextFrameNumber(&frameNr);
|
||||||
int iRxEntry = 0;
|
int iRxEntry = firstDest;
|
||||||
for (int iframes = 0; iframes != numFrames; ++iframes) {
|
for (int iframes = 0; iframes != numFrames; ++iframes) {
|
||||||
LOG(logINFOBLUE, ("iRxEntry:%d\n", iRxEntry));
|
|
||||||
usleep(transmissionDelayUs);
|
usleep(transmissionDelayUs);
|
||||||
|
|
||||||
// check if manual stop
|
// check if manual stop
|
||||||
@ -2464,7 +2462,7 @@ void *start_timer(void *arg) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LOG(logINFO, ("Sent frame: %d\n", iframes));
|
LOG(logINFO, ("Sent frame %d [#%ld] to E%d\n", iframes, frameNr + iframes, iRxEntry));
|
||||||
clock_gettime(CLOCK_REALTIME, &end);
|
clock_gettime(CLOCK_REALTIME, &end);
|
||||||
int64_t timeNs = ((end.tv_sec - begin.tv_sec) * 1E9 +
|
int64_t timeNs = ((end.tv_sec - begin.tv_sec) * 1E9 +
|
||||||
(end.tv_nsec - begin.tv_nsec));
|
(end.tv_nsec - begin.tv_nsec));
|
||||||
|
@ -9312,10 +9312,10 @@ int set_udp_first_dest(int file_des) {
|
|||||||
#ifndef JUNGFRAUD
|
#ifndef JUNGFRAUD
|
||||||
functionNotImplemented();
|
functionNotImplemented();
|
||||||
#else
|
#else
|
||||||
if (arg < 0 || arg >= MAX_UDP_DESTINATION) {
|
if (arg < 0 || arg >= numUdpDestinations) {
|
||||||
ret = FAIL;
|
ret = FAIL;
|
||||||
sprintf(mess, "Could not set first destination. Options: 0-%d\n",
|
sprintf(mess, "Could not set first destination. Options: 0-%d\n",
|
||||||
MAX_UDP_DESTINATION - 1);
|
numUdpDestinations - 1);
|
||||||
LOG(logERROR, (mess));
|
LOG(logERROR, (mess));
|
||||||
} else {
|
} else {
|
||||||
if (check_detector_idle("set first udp destination") == OK) {
|
if (check_detector_idle("set first udp destination") == OK) {
|
||||||
|
@ -680,7 +680,7 @@ class Detector {
|
|||||||
/** [Jungfrau] */
|
/** [Jungfrau] */
|
||||||
Result<int> getFirstUDPDestination(Positions pos = {}) const;
|
Result<int> getFirstUDPDestination(Positions pos = {}) const;
|
||||||
|
|
||||||
/**[Jungfrau] Options 0-31 */
|
/**[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;
|
||||||
|
@ -1543,7 +1543,7 @@ class CmdProxy {
|
|||||||
INTEGER_COMMAND_VEC_ID(
|
INTEGER_COMMAND_VEC_ID(
|
||||||
udp_firstdst, getFirstUDPDestination, setFirstUDPDestination,
|
udp_firstdst, getFirstUDPDestination, setFirstUDPDestination,
|
||||||
StringTo<int>,
|
StringTo<int>,
|
||||||
"[0 - 31]\n\t[Jungfrau] One can set which is the first "
|
"[0 - 31 (or number of udp destinations)]\n\t[Jungfrau] One can set which is the first "
|
||||||
"destination that the detector will stream images "
|
"destination that the detector will stream images "
|
||||||
"out from in a round robin fashion. The entry must not have been "
|
"out from in a round robin fashion. The entry must not have been "
|
||||||
"empty. Default: 0");
|
"empty. Default: 0");
|
||||||
|
@ -2266,7 +2266,7 @@ TEST_CASE("udp_firstdst", "[.cmd]") {
|
|||||||
Detector det;
|
Detector det;
|
||||||
CmdProxy proxy(&det);
|
CmdProxy proxy(&det);
|
||||||
auto det_type = det.getDetectorType().squash();
|
auto det_type = det.getDetectorType().squash();
|
||||||
if (det_type == defs::JUNGFRAU || det_type == defs::EIGER) {
|
if (det_type == defs::JUNGFRAU) {
|
||||||
auto prev_val = det.getFirstUDPDestination();
|
auto prev_val = det.getFirstUDPDestination();
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
@ -2280,8 +2280,8 @@ TEST_CASE("udp_firstdst", "[.cmd]") {
|
|||||||
}
|
}
|
||||||
{
|
{
|
||||||
std::ostringstream oss;
|
std::ostringstream oss;
|
||||||
proxy.Call("udp_firstdst", {"31"}, -1, PUT, oss);
|
proxy.Call("udp_firstdst", {"1"}, -1, PUT, oss);
|
||||||
REQUIRE(oss.str() == "udp_firstdst 31\n");
|
REQUIRE(oss.str() == "udp_firstdst 1\n");
|
||||||
}
|
}
|
||||||
REQUIRE_THROWS(proxy.Call("udp_firstdst", {"33"}, -1, PUT));
|
REQUIRE_THROWS(proxy.Call("udp_firstdst", {"33"}, -1, PUT));
|
||||||
|
|
||||||
|
@ -1669,7 +1669,7 @@ int ClientInterface::set_rate_correct(Interface &socket) {
|
|||||||
std::vector<int64_t> t(index);
|
std::vector<int64_t> t(index);
|
||||||
socket.Receive(t);
|
socket.Receive(t);
|
||||||
verifyIdle(socket);
|
verifyIdle(socket);
|
||||||
LOG(logINFOBLUE) << "Setting rate corrections[" << index << ']';
|
LOG(logINFO) << "Setting rate corrections[" << index << ']';
|
||||||
impl()->setRateCorrections(t);
|
impl()->setRateCorrections(t);
|
||||||
return socket.Send(OK);
|
return socket.Send(OK);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user