-
Notifications
You must be signed in to change notification settings - Fork 0
/
FamilyGui.py
67 lines (57 loc) · 2.04 KB
/
FamilyGui.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import sys
from PySide import QtGui
class SimplePrev(QtGui.QWidget):
def __init__(self):
super(SimplePrev, self).__init__()
self.initUI()
def initUI(self):
self.orcafilepathdisp=QtGui.QLabel(self)
self.rootfilepathdisp=QtGui.QLabel(self)
self.channeldisp=QtGui.QLabel(self)
self.countdisp=QtGui.QLabel(self)
self.setchan=QtGui.QPushButton('choose channel')
self.setcount=QtGui.QPushButton('choose count')
self.rootifyButton=QtGui.QPushButton("rootify")
self.txtifyButton=QtGui.QPushButton("asciify") #include option to set averaging
self.numpyfyButton=QtGui.QPushButton("numpyfy")
self.previewButton=QtGui.QPushButton("preview")
self.fitButton=QtGui.QPushButton("fitDecay")
self.OrcaFileBrowseButton=QtGui.QPushButton("Browse")
self.RootFileBrowseButton=QtGui.QPushButton("Browse")
grid=QtGui.QGridLayout()
grid.setSpacing(10)
grid.addWidget(self.orcafilepathdisp, 1, 0, 1, 1)
grid.addWidget(self.rootfilepathdisp, 2, 0, 2, 1)
grid.addWidget(self.OrcaFileBrowseButton, 1, 2)
grid.addWidget(self.RootFileBrowseButton, 2, 2)
grid.addWidget(self.channeldisp, 4, 0)
grid.addWidget(self.countdisp, 5, 0)
grid.addWidget(self.setchan, 4, 2)
grid.addWidget(self.setcount, 5, 2)
grid.addWidget(self.rootifyButton, 1, 3)
grid.addWidget(self.txtifyButton, 1, 4)
grid.addWidget(self.numpyfyButton, 1, 5)
grid.addWidget(self.previewButton, 2, 3)
grid.addWidget(self.fitButton, 2, 4)
self.setLayout(grid)
self.show()
def chan(self):
self.chaner, ok=QtGui.QInputDialog.getText(self, '', 'choose channel')
if ok:
return int(self.chaner)
def count(self):
self.counter, ok=QtGui.QInputDialog.getText(self, '', 'choose count. Type All to choose all counts')
if ok:
if self.counter=='All' or 'all':
return self.counter
else:
return int(self.counter)
def FileyCyrus(self, startpath):
self.filey,_=QtGui.QFileDialog.getOpenFileName(self, 'Select file', startpath)
return self.filey
def main():
app=QtGui.QApplication(sys.argv)
ui=SimplePrev()
sys.exit(app.exec_())
if __name__=='__main__':
main()