gap pixels included in gui

This commit is contained in:
maliakal_d 2018-04-09 11:13:20 +02:00
parent 649cb0aed9
commit 9847729f3c
3 changed files with 83 additions and 9 deletions

View File

@ -99,7 +99,7 @@
</rect>
</property>
<property name="currentIndex">
<number>0</number>
<number>4</number>
</property>
<widget class="QWidget" name="page_6">
<widget class="QWidget" name="gridLayoutWidget_5">
@ -548,7 +548,7 @@
<rect>
<x>25</x>
<y>5</y>
<width>314</width>
<width>335</width>
<height>26</height>
</rect>
</property>
@ -587,7 +587,7 @@ Displays minimum, maximum and sum of values for each plot.
</property>
<property name="sizeHint" stdset="0">
<size>
<width>100</width>
<width>10</width>
<height>10</height>
</size>
</property>
@ -596,7 +596,7 @@ Displays minimum, maximum and sum of values for each plot.
<item>
<widget class="QCheckBox" name="chkGainPlot">
<property name="enabled">
<bool>true</bool>
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -614,6 +614,43 @@ Displays minimum, maximum and sum of values for each plot.
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_22">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>10</width>
<height>10</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="chkGapPixels">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Displays minimum, maximum and sum of values for each plot.
&lt;nobr&gt;</string>
</property>
<property name="text">
<string>Gap Pixels</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
@ -1695,7 +1732,7 @@ Displays minimum, maximum and sum of values for each plot.
<rect>
<x>10</x>
<y>20</y>
<width>331</width>
<width>357</width>
<height>26</height>
</rect>
</property>
@ -2522,7 +2559,7 @@ Interval between plots has 2 modes. A condition to be satisfied, in order to avo
<rect>
<x>10</x>
<y>12</y>
<width>331</width>
<width>365</width>
<height>36</height>
</rect>
</property>

View File

@ -174,6 +174,9 @@ private slots:
/** Set histogram options */
void SetHistogramOptions();
/** Enable Gap pixels */
void EnableGapPixels(bool enable);
signals:
void DisableZoomSignal(bool);
void ResetZMinZMaxSignal(bool,bool,double,double);

View File

@ -156,9 +156,6 @@ void qTabPlot::SetupWidgetWindow(){
stackedWidget->setCurrentIndex(0);
stackedWidget_2->setCurrentIndex(0);
//gain plot
chkGainPlot->setEnabled(false);
// Depending on whether the detector is 1d or 2d
switch(myDet->getDetectorsType()){
case slsDetectorDefs::MYTHEN:
@ -174,6 +171,7 @@ void qTabPlot::SetupWidgetWindow(){
pagePedestal_2->setEnabled(false);
chkBinary->setEnabled(false);
chkBinary_2->setEnabled(false);
chkGapPixels->setEnabled(true);
break;
case slsDetectorDefs::GOTTHARD:
isOriginallyOneD = true;
@ -202,6 +200,12 @@ void qTabPlot::SetupWidgetWindow(){
//disable histogram initially
boxHistogram->hide();
if (chkGapPixels->isEnabled()) {
int ret = myDet->enableGapPixels(-1);
qDefs::checkErrorMessage(myDet,"qTabPlot::SetupWidgetWindow");
chkGapPixels->setChecked((ret == 1) ? true : false);
}
qDefs::checkErrorMessage(myDet,"qTabPlot::SetupWidgetWindow");
}
@ -376,6 +380,10 @@ void qTabPlot::Initialization(){
//gainplot
if (chkGainPlot->isEnabled())
connect(chkGainPlot, SIGNAL(toggled(bool)),myPlot, SIGNAL(GainPlotSignal(bool)));
// gap pixels
if (chkGapPixels->isEnabled())
connect(chkGapPixels, SIGNAL(toggled(bool)),this, SLOT(EnableGapPixels(bool)));
}
@ -1471,6 +1479,24 @@ void qTabPlot::SetHistogramOptions(){
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabPlot::EnableGapPixels(bool enable) {
#ifdef VERBOSE
cout << "Setting Gap pixels to " << enable << endl;
#endif
disconnect(chkGapPixels, SIGNAL(toggled(bool)),this, SLOT(EnableGapPixels(bool)));
myDet->enableGapPixels(enable);
int ret = myDet->enableGapPixels(-1);
qDefs::checkErrorMessage(myDet,"qTabPlot::SetScanArgument");
chkGapPixels->setChecked((ret == 1) ? true : false);
connect(chkGapPixels, SIGNAL(toggled(bool)),this, SLOT(EnableGapPixels(bool)));
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
@ -1487,6 +1513,14 @@ void qTabPlot::Refresh(){
comboFrequency->setCurrentIndex(1);*/
SetFrequency();
if (chkGapPixels->isEnabled()) {
disconnect(chkGapPixels, SIGNAL(toggled(bool)),this, SLOT(EnableGapPixels(bool)));
int ret = myDet->enableGapPixels(-1);
qDefs::checkErrorMessage(myDet,"qTabPlot::Refresh");
chkGapPixels->setChecked((ret == 1) ? true : false);
connect(chkGapPixels, SIGNAL(toggled(bool)),this, SLOT(EnableGapPixels(bool)));
}
}else{
boxFrequency->setEnabled(false);
disconnect(boxScan, SIGNAL(toggled(bool)), this, SLOT(EnableScanBox()));