bug fix: plot tab refresh doesnt change plot

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@79 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d
2012-09-25 16:55:33 +00:00
parent bdabf9e649
commit 1eb07b31f6
5 changed files with 43 additions and 30 deletions

View File

@ -530,8 +530,6 @@ int qDrawPlot::GetData(detectorData *data){
#endif
if(!stop_signal){
//set title
SetPlotTitle(QString(data->fileName).section('/',-1));
//set progress
progress=(int)data->progressIndex;
currentFileIndex = fileIOStatic::getFileIndexFromFileName(string(data->fileName));
@ -548,6 +546,9 @@ int qDrawPlot::GetData(detectorData *data){
//angle plotting
if(anglePlot){
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
//set title
SetPlotTitle(QString(data->fileName).section('/',-1));
cout<<"angle plot"<<endl;
if(data->angles==NULL){
cout<<"\n\nWARNING:RETURNED NULL instead of angles."<<endl;
@ -614,6 +615,8 @@ int qDrawPlot::GetData(detectorData *data){
if(scanArgument==AllFrames){
while(1){
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
//set title
SetPlotTitle(QString(data->fileName).section('/',-1));
//variables
lastImageNumber= currentFrame+1;
//title
@ -634,6 +637,8 @@ int qDrawPlot::GetData(detectorData *data){
if(scanArgument==FileIndex){
while(1){
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
//set title
SetPlotTitle(QString(data->fileName).section('/',-1));
//variables
if(currentFileIndex == minPixelsY) currentScanDivLevel = 0;
lastImageNumber= currentFrame+1;
@ -655,6 +660,8 @@ int qDrawPlot::GetData(detectorData *data){
if(scanArgument==Level0){
while(1){
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
//set title
SetPlotTitle(QString(data->fileName).section('/',-1));
//get scanvariable0
int ci = 0, p = 0; double cs0 = 0 , cs1 = 0;
fileIOStatic::getVariablesFromFileName(string(data->fileName), ci, p, cs0, cs1);
@ -683,6 +690,8 @@ int qDrawPlot::GetData(detectorData *data){
//level1
while(1){
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
//set title
SetPlotTitle(QString(data->fileName).section('/',-1));
//get scanvariable1
int ci = 0, p = 0; double cs0 = 0 , cs1 = 0;
fileIOStatic::getVariablesFromFileName(string(data->fileName), ci, p, cs0, cs1);
@ -710,6 +719,8 @@ int qDrawPlot::GetData(detectorData *data){
//normal measurement or 1d scans
if(!pthread_mutex_trylock(&(last_image_complete_mutex))){
//set title
SetPlotTitle(QString(data->fileName).section('/',-1));
char temp_title[2000];
// only if you got the lock, do u need to remember lastimagenumber to plot
lastImageNumber= currentFrame+1;
@ -879,8 +890,7 @@ void qDrawPlot::UpdatePlot(){
cout << "Entering UpdatePlot function" << endl;
#endif
plot_update_timer->stop();
//set plot title
boxPlot->setTitle(plotTitle);
// only if no plot isnt enabled
if(plotEnable){
LockLastImageArray();
@ -957,6 +967,9 @@ void qDrawPlot::UpdatePlot(){
}
last_plot_number=lastImageNumber;
//set plot title
boxPlot->setTitle(plotTitle);
if(plotEnable) UnlockLastImageArray();