fix in gui that wont wait for disabled ports
Build on RHEL9 docker image / build (push) Successful in 3m47s
Build on RHEL8 docker image / build (push) Successful in 5m0s
Run Simulator Tests on local RHEL9 / build (push) Successful in 18m18s
Run Simulator Tests on local RHEL8 / build (push) Successful in 21m52s

This commit is contained in:
2026-06-10 17:16:49 +02:00
parent b06a3d06c1
commit a86c2c4d86
2 changed files with 47 additions and 47 deletions
+43 -43
View File
@@ -1126,10 +1126,17 @@ int DetectorImpl::acquire() {
// start receiver
if (receiver) {
Parallel(&Module::startReceiver, {});
}
startProcessingThread(receiver);
// to catch dummy zmq packets for disabled ports,
// start processing thread before startReceiver
if (dataReady != nullptr)
startRxZmqProcessingThread();
Parallel(&Module::startReceiver, {});
if (dataReady == nullptr)
startRxProgressThread();
}
// start and read all
try {
@@ -1314,53 +1321,46 @@ void DetectorImpl::printProgress(double progress) {
std::cout << '\r' << std::flush;
}
void DetectorImpl::startProcessingThread(bool receiver) {
void DetectorImpl::startRxZmqProcessingThread() {
dataProcessingThread =
std::thread(&DetectorImpl::processData, this, receiver);
std::thread(&DetectorImpl::readFrameFromReceiver, this);
}
void DetectorImpl::processData(bool receiver) {
if (receiver) {
if (dataReady != nullptr) {
readFrameFromReceiver();
}
// only update progress
else {
LOG(logINFO) << "Type 'q' and hit enter to stop acquisition";
double progress = 0;
printProgress(progress);
void DetectorImpl::startRxProgressThread() {
dataProcessingThread = std::thread(&DetectorImpl::printRxProgress, this);
}
while (true) {
// to exit acquire by typing q
if (kbhit() != 0) {
if (fgetc(stdin) == 'q') {
LOG(logINFO)
<< "Caught the command to stop acquisition";
stopDetector({});
}
}
// get and print progress
double temp =
(double)Parallel(&Module::getReceiverProgress, {0})
.squash();
if (temp != progress) {
printProgress(progress);
progress = temp;
}
void DetectorImpl::printRxProgress() {
LOG(logINFO) << "Type 'q' and hit enter to stop acquisition";
double progress = 0;
printProgress(progress);
// exiting loop
if (getJoinThreadFlag()) {
// print progress one final time before exiting
progress =
(double)Parallel(&Module::getReceiverProgress, {0})
.squash();
printProgress(progress);
break;
}
// otherwise error when connecting to the receiver too fast
std::this_thread::sleep_for(std::chrono::milliseconds(100));
while (true) {
// to exit acquire by typing q
if (kbhit() != 0) {
if (fgetc(stdin) == 'q') {
LOG(logINFO) << "Caught the command to stop acquisition";
stopDetector({});
}
}
// get and print progress
double temp =
(double)Parallel(&Module::getReceiverProgress, {0}).squash();
if (temp != progress) {
printProgress(progress);
progress = temp;
}
// exiting loop
if (getJoinThreadFlag()) {
// print progress one final time before exiting
progress =
(double)Parallel(&Module::getReceiverProgress, {0}).squash();
printProgress(progress);
break;
}
// otherwise error when connecting to the receiver too fast
std::this_thread::sleep_for(std::chrono::milliseconds(100));
}
}
+4 -4
View File
@@ -278,10 +278,9 @@ class DetectorImpl : public virtual slsDetectorDefs {
void stopDetector(Positions pos);
/**
* Combines data from all readouts and gives it to the gui
* or just gives progress of acquisition by polling receivers
* gives progress of acquisition by polling receivers
*/
void processData(bool receiver);
void printRxProgress();
/**
* Convert raw file
@@ -450,7 +449,8 @@ class DetectorImpl : public virtual slsDetectorDefs {
void printProgress(double progress);
void startProcessingThread(bool receiver);
void startRxZmqProcessingThread();
void startRxProgressThread();
/**
* Check if processing thread is ready to join main thread