mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-04-25 07:40:03 +02:00
g2 fix: cont trigger frames in rxr should be 1
This commit is contained in:
parent
c862f1df81
commit
99642dad69
@ -2631,7 +2631,13 @@ void *start_timer(void *arg) {
|
|||||||
}
|
}
|
||||||
int repeatPeriodNs = getBurstPeriod();
|
int repeatPeriodNs = getBurstPeriod();
|
||||||
int numFrames = getNumFrames();
|
int numFrames = getNumFrames();
|
||||||
|
// continuous trigger mode, #frames = 1
|
||||||
int64_t periodNs = getPeriod();
|
int64_t periodNs = getPeriod();
|
||||||
|
if (getTiming() == TRIGGER_EXPOSURE && (burstMode == CONTINUOUS_INTERNAL ||
|
||||||
|
burstMode == CONTINUOUS_EXTERNAL)) {
|
||||||
|
numFrames = 1;
|
||||||
|
periodNs = 0;
|
||||||
|
}
|
||||||
int64_t expUs = getExpTime() / 1000;
|
int64_t expUs = getExpTime() / 1000;
|
||||||
int imagesize = NCHAN * NCHIP * 2;
|
int imagesize = NCHAN * NCHIP * 2;
|
||||||
int datasize = imagesize;
|
int datasize = imagesize;
|
||||||
@ -2832,15 +2838,7 @@ void readFrame(int *ret, char *mess) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
*ret = (int)OK;
|
*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() {
|
u_int32_t runBusy() {
|
||||||
|
@ -167,11 +167,10 @@ void Implementation::setDetectorType(const detectorType d) {
|
|||||||
&activated, &deactivatedPaddingEnable, &silentMode));
|
&activated, &deactivatedPaddingEnable, &silentMode));
|
||||||
dataProcessor.push_back(sls::make_unique<DataProcessor>(
|
dataProcessor.push_back(sls::make_unique<DataProcessor>(
|
||||||
i, myDetectorType, fifo_ptr, &fileFormatType, fileWriteEnable,
|
i, myDetectorType, fifo_ptr, &fileFormatType, fileWriteEnable,
|
||||||
&masterFileWriteEnable, &dataStreamEnable,
|
&masterFileWriteEnable, &dataStreamEnable, &streamingFrequency,
|
||||||
&streamingFrequency, &streamingTimerInMs, &streamingStartFnum,
|
&streamingTimerInMs, &streamingStartFnum, &framePadding,
|
||||||
&framePadding, &activated, &deactivatedPaddingEnable,
|
&activated, &deactivatedPaddingEnable, &silentMode,
|
||||||
&silentMode, &ctbDbitList, &ctbDbitOffset,
|
&ctbDbitList, &ctbDbitOffset, &ctbAnalogDataBytes));
|
||||||
&ctbAnalogDataBytes));
|
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
listener.clear();
|
listener.clear();
|
||||||
dataProcessor.clear();
|
dataProcessor.clear();
|
||||||
@ -841,10 +840,10 @@ void Implementation::setNumberofUDPInterfaces(const int n) {
|
|||||||
auto fifo_ptr = fifo[i].get();
|
auto fifo_ptr = fifo[i].get();
|
||||||
listener.push_back(sls::make_unique<Listener>(
|
listener.push_back(sls::make_unique<Listener>(
|
||||||
i, myDetectorType, fifo_ptr, &status, &udpPortNum[i],
|
i, myDetectorType, fifo_ptr, &status, &udpPortNum[i],
|
||||||
ð[i], &numberOfTotalFrames,
|
ð[i], &numberOfTotalFrames, &udpSocketBufferSize,
|
||||||
&udpSocketBufferSize, &actualUDPSocketBufferSize,
|
&actualUDPSocketBufferSize, &framesPerFile,
|
||||||
&framesPerFile, &frameDiscardMode, &activated,
|
&frameDiscardMode, &activated, &deactivatedPaddingEnable,
|
||||||
&deactivatedPaddingEnable, &silentMode));
|
&silentMode));
|
||||||
listener[i]->SetGeneralData(generalData);
|
listener[i]->SetGeneralData(generalData);
|
||||||
|
|
||||||
dataProcessor.push_back(sls::make_unique<DataProcessor>(
|
dataProcessor.push_back(sls::make_unique<DataProcessor>(
|
||||||
@ -852,8 +851,8 @@ void Implementation::setNumberofUDPInterfaces(const int n) {
|
|||||||
fileWriteEnable, &masterFileWriteEnable, &dataStreamEnable,
|
fileWriteEnable, &masterFileWriteEnable, &dataStreamEnable,
|
||||||
&streamingFrequency, &streamingTimerInMs,
|
&streamingFrequency, &streamingTimerInMs,
|
||||||
&streamingStartFnum, &framePadding, &activated,
|
&streamingStartFnum, &framePadding, &activated,
|
||||||
&deactivatedPaddingEnable, &silentMode,
|
&deactivatedPaddingEnable, &silentMode, &ctbDbitList,
|
||||||
&ctbDbitList, &ctbDbitOffset, &ctbAnalogDataBytes));
|
&ctbDbitOffset, &ctbAnalogDataBytes));
|
||||||
dataProcessor[i]->SetGeneralData(generalData);
|
dataProcessor[i]->SetGeneralData(generalData);
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
listener.clear();
|
listener.clear();
|
||||||
@ -1123,18 +1122,31 @@ void Implementation::setAdditionalJsonParameter(const std::string &key,
|
|||||||
* ************************************************/
|
* ************************************************/
|
||||||
void Implementation::updateTotalNumberOfFrames() {
|
void Implementation::updateTotalNumberOfFrames() {
|
||||||
int64_t repeats = numberOfTriggers;
|
int64_t repeats = numberOfTriggers;
|
||||||
// gotthard2: auto mode
|
int64_t numFrames = numberOfFrames;
|
||||||
// burst mode: (bursts instead of triggers)
|
// gotthard2
|
||||||
// continuous mode: no bursts or triggers
|
if (myDetectorType == GOTTHARD2) {
|
||||||
if (myDetectorType == GOTTHARD2 && timingMode == AUTO_TIMING) {
|
// auto
|
||||||
|
if (timingMode == AUTO_TIMING) {
|
||||||
|
// burst mode, repeats = #bursts
|
||||||
if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
|
if (burstMode == BURST_INTERNAL || burstMode == BURST_EXTERNAL) {
|
||||||
repeats = numberOfBursts;
|
repeats = numberOfBursts;
|
||||||
} else {
|
}
|
||||||
|
// continuous, repeats = 1 (no trigger as well)
|
||||||
|
else {
|
||||||
repeats = 1;
|
repeats = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
numberOfTotalFrames = numberOfFrames * repeats *
|
// trigger
|
||||||
(int64_t)(numberOfAdditionalStorageCells + 1);
|
else {
|
||||||
|
// continuous, numFrames is limited
|
||||||
|
if (burstMode == CONTINUOUS_INTERNAL ||
|
||||||
|
burstMode == CONTINUOUS_EXTERNAL) {
|
||||||
|
numFrames = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
numberOfTotalFrames =
|
||||||
|
numFrames * repeats * (int64_t)(numberOfAdditionalStorageCells + 1);
|
||||||
if (numberOfTotalFrames == 0) {
|
if (numberOfTotalFrames == 0) {
|
||||||
throw sls::RuntimeError("Invalid total number of frames to receive: 0");
|
throw sls::RuntimeError("Invalid total number of frames to receive: 0");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user