basename for hdf5 fixes

This commit is contained in:
Dhanya Maliakal
2017-07-27 09:31:14 +02:00
parent 8a8e76e839
commit 0fcf768772
7 changed files with 21 additions and 16 deletions

View File

@ -64,12 +64,13 @@ int BinaryFile::CreateFile(uint64_t fnum) {
FILE_LOG(logINFO) << "[" << *udpPortNumber << "]: Binary File created: " << currentFileName;
//other files
else {
char c[1000]; strcpy(c, currentFileName.c_str());
if (loss)
bprintf(RED,"[%u]: Packet_Loss:%lu Fifo_Max_Level:%d \tNew_File:%s\n",
*udpPortNumber,loss, fifo->GetMaxLevelForFifoBound() , basename(currentFileName.c_str()));
*udpPortNumber,loss, fifo->GetMaxLevelForFifoBound() , basename(c));
else
bprintf(GREEN,"[%u]: Packet_Loss:%lu Fifo_Max_Level:%d \tNew_File:%s\n",
*udpPortNumber,loss, fifo->GetMaxLevelForFifoBound(), basename(currentFileName.c_str()));
*udpPortNumber,loss, fifo->GetMaxLevelForFifoBound(), basename(c));
}
return OK;

View File

@ -229,7 +229,7 @@ void DataProcessor::SetupFileWriter(int* nd, char* fname, char* fpath, uint64_t*
file = new HDF5File(index, generalData->maxFramesPerFile, &generalData->packetsPerFrame,
nd, fname, fpath, findex,
frindexenable, owenable,
dindex, nunits, nf, dr, portno
dindex, nunits, nf, dr, portno,
generalData->nPixelsX, generalData->nPixelsY, fifo);
break;
#endif

View File

@ -9,6 +9,8 @@
#include <iostream>
#include <iomanip>
#include <libgen.h> //basename
#include <string.h>
using namespace std;
@ -119,12 +121,13 @@ int HDF5File::CreateFile(uint64_t fnum) {
FILE_LOG(logINFO) << *udpPortNumber << ": HDF5 File created: " << currentFileName;
//other files
else {
char c[1000]; strcpy(c, currentFileName.c_str());
if (loss)
bprintf(RED,"[%u]: Packet_Loss:%lu Fifo_Max_Level:%d \tNew_File:%s\n",
*udpPortNumber,loss, fifo->GetMaxLevelForFifoBound() , basename(currentFileName.c_str()));
*udpPortNumber,loss, fifo->GetMaxLevelForFifoBound() , basename(c));
else
bprintf(GREEN,"[%u]: Packet_Loss:%lu Fifo_Max_Level:%d \tNew_File:%s\n",
*udpPortNumber,loss, fifo->GetMaxLevelForFifoBound(), basename(currentFileName.c_str()));
*udpPortNumber,loss, fifo->GetMaxLevelForFifoBound(), basename(c));
}