From 4fdacefdbe8e2e9321d4a1731d5388c167bc038b Mon Sep 17 00:00:00 2001 From: l_maliakal_d Date: Mon, 13 May 2013 13:47:05 +0000 Subject: [PATCH] getting rid of undefined state in gui git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@179 af1100a4-978c-4157-bff7-07162d2ba061 --- slsDetectorGui/include/qDrawPlot.h | 1 + slsDetectorGui/src/qTabMeasurement.cpp | 16 ++++++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/slsDetectorGui/include/qDrawPlot.h b/slsDetectorGui/include/qDrawPlot.h index f590cf29a..798883912 100644 --- a/slsDetectorGui/include/qDrawPlot.h +++ b/slsDetectorGui/include/qDrawPlot.h @@ -499,6 +499,7 @@ int pedestalCount; bool clientInitiated; + signals: void UpdatingPlotFinished(); void InterpolateSignal(bool); diff --git a/slsDetectorGui/src/qTabMeasurement.cpp b/slsDetectorGui/src/qTabMeasurement.cpp index 6fe050669..1a3b82dfc 100644 --- a/slsDetectorGui/src/qTabMeasurement.cpp +++ b/slsDetectorGui/src/qTabMeasurement.cpp @@ -272,9 +272,12 @@ void qTabMeasurement::DeInitialization(){ void qTabMeasurement::Enable(bool enable){ frameTimeResolved->setEnabled(enable); frameNotTimeResolved->setEnabled(enable); + //Enable this always - if(!enable) btnStartStop->setEnabled(true); - btnStartStop->setShortcut(QApplication::translate("TabMeasurementObject", "Shift+Space", 0, QApplication::UnicodeUTF8)); + //if(!enable) btnStartStop->setEnabled(true); + + //shortcut each time, else it doesnt work a second time + btnStartStop->setShortcut(QApplication::translate("TabMeasurementObject", "Shift+Space", 0, QApplication::UnicodeUTF8)); } @@ -321,8 +324,9 @@ void qTabMeasurement::startStopAcquisition(){ #ifdef VERBOSE cout << "Stopping Acquisition" << endl<< endl; #endif - emit StopSignal(); + //emit StopSignal(); commented out to prevent undefined state myDet->stopAcquisition(); + /* commented out to prevent undefined state myDet->waitForReceiverReadToFinish(); UpdateProgress(); @@ -335,7 +339,7 @@ void qTabMeasurement::startStopAcquisition(){ btnStartStop->setText("Start"); btnStartStop->setIcon(*iconStart); btnStartStop->setChecked(false); - Enable(1); + Enable(1);*/ } qDefs::checkErrorMessage(myDet); } @@ -345,7 +349,7 @@ void qTabMeasurement::startStopAcquisition(){ void qTabMeasurement::UpdateFinished(){ - if(btnStartStop->isChecked()){ + //if(btnStartStop->isChecked()){ UpdateProgress(); disconnect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(setRunIndex(int))); @@ -361,7 +365,7 @@ void qTabMeasurement::UpdateFinished(){ connect(btnStartStop,SIGNAL(clicked()),this,SLOT(startStopAcquisition())); - } + //} qDefs::checkErrorMessage(myDet); }