From d49a5cd7b4f9ed4f063e22b90eeee070c8a71fc3 Mon Sep 17 00:00:00 2001 From: l_maliakal_d Date: Fri, 7 Jun 2013 11:16:53 +0000 Subject: [PATCH] bug fix: after cloning, signals still ocnnected git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@195 af1100a4-978c-4157-bff7-07162d2ba061 --- slsDetectorGui/include/qDetectorMain.h | 1 - slsDetectorGui/include/qDrawPlot.h | 5 ++++ slsDetectorGui/include/qTabPlot.h | 4 ++- slsDetectorGui/include/svnInfoGui.h | 11 ------- slsDetectorGui/src/qDetectorMain.cpp | 3 ++ slsDetectorGui/src/qDrawPlot.cpp | 40 ++++++++++++++++++++++++++ slsDetectorGui/src/qTabPlot.cpp | 26 +++++++++++++++++ 7 files changed, 77 insertions(+), 13 deletions(-) diff --git a/slsDetectorGui/include/qDetectorMain.h b/slsDetectorGui/include/qDetectorMain.h index 9d9848f7d..181ab9cde 100644 --- a/slsDetectorGui/include/qDetectorMain.h +++ b/slsDetectorGui/include/qDetectorMain.h @@ -190,7 +190,6 @@ protected: * */ void resizeEvent(QResizeEvent* event); -signals: }; diff --git a/slsDetectorGui/include/qDrawPlot.h b/slsDetectorGui/include/qDrawPlot.h index 8341d6a01..09894f69a 100644 --- a/slsDetectorGui/include/qDrawPlot.h +++ b/slsDetectorGui/include/qDrawPlot.h @@ -126,6 +126,10 @@ public: */ bool GetClientInitiated(){return clientInitiated;}; + /** Update all ranges, interpolate etc after cloning + * parameters are if they are checked or not + */ + void UpdateAfterCloning(bool points, bool logy, bool interpolate, bool contour, bool logz); public slots: /** To select 1D or 2D plot @@ -511,6 +515,7 @@ void ResetZMinZMaxSignal(bool,bool,double,double); void SetCurrentMeasurementSignal(int); void saveErrorSignal(QString); void AcquisitionErrorSignal(QString); +void UpdateAfterCloningSignal(); }; diff --git a/slsDetectorGui/include/qTabPlot.h b/slsDetectorGui/include/qTabPlot.h index 4ebfed61b..57a964942 100644 --- a/slsDetectorGui/include/qTabPlot.h +++ b/slsDetectorGui/include/qTabPlot.h @@ -112,7 +112,9 @@ public slots: */ void EnableScanBox(); - + /** Update all ranges, interpolate etc after cloning + */ + void UpdateAfterCloning(); private slots: /** Selects the plot to display, enables/disables widgets diff --git a/slsDetectorGui/include/svnInfoGui.h b/slsDetectorGui/include/svnInfoGui.h index 39cf7f80f..e69de29bb 100644 --- a/slsDetectorGui/include/svnInfoGui.h +++ b/slsDetectorGui/include/svnInfoGui.h @@ -1,11 +0,0 @@ -//#define SVNPATH "" -#define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui" -//#define SVNREPPATH "" -#define SVNREPUUID "af1100a4-978c-4157-bff7-07162d2ba061" -//#define SVNREV 0x193 -//#define SVNKIND "" -//#define SVNSCHED "" -#define SVNAUTH "l_maliakal_d" -#define SVNREV 0x193 -#define SVNDATE 0x20130528 -// diff --git a/slsDetectorGui/src/qDetectorMain.cpp b/slsDetectorGui/src/qDetectorMain.cpp index f4f0ff63d..cda172f75 100644 --- a/slsDetectorGui/src/qDetectorMain.cpp +++ b/slsDetectorGui/src/qDetectorMain.cpp @@ -279,6 +279,9 @@ void qDetectorMain::Initialization(){ //This should not be called as it will change file name to measurement when run finished //connect(myPlot, SIGNAL(UpdatingPlotFinished()), tab_plot, SLOT(Refresh())); connect(myPlot, SIGNAL(SetCurrentMeasurementSignal(int)), tab_measurement, SLOT(SetCurrentMeasurement(int))); + //to update all ranges when a clone has been made + connect(myPlot, SIGNAL(UpdateAfterCloningSignal()), tab_plot,SLOT(UpdateAfterCloning())); + // menubar // Modes Menu connect(menuModes, SIGNAL(triggered(QAction*)), this,SLOT(EnableModes(QAction*))); diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 14ca7a43d..99b6626e9 100644 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -1215,6 +1215,14 @@ void qDrawPlot::ClonePlot(){ LockLastImageArray(); + //disconnect + disconnect(this, SIGNAL(InterpolateSignal(bool)), plot2D, SIGNAL(InterpolateSignal(bool))); + disconnect(this, SIGNAL(ContourSignal(bool)), plot2D, SIGNAL(ContourSignal(bool))); + disconnect(this, SIGNAL(LogzSignal(bool)), plot2D, SLOT(SetZScaleToLog(bool))); + disconnect(this, SIGNAL(LogySignal(bool)), plot1D, SLOT(SetLogY(bool))); + disconnect(this, SIGNAL(ResetZMinZMaxSignal(bool,bool,double,double)),plot2D, SLOT(ResetZMinZMax(bool,bool,double,double))); + disconnect(this, SIGNAL(SetZRangeSignal(double,double)), plot2D, SLOT(SetZRange(double,double))); + // create clone winClone[i] = new qCloneWidget(this,i,boxPlot->title(),(int)plot_in_scope,plot1D,plot2D,sFilePath); if(plot_in_scope==1){ @@ -1267,6 +1275,12 @@ void qDrawPlot::ClonePlot(){ connect(this, SIGNAL(ContourSignal(bool)), plot2D, SIGNAL(ContourSignal(bool))); connect(this, SIGNAL(LogzSignal(bool)), plot2D, SLOT(SetZScaleToLog(bool))); connect(this, SIGNAL(LogySignal(bool)), plot1D, SLOT(SetLogY(bool))); + connect(this, SIGNAL(ResetZMinZMaxSignal(bool,bool,double,double)),plot2D, SLOT(ResetZMinZMax(bool,bool,double,double))); + connect(this, SIGNAL(SetZRangeSignal(double,double)), plot2D, SLOT(SetZRange(double,double))); + + //update ranges on current plot + emit UpdateAfterCloningSignal(); + winClone[i]->show(); // to remember which all clone widgets were closed @@ -1632,3 +1646,29 @@ void qDrawPlot::SetFrameFactor(int frame){ } //------------------------------------------------------------------------------------------------------------------------------------------------- + + + +void qDrawPlot::UpdateAfterCloning(bool points, bool logy, bool interpolate, bool contour, bool logz){ +#ifdef VERBOSE + cout << endl << "**Updating Plot After Cloning" << endl; +#endif + + //1d + if(plot_in_scope == 1){ + SetMarkers(points); + emit LogySignal(logy); + } + //2d + else{ + emit InterpolateSignal(interpolate); + emit ContourSignal(contour); + emit LogzSignal(logz); + } + +} + + +//------------------------------------------------------------------------------------------------------------------------------------------------- + + diff --git a/slsDetectorGui/src/qTabPlot.cpp b/slsDetectorGui/src/qTabPlot.cpp index d34575243..b68e92acf 100644 --- a/slsDetectorGui/src/qTabPlot.cpp +++ b/slsDetectorGui/src/qTabPlot.cpp @@ -877,4 +877,30 @@ void qTabPlot::Refresh(){ } +//------------------------------------------------------------------------------------------------------------------------------------------------- + + +void qTabPlot::UpdateAfterCloning(){ +#ifdef VERBOSE + cout << endl << "**Updating Plot After Cloning" << endl; +#endif + EnableRange(); + EnableTitles(); + myPlot->UpdateAfterCloning( + chkPoints->isChecked(), + chk1DLog->isChecked(), + chkInterpolate->isChecked(), + chkContour->isChecked(), + chkLogz->isChecked()); + + //1d + if(isOneD) + EnablePersistency(chkSuperimpose->isChecked()); + //2d + else + EnableZRange(); + +} + + //-------------------------------------------------------------------------------------------------------------------------------------------------