mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-23 18:17:59 +02:00
ctb 1g non blocking acquire (#555)
* allowing ctb and moench 1g to have non blocking acquisition also send data, refactoring wait for acquisition finished for all others
This commit is contained in:
Binary file not shown.
@ -2083,7 +2083,7 @@ void *start_timer(void *arg) {
|
||||
closeUDPSocket(0);
|
||||
|
||||
sharedMemory_setStatus(IDLE);
|
||||
LOG(logINFOBLUE, ("Finished Acquiring\n"));
|
||||
LOG(logINFOBLUE, ("Transmitting frames done\n"));
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
@ -2203,40 +2203,31 @@ void readandSendUDPFrames(int *ret, char *mess) {
|
||||
closeUDPSocket(0);
|
||||
}
|
||||
|
||||
void readFrame(int *ret, char *mess) {
|
||||
#ifdef VIRTUAL
|
||||
// wait for acquisition to be done
|
||||
void waitForAcquisitionEnd() {
|
||||
while (runBusy()) {
|
||||
usleep(500); // random
|
||||
usleep(500);
|
||||
}
|
||||
#ifndef VIRTUAL
|
||||
int64_t retval = getNumFramesLeft() + 1;
|
||||
if (retval > 0) {
|
||||
LOG(logINFORED, ("%lld frames left\n", (long long int)retval));
|
||||
}
|
||||
LOG(logINFOGREEN, ("acquisition successfully finished\n"));
|
||||
return;
|
||||
#endif
|
||||
// 1G
|
||||
LOG(logINFOGREEN, ("Blocking Acquisition done\n"));
|
||||
}
|
||||
|
||||
void readFrames(int *ret, char *mess) {
|
||||
#ifdef VIRTUAL
|
||||
while (runBusy()) {
|
||||
usleep(500);
|
||||
}
|
||||
#else
|
||||
// 1G force reading of frames
|
||||
if (!enableTenGigabitEthernet(-1)) {
|
||||
readandSendUDPFrames(ret, mess);
|
||||
LOG(logINFOBLUE, ("Transmitting frames done\n"));
|
||||
}
|
||||
// 10G
|
||||
else {
|
||||
// wait for acquisition to be done
|
||||
while (runBusy()) {
|
||||
usleep(500); // random
|
||||
}
|
||||
}
|
||||
|
||||
// ret could be fail in 1gudp for not creating udp sockets
|
||||
if (*ret != FAIL) {
|
||||
// frames left to give status
|
||||
int64_t retval = getNumFramesLeft() + 2;
|
||||
if (retval > 1) {
|
||||
sprintf(mess, "No data and run stopped: %lld frames left\n",
|
||||
(long long int)retval);
|
||||
LOG(logERROR, (mess));
|
||||
} else {
|
||||
LOG(logINFOGREEN, ("Acquisition successfully finished\n"));
|
||||
}
|
||||
}
|
||||
*ret = (int)OK;
|
||||
#endif
|
||||
}
|
||||
|
||||
void unsetFifoReadStrobes() {
|
||||
|
Reference in New Issue
Block a user