mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-12 12:57:13 +02:00
frame number in header corected, create file logic
This commit is contained in:
@ -2141,7 +2141,7 @@ int UDPStandardImplementation::prepareAndListenBuffer(int ithread, int cSize, ch
|
|||||||
if(currentpnum == pnum){
|
if(currentpnum == pnum){
|
||||||
//cout<<"correct packet"<<endl;
|
//cout<<"correct packet"<<endl;
|
||||||
if(pnum == packetsPerFrame-1){
|
if(pnum == packetsPerFrame-1){
|
||||||
(*((uint32_t*)(buffer[ithread]+8))) = (*( (uint32_t*) header->frameNumber))&frameIndexMask;
|
(*((uint32_t*)(buffer[ithread]+8))) = ((*( (uint32_t*) header->frameNumber))&frameIndexMask)-startFrameIndex;
|
||||||
//cout<<"current fnum:"<<(*((uint32_t*)(buffer[ithread]+8)))<<endl;
|
//cout<<"current fnum:"<<(*((uint32_t*)(buffer[ithread]+8)))<<endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2539,16 +2539,16 @@ void UDPStandardImplementation::startWriting(){
|
|||||||
cprintf(GREEN,"Writing_Thread %d: Popped %p from FIFO %d\n", ithread, (void*)(wbuf),listenfifoIndex);
|
cprintf(GREEN,"Writing_Thread %d: Popped %p from FIFO %d\n", ithread, (void*)(wbuf),listenfifoIndex);
|
||||||
#endif
|
#endif
|
||||||
uint32_t numPackets = (uint32_t)(*((uint32_t*)wbuf));
|
uint32_t numPackets = (uint32_t)(*((uint32_t*)wbuf));
|
||||||
//#ifdef DEBUG4
|
#ifdef DEBUG4
|
||||||
cprintf(GREEN,"Writing_Thread %d: Number of Packets: %d for FIFO %d\n", ithread, numPackets, listenfifoIndex);
|
cprintf(GREEN,"Writing_Thread %d: Number of Packets: %d for FIFO %d\n", ithread, numPackets, listenfifoIndex);
|
||||||
//#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
//end of acquisition
|
//end of acquisition
|
||||||
if(numPackets == dummyPacketValue){
|
if(numPackets == dummyPacketValue){
|
||||||
//#ifdef DEBUG4
|
#ifdef DEBUG4
|
||||||
cprintf(GREEN,"Writing_Thread %d: Dummy frame popped out of FIFO %d",ithread, listenfifoIndex);
|
cprintf(GREEN,"Writing_Thread %d: Dummy frame popped out of FIFO %d",ithread, listenfifoIndex);
|
||||||
//#endif
|
#endif
|
||||||
stopWriting(ithread,wbuf);
|
stopWriting(ithread,wbuf);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -2870,7 +2870,7 @@ void UDPStandardImplementation::handleWithoutMissingPackets(int ithread, char* w
|
|||||||
//write to file if enabled and update write parameters
|
//write to file if enabled and update write parameters
|
||||||
if(npackets > 0){
|
if(npackets > 0){
|
||||||
if((fileWriteEnable) && (sfilefd[ithread])){
|
if((fileWriteEnable) && (sfilefd[ithread])){
|
||||||
if(tempframenumber >= maxFramesPerFile)
|
if((tempframenumber%maxFramesPerFile) == 0)
|
||||||
createNewFile(ithread);
|
createNewFile(ithread);
|
||||||
fwrite(wbuffer, 1, oneDataSize*packetsPerFrame+fifoBufferHeaderSize, sfilefd[ithread]);
|
fwrite(wbuffer, 1, oneDataSize*packetsPerFrame+fifoBufferHeaderSize, sfilefd[ithread]);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user