Skip to content

Commit

Permalink
Checkpointing work. Refs #6851.
Browse files Browse the repository at this point in the history
Modifications include
1. Set PreserveEvents' default to True;
2. set StripVanadiumPeaks's default to True;
3. Set RemovePromptPulseWidth's default to 50;
4. Remove all "override" buttons in run setup tab related to
corrections (not fully tested).
  • Loading branch information
wdzhou committed Apr 17, 2013
1 parent f1fc2bf commit b06c16e
Show file tree
Hide file tree
Showing 5 changed files with 142 additions and 180 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ class AdvancedSetupScript(BaseScriptElement):
unwrapref = ""
lowresref = ""
cropwavelengthmin = ""
removepropmppulsewidth = ""
removepropmppulsewidth = 50.0
maxchunksize = ""
filterbadpulses = True
stripvanadiumpeaks = False
stripvanadiumpeaks = True
vanadiumfwhm = ""
vanadiumpeaktol = ""
vanadiumsmoothparams = ""
preserveevents = False
preserveevents = True
extension = "_event.nxs"
outputfileprefix = ""

Expand Down Expand Up @@ -232,7 +232,7 @@ def reset(self):
"""
self.stripvanadiumpeaks = AdvancedSetupScript.stripvanadiumpeaks
self.extension = AdvancedSetupScript.extension
self.reserveevents = AdvancedSetupScript.preserveevents
self.preserveevents = AdvancedSetupScript.preserveevents

self.outputfileprefix = AdvancedSetupScript.outputfileprefix

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def initialize_content(self):
dv4 = QtGui.QDoubleValidator(self._content.removepromptwidth_edit)
dv4.setBottom(0.0)
self._content.removepromptwidth_edit.setValidator(dv4)
self._content.removepromptwidth_edit.setText("50.0")

dv5 = QtGui.QDoubleValidator(self._content.vanpeakfwhm_edit)
dv5.setBottom(0.0)
Expand All @@ -76,7 +77,7 @@ def initialize_content(self):
# Default states
self._content.extension_combo.setCurrentIndex(1)

self._content.stripvanpeaks_chkbox.setChecked(False)
self._content.stripvanpeaks_chkbox.setChecked(True)
self._content.vanpeakfwhm_edit.setEnabled(False)
self._content.vansmoothpar_edit.setEnabled(False)
self._content.vanpeaktol_edit.setEnabled(False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ def initialize_content(self):
self._content.disablevancorr_chkbox.setChecked(False)
self._content.disablevanbkgdcorr_chkbox.setChecked(False)

self._content.override_emptyrun_checkBox.setChecked(False)
self._content.override_vanrun_checkBox.setChecked(False)
self._content.override_vanbkgdrun_checkBox.setChecked(False)
#self._content.override_emptyrun_checkBox.setChecked(False)
#self._content.override_vanrun_checkBox.setChecked(False)
#self._content.override_vanbkgdrun_checkBox.setChecked(False)

# Line edit
self._content.emptyrun_edit.setEnabled(False)
self._content.vanrun_edit.setEnabled(False)
self._content.vanbkgdrun_edit.setEnabled(False)
self._content.emptyrun_edit.setEnabled(True)
self._content.vanrun_edit.setEnabled(True)
self._content.vanbkgdrun_edit.setEnabled(True)
self._content.resamplex_edit.setEnabled(False)

# Constraints/Validator
Expand Down Expand Up @@ -117,12 +117,12 @@ def initialize_content(self):
self.connect(self._content.bintype_combo, QtCore.SIGNAL("currentIndexChanged(QString)"),
self._bintype_process)

self.connect(self._content.override_emptyrun_checkBox, QtCore.SIGNAL("clicked()"),
self._overrideemptyrun_clicked)
self.connect(self._content.override_vanrun_checkBox, QtCore.SIGNAL("clicked()"),
self._overridevanrun_clicked)
self.connect(self._content.override_vanbkgdrun_checkBox, QtCore.SIGNAL("clicked()"),
self._overridevanbkgdrun_clicked)
#self.connect(self._content.override_emptyrun_checkBox, QtCore.SIGNAL("clicked()"),
# self._overrideemptyrun_clicked)
#self.connect(self._content.override_vanrun_checkBox, QtCore.SIGNAL("clicked()"),
# self._overridevanrun_clicked)
#self.connect(self._content.override_vanbkgdrun_checkBox, QtCore.SIGNAL("clicked()"),
# self._overridevanbkgdrun_clicked)

self.connect(self._content.disablebkgdcorr_chkbox, QtCore.SIGNAL("clicked()"),
self._disablebkgdcorr_clicked)
Expand Down Expand Up @@ -374,7 +374,9 @@ def _disablebkgdcorr_clicked(self):
if self._content.disablebkgdcorr_chkbox.isChecked() is True:
self._content.emptyrun_edit.setEnabled(False)
self._content.emptyrun_edit.setText("")
self._content.override_emptyrun_checkBox.setChecked(False)
#self._content.override_emptyrun_checkBox.setChecked(False)
else:
self._content.emptyrun_edit.setEnabled(True)

return

Expand All @@ -384,7 +386,9 @@ def _disablevancorr_clicked(self):
if self._content.disablevancorr_chkbox.isChecked() is True:
self._content.vanrun_edit.setEnabled(False)
self._content.vanrun_edit.setText("")
self._content.override_vanrun_checkBox.setChecked(False)
#self._content.override_vanrun_checkBox.setChecked(False)
else:
self._content.vanrun_edit.setEnabled(True)

return

Expand All @@ -394,7 +398,9 @@ def _disablevanbkgdcorr_clicked(self):
if self._content.disablevanbkgdcorr_chkbox.isChecked() is True:
self._content.vanbkgdrun_edit.setEnabled(False)
self._content.vanbkgdrun_edit.setText("")
self._content.override_vanbkgdrun_checkBox.setChecked(False)
#self._content.override_vanbkgdrun_checkBox.setChecked(False)
else:
self._content.vanbkgdrun_edit.setEnabled(True)

return

Expand Down
176 changes: 73 additions & 103 deletions Code/Mantid/scripts/Interface/ui/diffraction/diffraction_run_setup.ui
Original file line number Diff line number Diff line change
Expand Up @@ -724,40 +724,7 @@ The corrections can be overriden and disabled though.</string>
</item>
<item>
<layout class="QGridLayout" name="correction_gridlayout">
<item row="2" column="4">
<widget class="QCheckBox" name="disablevanbkgdcorr_chkbox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Disable vanadium background correction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Disable </string>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="vanbkgdrun_edit">
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enter vanadium background run number.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QCheckBox" name="override_vanrun_checkBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Override vanadium run given in characterization file.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Override</string>
</property>
</widget>
</item>
<item row="0" column="4">
<item row="0" column="3">
<widget class="QCheckBox" name="disablebkgdcorr_chkbox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Disable emptry/background correction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
Expand All @@ -773,55 +740,7 @@ The corrections can be overriden and disabled though.</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Empty (background) run to correct diffraction data. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Empty Run Correction</string>
</property>
</widget>
</item>
<item row="0" column="2">
<widget class="QCheckBox" name="override_emptyrun_checkBox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Override empty (background) run given in characterization file.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Override</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLineEdit" name="emptyrun_edit">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enter empty (background) run number.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="statusTip">
<string>Enter the detector distance offset in mm.</string>
</property>
</widget>
</item>
<item row="1" column="4">
<item row="1" column="3">
<widget class="QCheckBox" name="disablevancorr_chkbox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Disable vanadium correction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
Expand All @@ -834,23 +753,13 @@ The corrections can be overriden and disabled though.</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Vanadium run to correct diffraction data. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Vanadium Run Correction</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_11">
<item row="2" column="3">
<widget class="QCheckBox" name="disablevanbkgdcorr_chkbox">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Vanadium background run to correct diffraction data. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Disable vanadium background correction.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Vandium Background Run Correction</string>
<string>Disable </string>
</property>
</widget>
</item>
Expand Down Expand Up @@ -882,7 +791,7 @@ The corrections can be overriden and disabled though.</string>
</property>
</widget>
</item>
<item row="0" column="5">
<item row="0" column="4">
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
Expand All @@ -895,17 +804,65 @@ The corrections can be overriden and disabled though.</string>
</property>
</spacer>
</item>
<item row="2" column="2">
<widget class="QCheckBox" name="override_vanbkgdrun_checkBox">
<item row="0" column="1">
<widget class="QLineEdit" name="emptyrun_edit">
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enter empty (background) run number.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="statusTip">
<string>Enter the detector distance offset in mm.</string>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Override vanadium background run given in characterization file.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Empty (background) run to correct diffraction data. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Override</string>
<string>Empty Run Correction</string>
</property>
</widget>
</item>
<item row="0" column="3">
<item row="2" column="0">
<widget class="QLabel" name="label_11">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Vanadium background run to correct diffraction data. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Vandium Background Run Correction</string>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_10">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Vanadium run to correct diffraction data. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Vanadium Run Correction</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer_6">
<property name="orientation">
<enum>Qt::Horizontal</enum>
Expand All @@ -921,6 +878,19 @@ The corrections can be overriden and disabled though.</string>
</property>
</spacer>
</item>
<item row="2" column="1">
<widget class="QLineEdit" name="vanbkgdrun_edit">
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enter vanadium background run number.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
Expand Down

0 comments on commit b06c16e

Please sign in to comment.