max frames per file, getting config filename

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@368 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d
2012-12-05 16:40:51 +00:00
parent 452812aaf8
commit 3b2a8ea13a
4 changed files with 9 additions and 4 deletions

View File

@ -34,7 +34,7 @@ int main(int argc, char *argv[])
cout << "no config file name given. Exiting." << endl; cout << "no config file name given. Exiting." << endl;
return -1; return -1;
} }
fname.assign(argv[iarg]); fname.assign(argv[iarg+1]);
} }
if(!strcasecmp(argv[iarg],"-shortfname")) if(!strcasecmp(argv[iarg],"-shortfname"))
shortfname = true; shortfname = true;

View File

@ -251,6 +251,7 @@ int slsReceiverFunctionList::startListening(){
if(fifo->isFull()) if(fifo->isFull())
cout<<"**********************FIFO FULLLLLLLL************************"<<endl; cout<<"**********************FIFO FULLLLLLLL************************"<<endl;
else{ else{
cout<<"read index:"<<(int)(*(int*)buffer)<<endl;
dataReadFrame = new dataStruct; dataReadFrame = new dataStruct;
dataReadFrame->buffer=buffer; dataReadFrame->buffer=buffer;
dataReadFrame->rc=rc; dataReadFrame->rc=rc;
@ -320,8 +321,8 @@ int slsReceiverFunctionList::startWriting(){
while(listening_thread_running){ while(listening_thread_running){
//when it reaches 20000,start writing new file //when it reaches MAX_FRAMES_PER_FILE,start writing new file
if (framesInFile == 20000) { if (framesInFile == MAX_FRAMES_PER_FILE) {
fclose(sfilefd); fclose(sfilefd);
//create file name //create file name
@ -354,6 +355,7 @@ int slsReceiverFunctionList::startWriting(){
framesCaught++; framesCaught++;
totalFramesCaught++; totalFramesCaught++;
memcpy(latestData,dataWriteFrame->buffer,BUFFER_SIZE); memcpy(latestData,dataWriteFrame->buffer,BUFFER_SIZE);
//cout<<"list write \t index:"<<(int)(*(int*)latestData)<<endl;
fwrite(dataWriteFrame->buffer, 1, dataWriteFrame->rc, sfilefd); fwrite(dataWriteFrame->buffer, 1, dataWriteFrame->rc, sfilefd);
framesInFile++; framesInFile++;
delete dataWriteFrame->buffer; delete dataWriteFrame->buffer;

View File

@ -156,6 +156,9 @@ public:
private: private:
static const int MAX_FRAMES_PER_FILE = 20000;
/** Complete File name */ /** Complete File name */
char savefilename[MAX_STR_LENGTH]; char savefilename[MAX_STR_LENGTH];

View File

@ -607,7 +607,7 @@ int slsReceiverFuncs::read_frame(){
index2= (int)(*((int*)((char*)(raw+onebuffersize)))); index2= (int)(*((int*)((char*)(raw+onebuffersize))));
memcpy(origVal,raw,BUFFER_SIZE); memcpy(origVal,raw,BUFFER_SIZE);
raw=NULL; raw=NULL;
//cout<<"index:"<<index<<"\tindex2:"<<index2<<endl; //cout<<"funcs\tindex:"<<index<<"\tindex2:"<<index2<<endl;
//1 odd, 1 even //1 odd, 1 even