Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions eigerApp/src/eigerDetector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion eigerApp/src/eigerDetector.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ class eigerDetector : public ADDriver
COMP_ALGO_LZ4,
COMP_ALGO_BSLZ4
};

enum trigger_mode
{
TRIGGER_MODE_INTS,
Expand Down