changed the receiver to be the one deciding the frame factor, not gui

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorSoftware@579 951219d9-93cf-4727-9268-0efd64621fa3
This commit is contained in:
l_maliakal_d
2013-05-27 09:34:24 +00:00
parent 45c690084b
commit b19fdaa0a5
7 changed files with 37 additions and 28 deletions

View File

@ -413,6 +413,7 @@ int slsReceiverFunctionList::startWriting(){
char *wbuf;
int sleepnumber=0;
int frameFactor=0;
framesInFile=0;
framesCaught=0;
@ -520,27 +521,31 @@ int slsReceiverFunctionList::startWriting(){
//reads every nth frame
else{
if(frameFactor){
frameFactor--;
}else{
frameFactor = nFrameToGui-1;
//catch nth frame: gui ready to copy data
while(guiData==NULL){
if(!listening_thread_running)
break;
usleep(10000);
guiDataReady=0;
}
//catch nth frame: gui ready to copy data
while(guiData==NULL){
if(!listening_thread_running)
break;
usleep(10000);
//copies gui data and sets/resets guiDataReady
memcpy(latestData,wbuf,bufferSize);
strcpy(guiFileName,savefilename);
guiDataReady=1;
//catch nth frame: wait for gui to take data
while(guiData==latestData){
if(!listening_thread_running)
break;
usleep(100000);
}
guiDataReady=0;
}
//copies gui data and sets/resets guiDataReady
memcpy(latestData,wbuf,bufferSize);
strcpy(guiFileName,savefilename);
guiDataReady=1;
//catch nth frame: wait for gui to take data
while(guiData==latestData){
if(!listening_thread_running)
break;
usleep(100000);
}
guiDataReady=0;
}