From 3c30ef71cf06fb4d73545ad8f9c8570e603a664f Mon Sep 17 00:00:00 2001 From: l_maliakal_d Date: Wed, 28 Aug 2013 15:02:17 +0000 Subject: [PATCH] fixed the zooming problems for 2d git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@231 af1100a4-978c-4157-bff7-07162d2ba061 --- slsDetectorGui/include/svnInfoGui.h | 6 +++--- slsDetectorGui/src/qDrawPlot.cpp | 12 ++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/slsDetectorGui/include/svnInfoGui.h b/slsDetectorGui/include/svnInfoGui.h index 7d40dd535..af9d1e6c7 100644 --- a/slsDetectorGui/include/svnInfoGui.h +++ b/slsDetectorGui/include/svnInfoGui.h @@ -2,10 +2,10 @@ #define SVNURL "file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui" //#define SVNREPPATH "" #define SVNREPUUID "af1100a4-978c-4157-bff7-07162d2ba061" -//#define SVNREV 0x229 +//#define SVNREV 0x230 //#define SVNKIND "" //#define SVNSCHED "" #define SVNAUTH "l_maliakal_d" -#define SVNREV 0x229 -#define SVNDATE 0x20130816 +#define SVNREV 0x230 +#define SVNDATE 0x20130827 // diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 0cd468372..854abd57f 100644 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -458,6 +458,9 @@ int qDrawPlot::ResetDaqForGui(){ bool qDrawPlot::StartOrStopThread(bool start){ +#ifdef VERBOSE + cout << "StartOrStopThread:" << start << endl; +#endif static bool firstTime = true; static bool gui_acquisition_thread_running = 0; static pthread_t gui_acquisition_thread; @@ -480,8 +483,12 @@ bool qDrawPlot::StartOrStopThread(bool start){ //refixing all the min and max for all scans if (scanArgument == qDefs::None); else{ - plot2D->GetPlot()->UnZoom(); + //plot2D->GetPlot()->UnZoom(); + + plot2D->GetPlot()->SetXMinMax(-0.5,nPixelsX+0.5); + plot2D->GetPlot()->SetYMinMax(startPixel,endPixel); plot2D->GetPlot()->SetZoom(-0.5,startPixel,nPixelsX,endPixel-startPixel); + plot2D->GetPlot()->UnZoom(); } cout << "Starting new acquisition thread ...." << endl; @@ -1296,9 +1303,6 @@ void qDrawPlot::UpdatePlot(){ plot2D->SetYTitle(imageYAxisTitle); plot2D->SetZTitle(imageZAxisTitle); plot2D->UpdateNKeepSetRangeIfSet(); //keep a "set" z range, and call Update(); - //to solve the problems regarding zooming out and zoom in - - //plot2D->GetPlot()->SetZoom(-0.5,startPixel,nPixelsX,endPixel-startPixel); } // update range if required if(XYRangeChanged){