From b3de7a9051764a776a5e048cfe106cc7a1b9bd0e Mon Sep 17 00:00:00 2001 From: l_maliakal_d Date: Wed, 20 Jun 2012 15:26:31 +0000 Subject: [PATCH] made number of measurements static git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@13 af1100a4-978c-4157-bff7-07162d2ba061 --- slsDetectorGui/include/qDrawPlot.h | 2 +- slsDetectorGui/src/qDrawPlot.cpp | 75 ++++++++++++------------------ 2 files changed, 31 insertions(+), 46 deletions(-) diff --git a/slsDetectorGui/include/qDrawPlot.h b/slsDetectorGui/include/qDrawPlot.h index 10544e51e..5bdaa7c78 100644 --- a/slsDetectorGui/include/qDrawPlot.h +++ b/slsDetectorGui/include/qDrawPlot.h @@ -108,7 +108,7 @@ private: /** Number of Measurements */ - int numberOfMeasurements; + static int numberOfMeasurements; /** currentFrame */ static int currentFrame; /** Number of Exposures */ diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 355e94855..516029096 100644 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -26,14 +26,13 @@ using namespace std; +//------------------------------------------------------------------------------------------------------------------------------------------------- -//int numberOfMeasurements; +/** Static Members */ +int qDrawPlot::numberOfMeasurements; int qDrawPlot::currentFrame; int qDrawPlot::number_of_exposures; -//double framePeriod; -//double acquisitionTime; pthread_mutex_t qDrawPlot::last_image_complete_mutex; -//std::string imageTitle; unsigned int qDrawPlot::plot_in_scope; unsigned int qDrawPlot::nPixelsX; @@ -57,8 +56,9 @@ int qDrawPlot::currentPersistency; int qDrawPlot::progress; bool qDrawPlot::plotEnable; +//------------------------------------------------------------------------------------------------------------------------------------------------- -qDrawPlot::qDrawPlot(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector),numberOfMeasurements(1){ +qDrawPlot::qDrawPlot(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent),myDet(detector){ if(myDet) { SetupWidgetWindow(); Initialization(); @@ -66,6 +66,7 @@ qDrawPlot::qDrawPlot(QWidget *parent,slsDetectorUtils*& detector):QWidget(parent } } +//------------------------------------------------------------------------------------------------------------------------------------------------- qDrawPlot::~qDrawPlot(){ /** Clear plot*/ @@ -78,11 +79,13 @@ qDrawPlot::~qDrawPlot(){ for(int i=0;iaddWidget(plot2D,1,1,1,1); } - - +//------------------------------------------------------------------------------------------------------------------------------------------------- void qDrawPlot::Initialization(){ connect(this, SIGNAL(InterpolateSignal(bool)),plot2D, SIGNAL(InterpolateSignal(bool))); @@ -173,8 +175,7 @@ void qDrawPlot::Initialization(){ } - - +//------------------------------------------------------------------------------------------------------------------------------------------------- void qDrawPlot::StartStopDaqToggle(bool stop_if_running){ static bool running = 1; @@ -187,8 +188,7 @@ void qDrawPlot::StartStopDaqToggle(bool stop_if_running){ } } - - +//------------------------------------------------------------------------------------------------------------------------------------------------- void qDrawPlot::StartDaq(bool start){ if(start){ @@ -216,9 +216,7 @@ void qDrawPlot::StartDaq(bool start){ } } - - - +//------------------------------------------------------------------------------------------------------------------------------------------------- int qDrawPlot::ResetDaqForGui(){ if(!StopDaqForGui()) return 0; @@ -226,11 +224,7 @@ int qDrawPlot::ResetDaqForGui(){ return 1; } - - - - - +//------------------------------------------------------------------------------------------------------------------------------------------------- bool qDrawPlot::StartOrStopThread(bool start){ static pthread_t gui_acquisition_thread; @@ -274,15 +268,14 @@ bool qDrawPlot::StartOrStopThread(bool start){ return gui_acquisition_thread_running; } - +//------------------------------------------------------------------------------------------------------------------------------------------------- void* qDrawPlot::DataStartAcquireThread(void *this_pointer){ ((qDrawPlot*)this_pointer)->myDet->acquire(1); return this_pointer; } - - +//------------------------------------------------------------------------------------------------------------------------------------------------- int qDrawPlot::GetDataCallBack(detectorData *data){ #ifdef VERYVERBOSE @@ -350,14 +343,13 @@ int qDrawPlot::GetDataCallBack(detectorData *data){ return 0; } - +//------------------------------------------------------------------------------------------------------------------------------------------------- void qDrawPlot::setNumMeasurements(int num){ numberOfMeasurements = num; } - - +//------------------------------------------------------------------------------------------------------------------------------------------------- void qDrawPlot::SelectPlot(int i){ //1 for 1D otherwise 2D if(i==1){ @@ -378,16 +370,14 @@ void qDrawPlot::SelectPlot(int i){ //1 for 1D otherwise 2D } } - - +//------------------------------------------------------------------------------------------------------------------------------------------------- void qDrawPlot::Clear1DPlot(){ for(QVector::iterator h = plot1D_hists.begin(); h!=plot1D_hists.end();h++) (*h)->Detach(plot1D); //clear plot } - - +//------------------------------------------------------------------------------------------------------------------------------------------------- void qDrawPlot::UpdatePlot(){ static int last_plot_number = 0; @@ -448,16 +438,13 @@ void qDrawPlot::UpdatePlot(){ } } - +//------------------------------------------------------------------------------------------------------------------------------------------------- void qDrawPlot::StopUpdatePlot(){ plot_update_timer->stop(); } - - -/**----------------------------CLONES-------------------------*/ - +//------------------------------------------------------------------------------------------------------------------------------------------------- void qDrawPlot::ClonePlot(){ int i=0; @@ -504,9 +491,10 @@ void qDrawPlot::ClonePlot(){ /** to remember which all clone widgets were closed*/ connect(winClone[i], SIGNAL(CloneClosedSignal(int)),this, SLOT(CloneCloseEvent(int))); - } +//------------------------------------------------------------------------------------------------------------------------------------------------- + void qDrawPlot::CloseClones(){ for(int i=0;iGetPlot()->DisableZoom(disable); } + +//-------------------------------------------------------------------------------------------------------------------------------------------------