fixed the dac problem

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@28 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d
2012-08-15 17:21:05 +00:00
parent 63bfdb9cb9
commit 30c11d7589
14 changed files with 214 additions and 108 deletions

View File

@ -64,7 +64,8 @@ void qDrawPlot::SetupWidgetWindow(){
lastImageNumber = 0;
last_plot_number = 0;
nPixelsX = 1280; nPixelsY = 100;
nPixelsX = myDet->getTotalNumberOfChannels();
nPixelsY = 100;
lastImageArray = 0;
image_data = 0;
@ -426,8 +427,64 @@ int qDrawPlot::GetData(detectorData *data){
return 0;
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
int qDrawPlot::GetScanDataCallBack(detectorData *data, void *this_pointer){
((qDrawPlot*)this_pointer)->GetScanData(data);
return 0;
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
int qDrawPlot::GetScanData(detectorData *data){/*
#ifdef VERYVERBOSE
cout<<"Entering GetScanDatafunction"<<endl;
#endif
if(!stop_signal){
//if plot disabled, RETURN
if(!plotEnable) {
progress=(int)data->progressIndex;
//lastImageNumber= currentFrame+1;
currentThrehold++;
return 0;
}
//what comes here has plot enabled AND (frame factor OR data pause over )
progress=(int)data->progressIndex;
#ifdef VERYVERBOSE
cout<<"Reading in image: "<<currentThrehold<<endl;
#endif
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
char temp_title[2000];
// only if you got the lock, do u need to remember lastimagenumber to plot
lastImageNumber= currentThrehold+1;
nPixelsY = currentThrehold+1;
// Titles
sprintf(temp_title,"Adding Threshold %f",threhold[currentThrehold]);
imageTitle = temp_title;
// copy data
memcpy(lastImageArray[i],data->values,nPixelsX*sizeof(double));
pthread_mutex_unlock(&(last_image_complete_mutex));
}
currentThrehold++;
}
#ifdef VERYVERBOSE
cout<<"Exiting GetScanData function"<<endl;
#endif*/
return 0;
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qDrawPlot::SelectPlot(int i){ //1 for 1D otherwise 2D
if(i==1){
plot1D->SetXTitle(histXAxisTitle.toAscii().constData());