included checkbox for enable file write

git-svn-id: file:///afs/psi.ch/project/sls_det_software/svn/slsDetectorGui@25 af1100a4-978c-4157-bff7-07162d2ba061
This commit is contained in:
l_maliakal_d 2012-08-07 12:20:50 +00:00
parent bcb4710477
commit 72c52de2fe
8 changed files with 57 additions and 37 deletions

View File

@ -808,13 +808,6 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QLabel" name="label_7">
<property name="text">
<string>File Name:</string>
</property>
</widget>
</item>
<item row="1" column="1" colspan="2"> <item row="1" column="1" colspan="2">
<widget class="QLineEdit" name="dispFileName"> <widget class="QLineEdit" name="dispFileName">
<property name="sizePolicy"> <property name="sizePolicy">
@ -874,6 +867,20 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QCheckBox" name="chkFile">
<property name="toolTip">
<string>&lt;nobr&gt;Sets output file name prefix&lt;/nobr&gt;&lt;br&gt;
&lt;nobr&gt;Check the box to enable write to file. &lt;/nobr&gt;</string>
</property>
<property name="text">
<string>File Name:</string>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>

View File

@ -196,7 +196,7 @@
<rect> <rect>
<x>10</x> <x>10</x>
<y>20</y> <y>20</y>
<width>356</width> <width>350</width>
<height>26</height> <height>26</height>
</rect> </rect>
</property> </property>
@ -218,23 +218,7 @@
</widget> </widget>
</item> </item>
<item row="0" column="3"> <item row="0" column="3">
<widget class="QCheckBox" name="checkBox"> <widget class="QCheckBox" name="chkPoints">
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Line</string>
</property>
</widget>
</item>
<item row="0" column="4">
<widget class="QCheckBox" name="checkBox_2">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>true</bool>
</property> </property>
@ -259,7 +243,7 @@
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>150</width> <width>170</width>
<height>10</height> <height>10</height>
</size> </size>
</property> </property>
@ -270,7 +254,7 @@
<widget class="QWidget" name="horizontalLayoutWidget_2"> <widget class="QWidget" name="horizontalLayoutWidget_2">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>118</x> <x>145</x>
<y>20</y> <y>20</y>
<width>126</width> <width>126</width>
<height>23</height> <height>23</height>

View File

@ -201,6 +201,8 @@ private:
int progress; int progress;
/**If plot is enabled from plot tab*/ /**If plot is enabled from plot tab*/
bool plotEnable; bool plotEnable;
/**If plot is dotted */
bool plotDotted;
/**if an acquisition is running, so as not to refresh tab /**if an acquisition is running, so as not to refresh tab
@ -282,7 +284,8 @@ void CloseClones();
void SavePlot(); void SavePlot();
/** Sets persistency from plot tab */ /** Sets persistency from plot tab */
void SetPersistency(int val); void SetPersistency(int val);
/** sets style of plot to dotted */
void SetDottedPlot(bool enable){plotDotted = enable;};
private slots: private slots:

View File

@ -158,6 +158,10 @@ void setNumProbes(int val);
/** Update progress*/ /** Update progress*/
void UpdateProgress(); void UpdateProgress();
/** Enable write to file */
void EnableFileWrite(bool enable);
signals: signals:
void StartSignal(); void StartSignal();

View File

@ -8,6 +8,8 @@
* DisableZoom, * DisableZoom,
* SetXMinMax,SetYMinMax, * SetXMinMax,SetYMinMax,
* GetXMinimum,GetXMaximum,GetYMinimum,GetYMaximum} * GetXMinimum,GetXMaximum,GetYMinimum,GetYMaximum}
* 07.08.2012:{function to change lines, points etc }
* SetDotStyle
* */ * */
#ifndef SLSQT1DPLOT_H #ifndef SLSQT1DPLOT_H
@ -60,6 +62,9 @@ class SlsQtH1D:public QwtPlotCurve{
SlsQtH1D* Add(double v); 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: private:
int ndata; int ndata;

View File

@ -76,6 +76,7 @@ void qDrawPlot::SetupWidgetWindow(){
currentPersistency = 0; currentPersistency = 0;
progress = 0; progress = 0;
plotEnable=true; plotEnable=true;
plotDotted = false;
XYRangeChanged = false; XYRangeChanged = false;
timerValue = PLOT_TIMER_MS; timerValue = PLOT_TIMER_MS;
frameFactor=0; frameFactor=0;
@ -483,6 +484,7 @@ void qDrawPlot::UpdatePlot(){
}else{ }else{
h=plot1D_hists.at(hist_num); h=plot1D_hists.at(hist_num);
h->SetData(histNBins,histXAxis,GetHistYAxis(hist_num)); h->SetData(histNBins,histXAxis,GetHistYAxis(hist_num));
h->SetDotStyle(plotDotted);
} }
h->setTitle(GetHistTitle(hist_num)); h->setTitle(GetHistTitle(hist_num));
h->Attach(plot1D); h->Attach(plot1D);

View File

@ -78,6 +78,10 @@ void qTabMeasurement::SetupWidgetWindow(){
/** timing mode*/ /** timing mode*/
SetupTimingMode(); 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*/ /** These signals are connected only at start up. The others are reinitialized when changing timing mode*/
if(!timingChange){ if(!timingChange){
/** Number of Measurements**/ /** Number of Measurements**/
connect(spinNumMeasurements,SIGNAL(valueChanged(int)), this, SLOT(setNumMeasurements(int))); connect(spinNumMeasurements,SIGNAL(valueChanged(int)), this, SLOT(setNumMeasurements(int)));
/** File Name**/ /** 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**/ /** File Index**/
connect(spinIndex,SIGNAL(valueChanged(int)), this, SLOT(setRunIndex(int))); connect(spinIndex, SIGNAL(valueChanged(int)), this, SLOT(setRunIndex(int)));
/** Start/Stop Acquisition**/ /** Start/Stop Acquisition**/
connect(btnStartStop,SIGNAL(clicked()), this, SLOT(startStopAcquisition())); connect(btnStartStop, SIGNAL(clicked()), this, SLOT(startStopAcquisition()));
/** Timing Mode **/ /** Timing Mode **/
connect(comboTimingMode,SIGNAL(currentIndexChanged(int)), this, SLOT(setTimingMode(int)));// connect(comboTimingMode, SIGNAL(currentIndexChanged(int)), this, SLOT(setTimingMode(int)));//
/** progress bar */
connect(progressTimer, SIGNAL(timeout()), this, SLOT(UpdateProgress())); connect(progressTimer, SIGNAL(timeout()), this, SLOT(UpdateProgress()));
/** enable write to file */
connect(chkFile, SIGNAL(toggled(bool)), this, SLOT(EnableFileWrite(bool)));
} }
/** Number of Frames**/ /** Number of Frames**/
connect(spinNumFrames,SIGNAL(valueChanged(int)), this, SLOT(setNumFrames(int))); connect(spinNumFrames,SIGNAL(valueChanged(int)), this, SLOT(setNumFrames(int)));
@ -660,6 +666,14 @@ void qTabMeasurement::setTimingMode(int mode){
return; 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());
};
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -167,8 +167,9 @@ void qTabPlot::Initialization(){
connect(btnClone, SIGNAL(clicked()),myPlot, SLOT(ClonePlot())); connect(btnClone, SIGNAL(clicked()),myPlot, SLOT(ClonePlot()));
connect(btnCloseClones, SIGNAL(clicked()),myPlot, SLOT(CloseClones())); connect(btnCloseClones, SIGNAL(clicked()),myPlot, SLOT(CloseClones()));
/** 1D Plot box*/ /** 1D Plot box*/
connect(chkSuperimpose, SIGNAL(toggled(bool)),this, SLOT(EnablePersistency(bool))); connect(chkSuperimpose, SIGNAL(toggled(bool)), this, SLOT(EnablePersistency(bool)));
connect(spinPersistency,SIGNAL(valueChanged(int)),myPlot,SLOT(SetPersistency(int))); connect(spinPersistency,SIGNAL(valueChanged(int)), myPlot,SLOT(SetPersistency(int)));
connect(chkPoints, SIGNAL(toggled(bool)), myPlot, SLOT(SetDottedPlot(bool)));
/** 2D Plot box*/ /** 2D Plot box*/
connect(chkInterpolate, SIGNAL(toggled(bool)),myPlot, SIGNAL(InterpolateSignal(bool))); connect(chkInterpolate, SIGNAL(toggled(bool)),myPlot, SIGNAL(InterpolateSignal(bool)));
connect(chkContour, SIGNAL(toggled(bool)),myPlot, SIGNAL(ContourSignal(bool))); connect(chkContour, SIGNAL(toggled(bool)),myPlot, SIGNAL(ContourSignal(bool)));