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>
</widget>
</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">
<widget class="QLineEdit" name="dispFileName">
<property name="sizePolicy">
@ -874,6 +867,20 @@
</property>
</widget>
</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>
</widget>
</widget>

View File

@ -196,7 +196,7 @@
<rect>
<x>10</x>
<y>20</y>
<width>356</width>
<width>350</width>
<height>26</height>
</rect>
</property>
@ -218,23 +218,7 @@
</widget>
</item>
<item row="0" column="3">
<widget class="QCheckBox" name="checkBox">
<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">
<widget class="QCheckBox" name="chkPoints">
<property name="enabled">
<bool>true</bool>
</property>
@ -259,7 +243,7 @@
</property>
<property name="sizeHint" stdset="0">
<size>
<width>150</width>
<width>170</width>
<height>10</height>
</size>
</property>
@ -270,7 +254,7 @@
<widget class="QWidget" name="horizontalLayoutWidget_2">
<property name="geometry">
<rect>
<x>118</x>
<x>145</x>
<y>20</y>
<width>126</width>
<height>23</height>

View File

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

View File

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

View File

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

View File

@ -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);

View File

@ -78,6 +78,10 @@ void qTabMeasurement::SetupWidgetWindow(){
/** timing mode*/
SetupTimingMode();
/**file write enabled/disabled*/
myDet->enableWriteToFile(true);
//check if file enabled
}
@ -180,8 +184,10 @@ void qTabMeasurement::Initialization(int timingChange){
connect(btnStartStop, SIGNAL(clicked()), this, SLOT(startStopAcquisition()));
/** Timing Mode **/
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());
};
//-------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -169,6 +169,7 @@ void qTabPlot::Initialization(){
/** 1D Plot box*/
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)));