-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathQtSCALCS.py
More file actions
77 lines (65 loc) · 2.33 KB
/
QtSCALCS.py
File metadata and controls
77 lines (65 loc) · 2.33 KB
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
68
69
70
71
72
73
74
75
76
#! /usr/bin/env python
"""
A Qt based GUI to display properties of ion channels as described in Colquhoun & Hawkes 1977.
"""
import sys
try:
from PyQt5.QtWidgets import *
except:
raise ImportError("pyqt module is missing")
from samples import samples
from gui.plotwindow import MatPlotWin
from gui.plotwindow import MatPlotTools
from gui.mechmenu import MechMenu
from gui.savemenu import SaveMenu
from gui.helpmenu import HelpMenu
import gui.myqtcommon as myqtcommon
from gui.burstmenu import BurstMenu
from gui.jumpmenu import JumpMenu
from gui.scalcsmenu import ScalcsMenu
class QMatGUI(QMainWindow):
def __init__(self, parent=None):
super(QMatGUI, self).__init__(parent)
self.resize(1000, 700) # wide, high in px
self.mainFrame = QWidget()
self.setWindowTitle("DC_PyPs: " +
"SCALCS- calculate dwell time distributions etc from Q-matrix...")
self.path = ""
self.mec = samples.CH82()
self.mec.KBlk = 0.01
self.mec.fastblk = False
self.conc = 100e-9 # 100 nM
self.tres = 0.0001
self.present_plot = None
# Prepare menu
self.menuBar().addMenu(MechMenu(self))
self.menuBar().addMenu(ScalcsMenu(self))
self.menuBar().addMenu(BurstMenu(self))
self.menuBar().addMenu(JumpMenu(self))
self.menuBar().addMenu(SaveMenu(self))
self.menuBar().addMenu(HelpMenu(self))
# Prepare text box for printout and set where printout goes
self.textBox = QTextBrowser()
self.log = myqtcommon.PrintLog(self.textBox) #, sys.stdout)
myqtcommon.startInfo(self.log)
# Prepare text box for plot legend
self.txtPltBox = QTextBrowser()
# Prepare plot window
self.canvas = MatPlotWin()
canvastools = MatPlotTools(self.canvas, self)
leftVBox = QVBoxLayout()
leftVBox.addWidget(self.txtPltBox)
leftVBox.addWidget(self.canvas)
leftVBox.addWidget(canvastools)
rightVBox = QVBoxLayout()
rightVBox.addWidget(self.textBox)
HBox = QHBoxLayout()
HBox.addLayout(leftVBox)
HBox.addLayout(rightVBox)
self.mainFrame.setLayout(HBox)
self.setCentralWidget(self.mainFrame)
if __name__ == "__main__":
app = QApplication(sys.argv)
form = QMatGUI()
form.show()
app.exec_()