rate correction fixed for gui, removed auto made it defalt

This commit is contained in:
Dhanya Maliakal 2016-08-11 13:59:36 +02:00
parent cf74f9b138
commit 4c2d28943f
3 changed files with 253 additions and 272 deletions

View File

@ -87,25 +87,6 @@ Directory where one saves the data.
<property name="verticalSpacing"> <property name="verticalSpacing">
<number>4</number> <number>4</number>
</property> </property>
<item row="2" column="3">
<widget class="QPushButton" name="btnOutputBrowse">
<property name="toolTip">
<string>&lt;nobr&gt;
Directory where one saves the data.
&lt;/nobr&gt;&lt;br&gt;
#outdir#
&lt;br&gt;
</string>
</property>
<property name="text">
<string>Browse</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/browse.png</normaloff>:/icons/images/browse.png</iconset>
</property>
</widget>
</item>
<item row="1" column="2"> <item row="1" column="2">
<widget class="QLineEdit" name="dispReadOutputDir"> <widget class="QLineEdit" name="dispReadOutputDir">
<property name="focusPolicy"> <property name="focusPolicy">
@ -130,21 +111,6 @@ Directory where one saves the data.
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="2">
<widget class="QLineEdit" name="dispOutputDir">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Directory where one saves the data.
&lt;/nobr&gt;&lt;br&gt;
#outdir#
&lt;br&gt;
</string>
</property>
</widget>
</item>
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="lblDetector"> <widget class="QLabel" name="lblDetector">
<property name="sizePolicy"> <property name="sizePolicy">
@ -203,6 +169,21 @@ Directory where one saves the data.
</property> </property>
</widget> </widget>
</item> </item>
<item row="2" column="2">
<widget class="QLineEdit" name="dispOutputDir">
<property name="focusPolicy">
<enum>Qt::StrongFocus</enum>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Directory where one saves the data.
&lt;/nobr&gt;&lt;br&gt;
#outdir#
&lt;br&gt;
</string>
</property>
</widget>
</item>
<item row="0" column="2"> <item row="0" column="2">
<widget class="QComboBox" name="comboDetector"> <widget class="QComboBox" name="comboDetector">
<property name="sizePolicy"> <property name="sizePolicy">
@ -235,6 +216,25 @@ Directory where one saves the data.
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="2" column="3">
<widget class="QPushButton" name="btnOutputBrowse">
<property name="toolTip">
<string>&lt;nobr&gt;
Directory where one saves the data.
&lt;/nobr&gt;&lt;br&gt;
#outdir#
&lt;br&gt;
</string>
</property>
<property name="text">
<string>Browse</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/browse.png</normaloff>:/icons/images/browse.png</iconset>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</widget> </widget>
@ -320,24 +320,40 @@ Compression using Root. Available only for Gotthard in Expert Mode.
<x>255</x> <x>255</x>
<y>21</y> <y>21</y>
<width>476</width> <width>476</width>
<height>66</height> <height>76</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_2"> <layout class="QGridLayout" name="gridLayout_2">
<property name="verticalSpacing"> <property name="verticalSpacing">
<number>6</number> <number>6</number>
</property> </property>
<item row="1" column="2"> <item row="1" column="4">
<widget class="QRadioButton" name="radioAuto"> <spacer name="horizontalSpacer_2">
<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>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="chkRate">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
<property name="text"> <property name="text">
<string>Auto</string> <string>Rate:</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="6"> <item row="0" column="8">
<widget class="QPushButton" name="btnFlatField"> <widget class="QPushButton" name="btnFlatField">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@ -361,62 +377,7 @@ Compression using Root. Available only for Gotthard in Expert Mode.
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="0"> <item row="0" column="2" colspan="6">
<widget class="QCheckBox" name="chkFlatField">
<property name="toolTip">
<string>Flat field corrections.
#flatfield# filename</string>
</property>
<property name="text">
<string>Flat Field File:</string>
</property>
</widget>
</item>
<item row="1" column="4" colspan="3">
<widget class="QDoubleSpinBox" name="spinDeadTime">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="suffix">
<string> ns</string>
</property>
<property name="decimals">
<number>9</number>
</property>
<property name="minimum">
<double>-1.000000000000000</double>
</property>
<property name="maximum">
<double>2000000000.000000000000000</double>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QCheckBox" name="chkRate">
<property name="enabled">
<bool>false</bool>
</property>
<property name="text">
<string>Rate:</string>
</property>
</widget>
</item>
<item row="0" column="2" colspan="4">
<widget class="QLineEdit" name="dispFlatField"> <widget class="QLineEdit" name="dispFlatField">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
@ -430,13 +391,14 @@ Compression using Root. Available only for Gotthard in Expert Mode.
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="3"> <item row="0" column="0">
<widget class="QRadioButton" name="radioDeadTime"> <widget class="QCheckBox" name="chkFlatField">
<property name="enabled"> <property name="toolTip">
<bool>false</bool> <string>Flat field corrections.
#flatfield# filename</string>
</property> </property>
<property name="text"> <property name="text">
<string>Custom dead time:</string> <string>Flat Field File:</string>
</property> </property>
</widget> </widget>
</item> </item>
@ -456,6 +418,120 @@ Compression using Root. Available only for Gotthard in Expert Mode.
</property> </property>
</spacer> </spacer>
</item> </item>
<item row="1" column="5">
<widget class="QLabel" name="lblDeadTime">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="palette">
<palette>
<active>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>2</red>
<green>2</green>
<blue>2</blue>
</color>
</brush>
</colorrole>
</active>
<inactive>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>0</red>
<green>0</green>
<blue>0</blue>
</color>
</brush>
</colorrole>
</inactive>
<disabled>
<colorrole role="WindowText">
<brush brushstyle="SolidPattern">
<color alpha="255">
<red>119</red>
<green>119</green>
<blue>119</blue>
</color>
</brush>
</colorrole>
</disabled>
</palette>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Directory where one saves the data.
&lt;/nobr&gt;&lt;br&gt;
#outdir#
&lt;br&gt;
</string>
</property>
<property name="text">
<string>Dead Time:</string>
</property>
</widget>
</item>
<item row="1" column="6" colspan="3">
<widget class="QSpinBox" name="spinDeadTime">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="suffix">
<string>ns</string>
</property>
<property name="minimum">
<number>-1</number>
</property>
<property name="maximum">
<number>200000000</number>
</property>
</widget>
</item>
<item row="1" column="2" colspan="2">
<widget class="QPushButton" name="btnDefaultRate">
<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="maximumSize">
<size>
<width>16777215</width>
<height>30</height>
</size>
</property>
<property name="toolTip">
<string>&lt;nobr&gt;
Directory where one saves the data.
&lt;/nobr&gt;&lt;br&gt;
#outdir#
&lt;br&gt;
</string>
</property>
<property name="text">
<string>Default</string>
</property>
<property name="icon">
<iconset resource="../include/icons.qrc">
<normaloff>:/icons/images/calculate.png</normaloff>:/icons/images/calculate.png</iconset>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
<widget class="Line" name="line"> <widget class="Line" name="line">
@ -623,53 +699,10 @@ Compression using Root. Available only for Gotthard in Expert Mode.
</layout> </layout>
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="horizontalLayoutWidget_2">
<property name="geometry">
<rect>
<x>384</x>
<y>60</y>
<width>348</width>
<height>27</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QDoubleSpinBox" name="spinDeadTimeonly">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="suffix">
<string> ns</string>
</property>
<property name="decimals">
<number>9</number>
</property>
<property name="minimum">
<double>-1.000000000000000</double>
</property>
<property name="maximum">
<double>2000000000.000000000000000</double>
</property>
</widget>
</item>
</layout>
</widget>
</widget> </widget>
<zorder>boxOutDir</zorder>
<zorder>boxCorrection_2</zorder>
<zorder>btnOutputBrowse</zorder>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>dispReadOutputDir</tabstop> <tabstop>dispReadOutputDir</tabstop>
@ -677,9 +710,6 @@ Compression using Root. Available only for Gotthard in Expert Mode.
<tabstop>dispFlatField</tabstop> <tabstop>dispFlatField</tabstop>
<tabstop>btnFlatField</tabstop> <tabstop>btnFlatField</tabstop>
<tabstop>chkRate</tabstop> <tabstop>chkRate</tabstop>
<tabstop>radioAuto</tabstop>
<tabstop>radioDeadTime</tabstop>
<tabstop>spinDeadTime</tabstop>
</tabstops> </tabstops>
<resources> <resources>
<include location="../include/icons.qrc"/> <include location="../include/icons.qrc"/>

View File

@ -110,7 +110,10 @@ void UpdateFlatFieldFromServer();
void BrowseFlatFieldPath(); void BrowseFlatFieldPath();
/**rate correction*/ /**rate correction*/
void SetRateCorrection(); void SetRateCorrection(int deadtime=0);
/** default rate correction */
void SetDefaultRateCorrection();
/** update rate correction from server */ /** update rate correction from server */
void UpdateRateCorrectionFromServer(); void UpdateRateCorrectionFromServer();

View File

@ -46,7 +46,6 @@ void qTabDataOutput::SetupWidgetWindow(){
// Detector Type // Detector Type
detType=myDet->getDetectorsType(); detType=myDet->getDetectorsType();
widgetEiger->setVisible(false); widgetEiger->setVisible(false);
spinDeadTimeonly->setVisible(false);
//rate correction - not for charge integrating detectors //rate correction - not for charge integrating detectors
if((detType == slsDetectorDefs::MYTHEN)||(detType == slsDetectorDefs::EIGER)) if((detType == slsDetectorDefs::MYTHEN)||(detType == slsDetectorDefs::EIGER))
@ -56,12 +55,9 @@ void qTabDataOutput::SetupWidgetWindow(){
chkAngular->setEnabled(true); chkAngular->setEnabled(true);
if(detType == slsDetectorDefs::EIGER){ if(detType == slsDetectorDefs::EIGER){
chkRate->setEnabled(true);
chkTenGiga->setEnabled(true); chkTenGiga->setEnabled(true);
widgetEiger->setVisible(true); widgetEiger->setVisible(true);
spinDeadTimeonly->setVisible(true);
radioAuto->setVisible(false);
radioDeadTime->setVisible(false);
spinDeadTime->setVisible(false);
} }
/** error message **/ /** error message **/
@ -154,14 +150,10 @@ void qTabDataOutput::Initialization(){
connect(chkFlatField, SIGNAL(toggled(bool)), this, SLOT(SetFlatField())); connect(chkFlatField, SIGNAL(toggled(bool)), this, SLOT(SetFlatField()));
connect(btnFlatField, SIGNAL(clicked()), this, SLOT(BrowseFlatFieldPath())); connect(btnFlatField, SIGNAL(clicked()), this, SLOT(BrowseFlatFieldPath()));
//rate correction //rate correction
connect(chkRate, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection())); connect(chkRate, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection()));
if(detType == slsDetectorDefs::EIGER) connect(btnDefaultRate, SIGNAL(clicked()), this, SLOT(SetDefaultRateCorrection()));
connect(spinDeadTimeonly, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection())); connect(spinDeadTime, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection()));
else{
connect(radioAuto, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection()));
connect(radioDeadTime, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection()));
connect(spinDeadTime, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection()));
}
//angular correction //angular correction
connect(chkAngular, SIGNAL(toggled(bool)), this, SLOT(SetAngularCorrection())); connect(chkAngular, SIGNAL(toggled(bool)), this, SLOT(SetAngularCorrection()));
//discard bad channels //discard bad channels
@ -333,81 +325,69 @@ void qTabDataOutput::BrowseFlatFieldPath(){
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabDataOutput::SetRateCorrection(){ void qTabDataOutput::SetRateCorrection(int deadtime){
if(detType == slsDetectorDefs::EIGER) disconnect(btnDefaultRate, SIGNAL(clicked()), this, SLOT(SetDefaultRateCorrection()));
disconnect(spinDeadTimeonly, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection())); disconnect(spinDeadTime, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection()));
else{
disconnect(radioAuto, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection()));
disconnect(radioDeadTime, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection()));
disconnect(spinDeadTime, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection()));
}
#ifdef VERBOSE #ifdef VERBOSE
cout << "Entering Set Rate Correction function" << endl; cout << "Entering Set Rate Correction function" << endl;
#endif #endif
if(chkRate->isChecked()){ if(chkRate->isChecked()){
if(detType == slsDetectorDefs::EIGER){ if(!btnDefaultRate->isEnabled()){
spinDeadTimeonly->setEnabled(true); btnDefaultRate->setEnabled(true);
myDet->setRateCorrection((double)spinDeadTimeonly->value()); lblDeadTime->setEnabled(true);
spinDeadTime->setEnabled(true);
} }
else{
radioAuto->setEnabled(true); if(deadtime!=-1){
radioDeadTime->setEnabled(true); deadtime = (double)spinDeadTime->value();
//set auto as default if nothing selected
if(!radioAuto->isChecked()&&!radioDeadTime->isChecked())
radioAuto->setChecked(true);
//auto mode
if(radioAuto->isChecked()){
spinDeadTime->setEnabled(false);
myDet->setRateCorrection(-1);
#ifdef VERBOSE #ifdef VERBOSE
cout << "Setting rate corrections with default dead time" << endl; cout << "Setting rate corrections with custom dead time: " << deadtime << endl;
#endif #endif
} }else{;
//custom dead time
else{
spinDeadTime->setEnabled(true);
myDet->setRateCorrection((double)spinDeadTime->value());
#ifdef VERBOSE #ifdef VERBOSE
cout << "Setting rate corrections with dead time "<< spinDeadTime->value() << endl; cout << "Setting rate corrections with default dead time" << endl;
#endif #endif
}
} }
}//unsetting myDet->setRateCorrection(deadtime);
}//unsetting rate correction
else{ else{
if(detType == slsDetectorDefs::EIGER) btnDefaultRate->setEnabled(false);
spinDeadTimeonly->setEnabled(false); lblDeadTime->setEnabled(false);
else{ spinDeadTime->setEnabled(false);
radioAuto->setEnabled(false);
radioDeadTime->setEnabled(false);
spinDeadTime->setEnabled(false);
}
//Unsetting rate correction
myDet->setRateCorrection(0); myDet->setRateCorrection(0);
#ifdef VERBOSE #ifdef VERBOSE
cout << "Unsetting rate correction" << endl; cout << "Unsetting rate correction" << endl;
#endif #endif
} }
qDefs::checkErrorMessage(myDet,"qTabDataOutput::SetRateCorrection"); qDefs::checkErrorMessage(myDet,"qTabDataOutput::SetRateCorrection");
//update just the value //update just the value
double rate = (double)myDet->getRateCorrectionTau(); double rate = (double)myDet->getRateCorrectionTau();
if(spinDeadTime->isEnabled()) spinDeadTime->setValue((double)rate);
spinDeadTime->setValue((double)rate); if(rate == -1){
else if(spinDeadTimeonly->isEnabled()) qDefs::Message(qDefs::WARNING,"Dead time is inconsistent for all detectors. Returned Value: -1.","qTabDataOutput::UpdateRateCorrectionFromServer");
spinDeadTimeonly->setValue((double)rate); QString errorTip = QString("<nobr>Rate Corrections.</nobr><br>"
"<nobr> #ratecorr# tau in seconds</nobr><br><br>")+
QString("<nobr><font color=\"red\">"
if(detType == slsDetectorDefs::EIGER) "Dead time is inconsistent for all detectors.</font></nobr>");
connect(spinDeadTimeonly, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection())); chkRate->setToolTip(errorTip);
else{ spinDeadTime->setToolTip(errorTip);
connect(radioAuto, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection())); chkRate->setPalette(red);
connect(radioDeadTime, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection())); chkRate->setText("Rate:*");
connect(spinDeadTime, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection())); }else{
QString normalTip = QString("<nobr>Rate Corrections.</nobr><br>"
"<nobr> #ratecorr# tau in seconds</nobr><br><br>");
chkRate->setToolTip(normalTip);
spinDeadTime->setToolTip(normalTip);
chkRate->setPalette(chkDiscardBad->palette());
chkRate->setText("Rate:");
} }
connect(btnDefaultRate, SIGNAL(clicked()), this, SLOT(SetDefaultRateCorrection()));
connect(spinDeadTime, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection()));
} }
@ -415,94 +395,62 @@ void qTabDataOutput::SetRateCorrection(){
//------------------------------------------------------------------------------------------------------------------------------------------------- //-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabDataOutput::UpdateRateCorrectionFromServer(){ void qTabDataOutput::SetDefaultRateCorrection(){
disconnect(chkRate, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection())); SetRateCorrection(-1);
}
//-------------------------------------------------------------------------------------------------------------------------------------------------
void qTabDataOutput::UpdateRateCorrectionFromServer(){
disconnect(chkRate, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection()));
disconnect(btnDefaultRate, SIGNAL(clicked()), this, SLOT(SetDefaultRateCorrection()));
disconnect(spinDeadTime, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection()));
if(detType == slsDetectorDefs::EIGER)
disconnect(spinDeadTimeonly, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection()));
else{
disconnect(radioAuto, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection()));
disconnect(radioDeadTime, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection()));
disconnect(spinDeadTime, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection()));
}
double rate; double rate;
rate = (double)myDet->getRateCorrectionTau(); rate = (double)myDet->getRateCorrectionTau();
qDefs::checkErrorMessage(myDet,"qTabDataOutput::UpdateRateCorrectionFromServer"); qDefs::checkErrorMessage(myDet,"qTabDataOutput::UpdateRateCorrectionFromServer");
#ifdef VERBOSE #ifdef VERBOSE
cout << "Getting rate correction from server:" << rate << " : "; cout << "Getting rate correction from server: " << rate << endl;
#endif #endif
if(rate==0){ if(rate==0){
#ifdef VERBOSE
cout << "None" << endl;
#endif
chkRate->setChecked(false); chkRate->setChecked(false);
if(detType == slsDetectorDefs::EIGER) btnDefaultRate->setEnabled(false);
spinDeadTimeonly->setEnabled(false); lblDeadTime->setEnabled(false);
else{ spinDeadTime->setEnabled(false);
radioAuto->setEnabled(false);
radioDeadTime->setEnabled(false);
spinDeadTime->setEnabled(false);
}
} }
else{ else{
chkRate->setChecked(true); chkRate->setChecked(true);
btnDefaultRate->setEnabled(true);
if(detType == slsDetectorDefs::EIGER){ lblDeadTime->setEnabled(true);
spinDeadTimeonly->setEnabled(true); spinDeadTime->setEnabled(true);
spinDeadTimeonly->setValue((double)rate); spinDeadTime->setValue((double)rate);
}
//mythen
else{
radioAuto->setEnabled(true);
radioDeadTime->setEnabled(true);
chkRate->setChecked(true);
if(rate == -1){
#ifdef VERBOSE
cout << "Auto" << endl;
#endif
spinDeadTime->setEnabled(false);
radioAuto->setChecked(true);
}else{
#ifdef VERBOSE
cout << "Custom" << endl;
#endif
radioDeadTime->setChecked(true);
spinDeadTime->setEnabled(true);
spinDeadTime->setValue((double)rate);
}
}
} }
if(rate == -1){
if(detType == slsDetectorDefs::EIGER && rate == -1){
qDefs::Message(qDefs::WARNING,"Dead time is inconsistent for all detectors. Returned Value: -1.","qTabDataOutput::UpdateRateCorrectionFromServer"); qDefs::Message(qDefs::WARNING,"Dead time is inconsistent for all detectors. Returned Value: -1.","qTabDataOutput::UpdateRateCorrectionFromServer");
QString errorTip = QString("<nobr>Rate Corrections.</nobr><br>" QString errorTip = QString("<nobr>Rate Corrections.</nobr><br>"
"<nobr> #ratecorr# tau in seconds</nobr><br><br>")+ "<nobr> #ratecorr# tau in seconds</nobr><br><br>")+
QString("<nobr><font color=\"red\">" QString("<nobr><font color=\"red\">"
"Dead time is inconsistent for all detectors.</font></nobr>"); "Dead time is inconsistent for all detectors.</font></nobr>");
chkRate->setToolTip(errorTip); chkRate->setToolTip(errorTip);
spinDeadTimeonly->setToolTip(errorTip); spinDeadTime->setToolTip(errorTip);
chkRate->setPalette(red); chkRate->setPalette(red);
chkRate->setText("Rate:*"); chkRate->setText("Rate:*");
}else{ }else{
QString normalTip = QString("<nobr>Rate Corrections.</nobr><br>" QString normalTip = QString("<nobr>Rate Corrections.</nobr><br>"
"<nobr> #ratecorr# tau in seconds</nobr><br><br>"); "<nobr> #ratecorr# tau in seconds</nobr><br><br>");
chkRate->setToolTip(normalTip); chkRate->setToolTip(normalTip);
spinDeadTimeonly->setToolTip(normalTip); spinDeadTime->setToolTip(normalTip);
chkRate->setPalette(chkDiscardBad->palette()); chkRate->setPalette(chkDiscardBad->palette());
chkRate->setText("Rate:"); chkRate->setText("Rate:");
} }
connect(chkRate, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection())); connect(chkRate, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection()));
connect(btnDefaultRate, SIGNAL(clicked()), this, SLOT(SetDefaultRateCorrection()));
if(detType == slsDetectorDefs::EIGER) connect(spinDeadTime, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection()));
disconnect(spinDeadTimeonly, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection()));
else{
connect(radioAuto, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection()));
connect(radioDeadTime, SIGNAL(toggled(bool)), this, SLOT(SetRateCorrection()));
connect(spinDeadTime, SIGNAL(editingFinished()), this, SLOT(SetRateCorrection()));
}
} }