mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-05-02 02:40:04 +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();
|
||||
|
||||
/**
|
||||
* 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)
|
||||
* @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;
|
||||
}
|
||||
|
||||
uint64_t DataProcessor::GetActualProcessedAcquisitionIndex() {
|
||||
return currentFrameIndex;
|
||||
}
|
||||
|
||||
uint64_t DataProcessor::GetProcessedAcquisitionIndex() {
|
||||
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) {
|
||||
file->CloseAllFiles();
|
||||
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);
|
||||
uint64_t fnum = header->frameNumber;
|
||||
currentFrameIndex = fnum;
|
||||
uint32_t nump = header->packetNumber;
|
||||
if (nump == generalData->packetsPerFrame) {
|
||||
numFramesCaught++;
|
||||
|
@ -100,7 +100,7 @@ int64_t UDPStandardImplementation::getAcquisitionIndex() const {
|
||||
|
||||
for (vector<DataProcessor*>::const_iterator it = dataProcessor.begin(); it != dataProcessor.end(); ++it){
|
||||
flagsum += ((*it)->GetAcquisitionStartedFlag() ? 1 : 0);
|
||||
sum += (*it)->GetProcessedAcquisitionIndex();
|
||||
sum += (*it)->GetActualProcessedAcquisitionIndex();
|
||||
}
|
||||
|
||||
//no data processed
|
||||
|
Loading…
x
Reference in New Issue
Block a user