Skip to content

Commit

Permalink
deadtime_entry for the sf_calculator
Browse files Browse the repository at this point in the history
Signed-off-by: Jose Borreguero <[email protected]>
  • Loading branch information
jmborr committed Apr 27, 2024
1 parent 125bc2d commit f85a7a4
Show file tree
Hide file tree
Showing 4 changed files with 160 additions and 87 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@ def __init__(self, parent: QWidget):
self.ui = load_ui(ui_filename="deadtime_settings.ui", baseinstance=self)
self.options = self.get_state_from_form()

def set_state(self, apply_correction, paralyzable, dead_time, tof_step):
def set_state(self, paralyzable, dead_time, tof_step):
"""
Store options and populate the form
:param apply_correction: If True, dead time correction will be applied
:param paralyzable: If True, a paralyzable correction will be used
:param dead_time: Value of the dead time in micro second
:param tof_step: TOF binning in micro second
"""
self.ui.apply_correction.setChecked(apply_correction)
self.ui.use_paralyzable.setChecked(paralyzable)
self.ui.dead_time_value.setValue(dead_time)
self.ui.dead_time_tof.setValue(tof_step)
Expand All @@ -32,7 +31,6 @@ def get_state_from_form(self):
Read the options from the form.
"""
options = {}
options['apply_correction'] = self.ui.apply_correction.isChecked()
options['paralyzable'] = self.ui.use_paralyzable.isChecked()
options['dead_time'] = self.ui.dead_time_value.value()
options['tof_step'] = self.ui.dead_time_tof.value()
Expand Down
76 changes: 22 additions & 54 deletions RefRed/interfaces/deadtime_settings.ui
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,22 @@
<rect>
<x>0</x>
<y>0</y>
<width>472</width>
<height>214</height>
<width>428</width>
<height>150</height>
</rect>
</property>
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="maximumSize">
<size>
<width>439</width>
<height>150</height>
</size>
</property>
<property name="windowTitle">
<string>Dead Time Settings</string>
</property>
Expand All @@ -22,43 +34,6 @@
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="apply_correction">
<property name="text">
<string/>
</property>
<property name="checked">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enable/Disable background subtraction&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Apply dead time correction</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
Expand All @@ -73,6 +48,12 @@
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" 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;Use two background regions to estimate the background under the peak&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
Expand Down Expand Up @@ -183,8 +164,8 @@
</property>
<property name="maximumSize">
<size>
<width>130</width>
<height>16777215</height>
<width>0</width>
<height>100</height>
</size>
</property>
<property name="decimals">
Expand All @@ -203,19 +184,6 @@
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
Expand Down
Loading

0 comments on commit f85a7a4

Please sign in to comment.