From 863befd6464840f27f8e5015967882fc1dc9ada0 Mon Sep 17 00:00:00 2001 From: Mark Rivers Date: Tue, 16 Jun 2026 14:01:05 -0500 Subject: [PATCH 1/2] Remove trailing whitespace --- eigerApp/src/eigerDetector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eigerApp/src/eigerDetector.h b/eigerApp/src/eigerDetector.h index 8831485..80adfea 100644 --- a/eigerApp/src/eigerDetector.h +++ b/eigerApp/src/eigerDetector.h @@ -147,7 +147,7 @@ class eigerDetector : public ADDriver COMP_ALGO_LZ4, COMP_ALGO_BSLZ4 }; - + enum trigger_mode { TRIGGER_MODE_INTS, From 0c9f553b62aae519c02880e201989945279e3d43 Mon Sep 17 00:00:00 2001 From: Mark Rivers Date: Tue, 16 Jun 2026 14:01:49 -0500 Subject: [PATCH 2/2] We have found that in ExternalGate mode the detector does not set state=Idle at the end of acquisition. This problem might be confined to the GSECARS eiger2 9M which is a hybrid between an Eiger2S and an Eiger 2X. We need to re-introduce the logic to wait for NumImages=ExpectedImages. It now waits for whichever comes first: state=Idle, NumImages=ExpectedImages, or manual stop event. --- eigerApp/src/eigerDetector.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/eigerApp/src/eigerDetector.cpp b/eigerApp/src/eigerDetector.cpp index a934a3b..cc2179a 100644 --- a/eigerApp/src/eigerDetector.cpp +++ b/eigerApp/src/eigerDetector.cpp @@ -1013,16 +1013,21 @@ void eigerDetector::controlTask (void) } // Wait for detector to stop acquiring. - // Essential for TMExternalSeries or TMExternalEnable, - // which have to wait for external action. - FLOW("waiting for detector state"); + // Essential for TMExternalSeries or TMExternalEnable, which have to wait for external action. + // We have found that in ExternalGate mode the detector does not set state=Idle at the end, + // so we need to wait either until the NumImagesCounter is the expected value or until there is a manual stop event. + FLOW("waiting for detector state or numImages = expectedImages"); string state; + int expectedImages = numImages * numTriggers; + int numImagesCounter; for(;;) { mState->fetch(state); callParamCallbacks(); + getIntegerParam(ADNumImagesCounter, &numImagesCounter); // We must exit this loop without the lock unlock(); + if (numImagesCounter >= expectedImages) break; if (state != "configure" && state != "ready" && state != "acquire") break; if (mStopEvent.wait(0.1)) break; // If we haven't exited yet, grab the lock so we can update the param library