mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-14 22:07:12 +02:00
bug fixed: must wait to get data for scans
git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@71 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
@ -590,6 +590,7 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
if(scanArgument!=None){
|
if(scanArgument!=None){
|
||||||
//alframes
|
//alframes
|
||||||
if(scanArgument==AllFrames){
|
if(scanArgument==AllFrames){
|
||||||
|
while(1){
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
//variables
|
//variables
|
||||||
lastImageNumber= currentFrame+1;
|
lastImageNumber= currentFrame+1;
|
||||||
@ -600,6 +601,8 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
//copy data
|
//copy data
|
||||||
memcpy(lastImageArray+(currentScanDivLevel*nPixelsX),data->values,nPixelsX*sizeof(double));
|
memcpy(lastImageArray+(currentScanDivLevel*nPixelsX),data->values,nPixelsX*sizeof(double));
|
||||||
pthread_mutex_unlock(&(last_image_complete_mutex));
|
pthread_mutex_unlock(&(last_image_complete_mutex));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
currentFrame++;
|
currentFrame++;
|
||||||
currentScanDivLevel++;
|
currentScanDivLevel++;
|
||||||
@ -607,6 +610,7 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
}
|
}
|
||||||
//file index
|
//file index
|
||||||
if(scanArgument==FileIndex){
|
if(scanArgument==FileIndex){
|
||||||
|
while(1){
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
//variables
|
//variables
|
||||||
int currentIndex = fileIOStatic::getFileIndexFromFileName(string(data->fileName));
|
int currentIndex = fileIOStatic::getFileIndexFromFileName(string(data->fileName));
|
||||||
@ -619,6 +623,8 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
//copy data
|
//copy data
|
||||||
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
|
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
|
||||||
pthread_mutex_unlock(&(last_image_complete_mutex));
|
pthread_mutex_unlock(&(last_image_complete_mutex));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
currentFrame++;
|
currentFrame++;
|
||||||
currentScanDivLevel++;
|
currentScanDivLevel++;
|
||||||
@ -626,6 +632,7 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
}
|
}
|
||||||
//level0
|
//level0
|
||||||
if(scanArgument==Level0){
|
if(scanArgument==Level0){
|
||||||
|
while(1){
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
//get scanvariable0
|
//get scanvariable0
|
||||||
int currentIndex = 0, p = 0; double cs0 = 0 , cs1 = 0;
|
int currentIndex = 0, p = 0; double cs0 = 0 , cs1 = 0;
|
||||||
@ -644,11 +651,14 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
//copy data
|
//copy data
|
||||||
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
|
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
|
||||||
pthread_mutex_unlock(&(last_image_complete_mutex));
|
pthread_mutex_unlock(&(last_image_complete_mutex));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
currentFrame++;
|
currentFrame++;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
//level1
|
//level1
|
||||||
|
while(1){
|
||||||
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
|
||||||
//get scanvariable1
|
//get scanvariable1
|
||||||
int currentIndex = 0, p = 0; double cs0 = 0 , cs1 = 0;
|
int currentIndex = 0, p = 0; double cs0 = 0 , cs1 = 0;
|
||||||
@ -665,6 +675,8 @@ int qDrawPlot::GetData(detectorData *data){
|
|||||||
//copy data
|
//copy data
|
||||||
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
|
for(unsigned int px=0;px<nPixelsX;px++) lastImageArray[currentScanDivLevel*nPixelsX+px] += data->values[px];
|
||||||
pthread_mutex_unlock(&(last_image_complete_mutex));
|
pthread_mutex_unlock(&(last_image_complete_mutex));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
currentFrame++;
|
currentFrame++;
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user