From cfce337c46be6a592e2be7d26b71589afb0ffa71 Mon Sep 17 00:00:00 2001 From: l_maliakal_d Date: Tue, 25 Sep 2012 15:51:29 +0000 Subject: [PATCH] bug fix:scans: backward scan plotting works now git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@77 af1100a4-978c-4157-bff7-07162d2ba061 --- slsDetectorGui/include/qDrawPlot.h | 4 ++++ slsDetectorGui/src/qDrawPlot.cpp | 5 +++++ slsDetectorGui/src/qTabMeasurement.cpp | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/slsDetectorGui/include/qDrawPlot.h b/slsDetectorGui/include/qDrawPlot.h index 2bb7febc8..69b7ffa5f 100644 --- a/slsDetectorGui/include/qDrawPlot.h +++ b/slsDetectorGui/include/qDrawPlot.h @@ -50,6 +50,8 @@ public: bool isRunning(){return running;}; /** gets the progress of acquisition to the measurement tab*/ int GetProgress(){return progress;}; + /** gets the file index to the measurement tab*/ + int GetFileIndex(){return currentFileIndex;}; /** sets plot Title */ void SetPlotTitle(QString title) {plotTitle = title;} @@ -308,6 +310,8 @@ int number_of_frames; double acquisitionPeriod; /** Acquisition Time */ double exposureTime; +/** Current index*/ +int currentFileIndex; diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 2ae32fdd7..138171b7e 100644 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -103,6 +103,8 @@ void qDrawPlot::SetupWidgetWindow(){ alreadyDisplayed = false; backwardScanPlot = false; + + currentFileIndex = 0; // This is so that it initially stop and plots running = 1; for(int i=0;igetFilePath().c_str()); fileName = QString(myDet->getFileName().c_str()); + //update index + currentFileIndex = myDet->getFileIndex(); @@ -530,6 +534,7 @@ int qDrawPlot::GetData(detectorData *data){ SetPlotTitle(QString(data->fileName).section('/',-1)); //set progress progress=(int)data->progressIndex; + currentFileIndex = fileIOStatic::getFileIndexFromFileName(string(data->fileName)); #ifdef VERBOSE cout << "progress:" << progress << endl; #endif diff --git a/slsDetectorGui/src/qTabMeasurement.cpp b/slsDetectorGui/src/qTabMeasurement.cpp index fb720ef0f..1cde39499 100644 --- a/slsDetectorGui/src/qTabMeasurement.cpp +++ b/slsDetectorGui/src/qTabMeasurement.cpp @@ -354,7 +354,7 @@ void qTabMeasurement::SetCurrentMeasurement(int val){ void qTabMeasurement::UpdateProgress(){ //progressBar->setValue((int)(((currentMeasurement*100)+(myPlot->GetProgress()))/spinNumMeasurements->value())); progressBar->setValue((int)myPlot->GetProgress()); - lblProgressIndex->setText(QString::number(myDet->getFileIndex())); + lblProgressIndex->setText(QString::number(myPlot->GetFileIndex())); }