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
This commit is contained in:
l_maliakal_d 2013-06-07 11:16:53 +00:00
parent 378f7715b9
commit d49a5cd7b4
7 changed files with 77 additions and 13 deletions

View File

@ -190,7 +190,6 @@ protected:
* */ * */
void resizeEvent(QResizeEvent* event); void resizeEvent(QResizeEvent* event);
signals:
}; };

View File

@ -126,6 +126,10 @@ public:
*/ */
bool GetClientInitiated(){return clientInitiated;}; 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: public slots:
/** To select 1D or 2D plot /** To select 1D or 2D plot
@ -511,6 +515,7 @@ void ResetZMinZMaxSignal(bool,bool,double,double);
void SetCurrentMeasurementSignal(int); void SetCurrentMeasurementSignal(int);
void saveErrorSignal(QString); void saveErrorSignal(QString);
void AcquisitionErrorSignal(QString); void AcquisitionErrorSignal(QString);
void UpdateAfterCloningSignal();
}; };

View File

@ -112,7 +112,9 @@ public slots:
*/ */
void EnableScanBox(); void EnableScanBox();
/** Update all ranges, interpolate etc after cloning
*/
void UpdateAfterCloning();
private slots: private slots:
/** Selects the plot to display, enables/disables widgets /** Selects the plot to display, enables/disables widgets

View File

@ -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
//

View File

@ -279,6 +279,9 @@ void qDetectorMain::Initialization(){
//This should not be called as it will change file name to measurement when run finished //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(UpdatingPlotFinished()), tab_plot, SLOT(Refresh()));
connect(myPlot, SIGNAL(SetCurrentMeasurementSignal(int)), tab_measurement, SLOT(SetCurrentMeasurement(int))); 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 // menubar
// Modes Menu // Modes Menu
connect(menuModes, SIGNAL(triggered(QAction*)), this,SLOT(EnableModes(QAction*))); connect(menuModes, SIGNAL(triggered(QAction*)), this,SLOT(EnableModes(QAction*)));

View File

@ -1215,6 +1215,14 @@ void qDrawPlot::ClonePlot(){
LockLastImageArray(); 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 // create clone
winClone[i] = new qCloneWidget(this,i,boxPlot->title(),(int)plot_in_scope,plot1D,plot2D,sFilePath); winClone[i] = new qCloneWidget(this,i,boxPlot->title(),(int)plot_in_scope,plot1D,plot2D,sFilePath);
if(plot_in_scope==1){ if(plot_in_scope==1){
@ -1267,6 +1275,12 @@ void qDrawPlot::ClonePlot(){
connect(this, SIGNAL(ContourSignal(bool)), plot2D, SIGNAL(ContourSignal(bool))); connect(this, SIGNAL(ContourSignal(bool)), plot2D, SIGNAL(ContourSignal(bool)));
connect(this, SIGNAL(LogzSignal(bool)), plot2D, SLOT(SetZScaleToLog(bool))); connect(this, SIGNAL(LogzSignal(bool)), plot2D, SLOT(SetZScaleToLog(bool)));
connect(this, SIGNAL(LogySignal(bool)), plot1D, SLOT(SetLogY(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(); winClone[i]->show();
// to remember which all clone widgets were closed // 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);
}
}
//-------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -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();
}
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------