Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit a2d9fad

Browse files
spinbox for channel no - max is 512 (software lim)
1 parent e68f729 commit a2d9fad

2 files changed

Lines changed: 15 additions & 13 deletions

File tree

PythonGUI_apps/Lifetime_analysis/Lifetime_analysis_gui_layout.ui

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,27 +77,30 @@
7777
<string>Resolution (ns)</string>
7878
</property>
7979
</widget>
80-
<widget class="QComboBox" name="Channel_comboBox">
80+
<widget class="QComboBox" name="Res_comboBox">
8181
<property name="geometry">
8282
<rect>
83-
<x>140</x>
83+
<x>10</x>
8484
<y>60</y>
85-
<width>81</width>
85+
<width>101</width>
8686
<height>22</height>
8787
</rect>
8888
</property>
89+
<property name="acceptDrops">
90+
<bool>true</bool>
91+
</property>
8992
</widget>
90-
<widget class="QComboBox" name="Res_comboBox">
93+
<widget class="QSpinBox" name="Channel_spinBox">
9194
<property name="geometry">
9295
<rect>
93-
<x>10</x>
96+
<x>150</x>
9497
<y>60</y>
95-
<width>101</width>
96-
<height>22</height>
98+
<width>61</width>
99+
<height>21</height>
97100
</rect>
98101
</property>
99-
<property name="acceptDrops">
100-
<bool>true</bool>
102+
<property name="maximum">
103+
<number>512</number>
101104
</property>
102105
</widget>
103106
</widget>

PythonGUI_apps/Lifetime_analysis/Lifetime_plot_fit.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ def __init__(self):
5151
self.ui = WindowTemplate()
5252
self.ui.setupUi(self)
5353
self.ui.Res_comboBox.addItems(["0.004","0.008","0.016","0.032","0.064","0.128","0.256","0.512"])
54-
self.ui.Channel_comboBox.addItems(["0","1","2","3","4","5","6","7"])
5554
self.ui.FittingFunc_comboBox.addItems(["Stretched Exponential","Double Exponential", "Single Exponential"])
5655

5756
self.ui.actionOpen.triggered.connect(self.open_file)
@@ -90,7 +89,7 @@ def save_file(self):
9089

9190
def acquire_settings(self):
9291
resolution = float(self.ui.Res_comboBox.currentText())
93-
channel = int(self.ui.Channel_comboBox.currentText())
92+
channel = int(self.ui.Channel_spinBox.value())
9493
try:
9594
try:
9695
y = self.file[:,channel]
@@ -113,7 +112,7 @@ def plot(self):
113112
self.ui.plot.plot(x, y, clear=False, pen='r')
114113
try:
115114
self.ui.Result_textBrowser.setText("Integral Counts :\n" "{:.2E}".format(
116-
self.file.get_integral_counts(int(self.ui.Channel_comboBox.currentText()))))
115+
self.file.get_integral_counts(int(self.ui.Channel_spinBox.value()))))
117116
except:
118117
self.ui.Result_textBrowser.setText("Integral Counts :\n" "{:.2E}".format(np.sum(y)))
119118
except:
@@ -233,4 +232,4 @@ def run():
233232
return win
234233

235234
#Uncomment below if you want to run this as standalone
236-
#run()
235+
run()

0 commit comments

Comments
 (0)