mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-02 19:00:05 +02:00
fixed the frameindex bug (always 0)
This commit is contained in:
parent
557d190236
commit
5a45f15c7f
@ -87,6 +87,12 @@ class DataProcessor : private virtual slsReceiverDefs, public ThreadObject {
|
|||||||
*/
|
*/
|
||||||
uint64_t GetNumFramesCaught();
|
uint64_t GetNumFramesCaught();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets Actual Current Frame Index (that has not been subtracted from firstAcquisitionIndex) thats been processed for an entire acquisition (including all scans)
|
||||||
|
* @return -1 if no frames have been caught, else current frame index (represents all scans too)
|
||||||
|
*/
|
||||||
|
uint64_t GetActualProcessedAcquisitionIndex();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Current Frame Index thats been processed for an entire acquisition (including all scans)
|
* Get Current Frame Index thats been processed for an entire acquisition (including all scans)
|
||||||
* @return -1 if no frames have been caught, else current frame index (represents all scans too)
|
* @return -1 if no frames have been caught, else current frame index (represents all scans too)
|
||||||
|
@ -110,6 +110,10 @@ uint64_t DataProcessor::GetNumFramesCaught() {
|
|||||||
return numFramesCaught;
|
return numFramesCaught;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
uint64_t DataProcessor::GetActualProcessedAcquisitionIndex() {
|
||||||
|
return currentFrameIndex;
|
||||||
|
}
|
||||||
|
|
||||||
uint64_t DataProcessor::GetProcessedAcquisitionIndex() {
|
uint64_t DataProcessor::GetProcessedAcquisitionIndex() {
|
||||||
return currentFrameIndex - firstAcquisitionIndex;
|
return currentFrameIndex - firstAcquisitionIndex;
|
||||||
}
|
}
|
||||||
@ -242,7 +246,7 @@ void DataProcessor::SetupFileWriter(int* nd, char* fname, char* fpath, uint64_t*
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// only the first file
|
||||||
int DataProcessor::CreateNewFile(bool en, uint64_t nf, uint64_t at, uint64_t ap) {
|
int DataProcessor::CreateNewFile(bool en, uint64_t nf, uint64_t at, uint64_t ap) {
|
||||||
file->CloseAllFiles();
|
file->CloseAllFiles();
|
||||||
if (file->CreateMasterFile(en, generalData->imageSize, generalData->nPixelsX, generalData->nPixelsY,
|
if (file->CreateMasterFile(en, generalData->imageSize, generalData->nPixelsX, generalData->nPixelsY,
|
||||||
@ -317,6 +321,7 @@ void DataProcessor::ProcessAnImage(char* buf) {
|
|||||||
|
|
||||||
sls_detector_header* header = (sls_detector_header*) (buf);
|
sls_detector_header* header = (sls_detector_header*) (buf);
|
||||||
uint64_t fnum = header->frameNumber;
|
uint64_t fnum = header->frameNumber;
|
||||||
|
currentFrameIndex = fnum;
|
||||||
uint32_t nump = header->packetNumber;
|
uint32_t nump = header->packetNumber;
|
||||||
if (nump == generalData->packetsPerFrame) {
|
if (nump == generalData->packetsPerFrame) {
|
||||||
numFramesCaught++;
|
numFramesCaught++;
|
||||||
|
@ -100,7 +100,7 @@ int64_t UDPStandardImplementation::getAcquisitionIndex() const {
|
|||||||
|
|
||||||
for (vector<DataProcessor*>::const_iterator it = dataProcessor.begin(); it != dataProcessor.end(); ++it){
|
for (vector<DataProcessor*>::const_iterator it = dataProcessor.begin(); it != dataProcessor.end(); ++it){
|
||||||
flagsum += ((*it)->GetAcquisitionStartedFlag() ? 1 : 0);
|
flagsum += ((*it)->GetAcquisitionStartedFlag() ? 1 : 0);
|
||||||
sum += (*it)->GetProcessedAcquisitionIndex();
|
sum += (*it)->GetActualProcessedAcquisitionIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
//no data processed
|
//no data processed
|
||||||
|
Loading…
x
Reference in New Issue
Block a user