added nchans for each dimension and edited update offsets to work better for 2d dets

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@514 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d
2013-04-16 13:39:58 +00:00
parent cec069f0e9
commit ca15ff971d
5 changed files with 91 additions and 43 deletions

View File

@ -24,7 +24,8 @@
#include <iomanip> //set precision
#include <sched.h>
//#include <sched.h> //sched_idle
//#include <fcntl.h> //posix_fadvice
#include <string.h>
#include <iostream>
@ -91,6 +92,7 @@ slsReceiverFunctionList::slsReceiverFunctionList(detectorType det):
if (det == MOENCH)
aligned_frame_size = MOENCH_ALIGNED_FRAME_SIZE;
mem0=(char*)malloc(aligned_frame_size*FIFO_SIZE);
if (mem0==NULL) {
cout<<"++++++++++++++++++++++ COULD NOT ALLOCATE MEMORY!!!!!!!+++++++++++++++++++++" << endl;
@ -246,12 +248,12 @@ int slsReceiverFunctionList::startReceiver(){
cout << "ERROR: Could not prioritize threads. You need to be super user for that." << endl;
if (pthread_setschedparam(writing_thread, policy, &write_param) == EPERM)
cout << "ERROR: Could not prioritize threads. You need to be super user for that." << endl;
if (pthread_setschedparam(pthread_self(), 5, &tcp_param) == EPERM)
if (pthread_setschedparam(pthread_self(),policy , &tcp_param) == EPERM)
cout << "ERROR: Could not prioritize threads. You need to be super user for that." << endl;
pthread_getschedparam(pthread_self(),&policy,&tcp_param);
cout << "current priority of main tcp thread is " << tcp_param.sched_priority << endl;
//pthread_getschedparam(pthread_self(),&policy,&tcp_param);
//cout << "current priority of main tcp thread is " << tcp_param.sched_priority << endl;
}
@ -453,6 +455,7 @@ int slsReceiverFunctionList::startWriting(){
if(enableFileWrite || cbAction>0){
sfilefd = fopen((const char *) (savefilename), "w");
cout << savefilename << endl;
//posix_fadvise(fileno(sfilefd),0,0,POSIX_FADV_DONTNEED|POSIX_FADV_SEQUENTIAL);
}
@ -468,8 +471,10 @@ int slsReceiverFunctionList::startWriting(){
//start writing in new file
if(enableFileWrite || cbAction>0){
//fsync(fileno(sfilefd));
fclose(sfilefd);
sfilefd = fopen((const char *) (savefilename), "w");
//posix_fadvise(fileno(sfilefd),0,0,POSIX_FADV_DONTNEED|POSIX_FADV_SEQUENTIAL);
}
//currframenum=(int)(*((int*)latestData));
@ -535,7 +540,9 @@ int slsReceiverFunctionList::startWriting(){
cout << "Total Frames Caught:"<< totalFramesCaught << endl;
//close file
if(sfilefd) fclose(sfilefd);
if(sfilefd)
fclose(sfilefd);
//{ fsync(fileno(sfilefd));fclose(sfilefd);}
#ifdef VERBOSE
cout << "sfield:" << (int)sfilefd << endl;
#endif