diff --git a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer index 3b433e5cf..e621d02be 100755 Binary files a/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer and b/slsDetectorServers/gotthard2DetectorServer/bin/gotthard2DetectorServer_developer differ diff --git a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c index 97a48655f..809d319b5 100644 --- a/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c +++ b/slsDetectorServers/gotthard2DetectorServer/slsDetectorFunctionList.c @@ -2650,7 +2650,13 @@ void *start_timer(void *arg) { } int repeatPeriodNs = getBurstPeriod(); int numFrames = getNumFrames(); + // continuous trigger mode, #frames = 1 int64_t periodNs = getPeriod(); + if (getTiming() == TRIGGER_EXPOSURE && (burstMode == CONTINUOUS_INTERNAL || + burstMode == CONTINUOUS_EXTERNAL)) { + numFrames = 1; + periodNs = 0; + } int64_t expUs = getExpTime() / 1000; int imagesize = NCHAN * NCHIP * 2; int datasize = imagesize; @@ -2851,15 +2857,7 @@ void readFrame(int *ret, char *mess) { #endif *ret = (int)OK; - // frames left to give status - int64_t retval = getNumFramesLeft() + 1; - - if (retval > 0) { - LOG(logERROR, ("No data and run stopped: %lld frames left\n", - (long long int)retval)); - } else { - LOG(logINFOGREEN, ("Acquisition successfully finished\n")); - } + LOG(logINFOGREEN, ("Acquisition successfully finished\n")); } u_int32_t runBusy() { diff --git a/slsReceiverSoftware/src/Implementation.cpp b/slsReceiverSoftware/src/Implementation.cpp index 6a8d24479..8b4fa65b3 100644 --- a/slsReceiverSoftware/src/Implementation.cpp +++ b/slsReceiverSoftware/src/Implementation.cpp @@ -167,11 +167,10 @@ void Implementation::setDetectorType(const detectorType d) { &activated, &deactivatedPaddingEnable, &silentMode)); dataProcessor.push_back(sls::make_unique( i, myDetectorType, fifo_ptr, &fileFormatType, fileWriteEnable, - &masterFileWriteEnable, &dataStreamEnable, - &streamingFrequency, &streamingTimerInMs, &streamingStartFnum, - &framePadding, &activated, &deactivatedPaddingEnable, - &silentMode, &ctbDbitList, &ctbDbitOffset, - &ctbAnalogDataBytes)); + &masterFileWriteEnable, &dataStreamEnable, &streamingFrequency, + &streamingTimerInMs, &streamingStartFnum, &framePadding, + &activated, &deactivatedPaddingEnable, &silentMode, + &ctbDbitList, &ctbDbitOffset, &ctbAnalogDataBytes)); } catch (...) { listener.clear(); dataProcessor.clear(); @@ -841,10 +840,10 @@ void Implementation::setNumberofUDPInterfaces(const int n) { auto fifo_ptr = fifo[i].get(); listener.push_back(sls::make_unique( i, myDetectorType, fifo_ptr, &status, &udpPortNum[i], - ð[i], &numberOfTotalFrames, - &udpSocketBufferSize, &actualUDPSocketBufferSize, - &framesPerFile, &frameDiscardMode, &activated, - &deactivatedPaddingEnable, &silentMode)); + ð[i], &numberOfTotalFrames, &udpSocketBufferSize, + &actualUDPSocketBufferSize, &framesPerFile, + &frameDiscardMode, &activated, &deactivatedPaddingEnable, + &silentMode)); listener[i]->SetGeneralData(generalData); dataProcessor.push_back(sls::make_unique( @@ -852,8 +851,8 @@ void Implementation::setNumberofUDPInterfaces(const int n) { fileWriteEnable, &masterFileWriteEnable, &dataStreamEnable, &streamingFrequency, &streamingTimerInMs, &streamingStartFnum, &framePadding, &activated, - &deactivatedPaddingEnable, &silentMode, - &ctbDbitList, &ctbDbitOffset, &ctbAnalogDataBytes)); + &deactivatedPaddingEnable, &silentMode, &ctbDbitList, + &ctbDbitOffset, &ctbAnalogDataBytes)); dataProcessor[i]->SetGeneralData(generalData); } catch (...) { listener.clear(); @@ -1123,18 +1122,31 @@ void Implementation::setAdditionalJsonParameter(const std::string &key, * ************************************************/ void Implementation::updateTotalNumberOfFrames() { int64_t repeats = numberOfTriggers; - // gotthard2: auto mode - // burst mode: (bursts instead of triggers) - // continuous mode: no bursts or triggers - if (myDetectorType == GOTTHARD2 && timingMode == AUTO_TIMING) { - if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) { - repeats = numberOfBursts; - } else { - repeats = 1; + int64_t numFrames = numberOfFrames; + // gotthard2 + if (myDetectorType == GOTTHARD2) { + // auto + if (timingMode == AUTO_TIMING) { + // burst mode, repeats = #bursts + if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) { + repeats = numberOfBursts; + } + // continuous, repeats = 1 (no trigger as well) + else { + repeats = 1; + } + } + // trigger + else { + // continuous, numFrames is limited + if (burstMode == CONTINUOUS_INTERNAL || + burstMode == CONTINUOUS_EXTERNAL) { + numFrames = 1; + } } } - numberOfTotalFrames = numberOfFrames * repeats * - (int64_t)(numberOfAdditionalStorageCells + 1); + numberOfTotalFrames = + numFrames * repeats * (int64_t)(numberOfAdditionalStorageCells + 1); if (numberOfTotalFrames == 0) { throw sls::RuntimeError("Invalid total number of frames to receive: 0"); }