diff --git a/slsDetectorGui/forms/form_tab_measurement.ui b/slsDetectorGui/forms/form_tab_measurement.ui index eb248c158..ea826ebb5 100644 --- a/slsDetectorGui/forms/form_tab_measurement.ui +++ b/slsDetectorGui/forms/form_tab_measurement.ui @@ -808,13 +808,6 @@ - - - - File Name: - - - @@ -874,6 +867,20 @@ + + + + <nobr>Sets output file name prefix</nobr><br> +<nobr>Check the box to enable write to file. </nobr> + + + File Name: + + + true + + + diff --git a/slsDetectorGui/forms/form_tab_plot.ui b/slsDetectorGui/forms/form_tab_plot.ui index 8925ef5f2..e26d249ef 100644 --- a/slsDetectorGui/forms/form_tab_plot.ui +++ b/slsDetectorGui/forms/form_tab_plot.ui @@ -196,7 +196,7 @@ 10 20 - 356 + 350 26 @@ -218,23 +218,7 @@ - - - true - - - - 0 - 0 - - - - Line - - - - - + true @@ -259,7 +243,7 @@ - 150 + 170 10 @@ -270,7 +254,7 @@ - 118 + 145 20 126 23 diff --git a/slsDetectorGui/include/qDrawPlot.h b/slsDetectorGui/include/qDrawPlot.h index 4d975071f..59d7ea7b3 100644 --- a/slsDetectorGui/include/qDrawPlot.h +++ b/slsDetectorGui/include/qDrawPlot.h @@ -201,6 +201,8 @@ private: int progress; /**If plot is enabled from plot tab*/ bool plotEnable; + /**If plot is dotted */ + bool plotDotted; /**if an acquisition is running, so as not to refresh tab @@ -282,7 +284,8 @@ void CloseClones(); void SavePlot(); /** Sets persistency from plot tab */ void SetPersistency(int val); - +/** sets style of plot to dotted */ +void SetDottedPlot(bool enable){plotDotted = enable;}; private slots: diff --git a/slsDetectorGui/include/qTabMeasurement.h b/slsDetectorGui/include/qTabMeasurement.h index 7cd823947..e2322c31a 100644 --- a/slsDetectorGui/include/qTabMeasurement.h +++ b/slsDetectorGui/include/qTabMeasurement.h @@ -158,6 +158,10 @@ void setNumProbes(int val); /** Update progress*/ void UpdateProgress(); +/** Enable write to file */ +void EnableFileWrite(bool enable); + + signals: void StartSignal(); diff --git a/slsDetectorGui/slsDetectorPlotting/include/SlsQt1DPlot.h b/slsDetectorGui/slsDetectorPlotting/include/SlsQt1DPlot.h index ffd7b65c5..c1af10d47 100644 --- a/slsDetectorGui/slsDetectorPlotting/include/SlsQt1DPlot.h +++ b/slsDetectorGui/slsDetectorPlotting/include/SlsQt1DPlot.h @@ -8,6 +8,8 @@ * DisableZoom, * SetXMinMax,SetYMinMax, * GetXMinimum,GetXMaximum,GetYMinimum,GetYMaximum} + * 07.08.2012:{function to change lines, points etc } + * SetDotStyle * */ #ifndef SLSQT1DPLOT_H @@ -60,6 +62,9 @@ class SlsQtH1D:public QwtPlotCurve{ SlsQtH1D* Add(double v); + /** Added by Dhanya to change style of graph*/ + void SetDotStyle(bool enable){if(enable) setStyle(QwtPlotCurve::Dots); else setStyle(QwtPlotCurve::Lines);}; + /**---*/ private: int ndata; diff --git a/slsDetectorGui/src/qDrawPlot.cpp b/slsDetectorGui/src/qDrawPlot.cpp index 55acabb09..ea7ee7f14 100644 --- a/slsDetectorGui/src/qDrawPlot.cpp +++ b/slsDetectorGui/src/qDrawPlot.cpp @@ -76,6 +76,7 @@ void qDrawPlot::SetupWidgetWindow(){ currentPersistency = 0; progress = 0; plotEnable=true; + plotDotted = false; XYRangeChanged = false; timerValue = PLOT_TIMER_MS; frameFactor=0; @@ -483,6 +484,7 @@ void qDrawPlot::UpdatePlot(){ }else{ h=plot1D_hists.at(hist_num); h->SetData(histNBins,histXAxis,GetHistYAxis(hist_num)); + h->SetDotStyle(plotDotted); } h->setTitle(GetHistTitle(hist_num)); h->Attach(plot1D); diff --git a/slsDetectorGui/src/qTabMeasurement.cpp b/slsDetectorGui/src/qTabMeasurement.cpp index 1e2f73dcb..151d2c4f5 100644 --- a/slsDetectorGui/src/qTabMeasurement.cpp +++ b/slsDetectorGui/src/qTabMeasurement.cpp @@ -78,6 +78,10 @@ void qTabMeasurement::SetupWidgetWindow(){ /** timing mode*/ SetupTimingMode(); + + /**file write enabled/disabled*/ + myDet->enableWriteToFile(true); + //check if file enabled } @@ -171,17 +175,19 @@ void qTabMeasurement::Initialization(int timingChange){ /** These signals are connected only at start up. The others are reinitialized when changing timing mode*/ if(!timingChange){ /** Number of Measurements**/ - connect(spinNumMeasurements,SIGNAL(valueChanged(int)), this, SLOT(setNumMeasurements(int))); + connect(spinNumMeasurements,SIGNAL(valueChanged(int)), this, SLOT(setNumMeasurements(int))); /** File Name**/ - connect(dispFileName,SIGNAL(textChanged(const QString&)), this, SLOT(setFileName(const QString&))); + connect(dispFileName, SIGNAL(textChanged(const QString&)),this, SLOT(setFileName(const QString&))); /** File Index**/ - connect(spinIndex,SIGNAL(valueChanged(int)), this, SLOT(setRunIndex(int))); + connect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(setRunIndex(int))); /** Start/Stop Acquisition**/ - connect(btnStartStop,SIGNAL(clicked()), this, SLOT(startStopAcquisition())); + connect(btnStartStop, SIGNAL(clicked()), this, SLOT(startStopAcquisition())); /** Timing Mode **/ - connect(comboTimingMode,SIGNAL(currentIndexChanged(int)), this, SLOT(setTimingMode(int)));// - - connect(progressTimer, SIGNAL(timeout()), this, SLOT(UpdateProgress())); + connect(comboTimingMode, SIGNAL(currentIndexChanged(int)), this, SLOT(setTimingMode(int)));// + /** progress bar */ + connect(progressTimer, SIGNAL(timeout()), this, SLOT(UpdateProgress())); + /** enable write to file */ + connect(chkFile, SIGNAL(toggled(bool)), this, SLOT(EnableFileWrite(bool))); } /** Number of Frames**/ connect(spinNumFrames,SIGNAL(valueChanged(int)), this, SLOT(setNumFrames(int))); @@ -660,6 +666,14 @@ void qTabMeasurement::setTimingMode(int mode){ return; } +void qTabMeasurement::EnableFileWrite(bool enable){ +#ifdef VERBOSE + cout << "Enable File Write:" << enable << endl; +#endif + myDet->enableWriteToFile(enable); + dispFileName->setEnabled(enable); + if(enable) setFileName(dispFileName->text()); +}; //------------------------------------------------------------------------------------------------------------------------------------------------- diff --git a/slsDetectorGui/src/qTabPlot.cpp b/slsDetectorGui/src/qTabPlot.cpp index 97f138418..0719ef2c6 100644 --- a/slsDetectorGui/src/qTabPlot.cpp +++ b/slsDetectorGui/src/qTabPlot.cpp @@ -167,8 +167,9 @@ void qTabPlot::Initialization(){ connect(btnClone, SIGNAL(clicked()),myPlot, SLOT(ClonePlot())); connect(btnCloseClones, SIGNAL(clicked()),myPlot, SLOT(CloseClones())); /** 1D Plot box*/ - connect(chkSuperimpose, SIGNAL(toggled(bool)),this, SLOT(EnablePersistency(bool))); - connect(spinPersistency,SIGNAL(valueChanged(int)),myPlot,SLOT(SetPersistency(int))); + connect(chkSuperimpose, SIGNAL(toggled(bool)), this, SLOT(EnablePersistency(bool))); + connect(spinPersistency,SIGNAL(valueChanged(int)), myPlot,SLOT(SetPersistency(int))); + connect(chkPoints, SIGNAL(toggled(bool)), myPlot, SLOT(SetDottedPlot(bool))); /** 2D Plot box*/ connect(chkInterpolate, SIGNAL(toggled(bool)),myPlot, SIGNAL(InterpolateSignal(bool))); connect(chkContour, SIGNAL(toggled(bool)),myPlot, SIGNAL(ContourSignal(bool)));