-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCallUI.py
executable file
·58 lines (49 loc) · 1.95 KB
/
CallUI.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
# CallUI.py
import sys
from PyQt5 import QtWidgets, uic
import plotting_tools
import applepy
Ui_MainWindow, QtBaseClass = uic.loadUiType("form.ui")
class CallUI(QtBaseClass, Ui_MainWindow):
def __init__(self):
QtBaseClass.__init__(self)
Ui_MainWindow.__init__(self)
self.dataframe = None
self.filename = None
self.figurecanvas = None
self.type = None
self.dataframe = None
self.setupUi(self)
self.connect_actions()
applepy.load_empty(self)
def connect_actions(self):
self.load_data_button.clicked.connect(lambda: applepy.load_data(self))
self.seperate_axes.clicked.connect(lambda: applepy.plot_selection(self))
self.selected_item.activated.connect(lambda: applepy.plot_selection(self))
self.selected_item_right.activated.connect(lambda: applepy.plot_selection(self))
self.export_button.clicked.connect(lambda: applepy.export_data(self))
def clear_layout(self, layout):
while layout.count():
child = layout.takeAt(0)
if child.widget():
child.widget().deleteLater()
def plot_figure(self, selection_left=None, selection_right=None, layout=None, title=None):
if title == None:
title = self.get_title()
if layout == None:
layout = self.graphlayout
self.clear_layout(layout)
self.figurecanvas = plotting_tools.plotGraphOnCanvas(self, layout,
title=title, scale="linear", selection_left=selection_left,
selection_right=selection_right)
def get_title(self):
if self.dataframe is None:
title = ""
else:
title = self.filename
return title
def setUpWindow():
app = QtWidgets.QApplication(sys.argv)
nowWindow = CallUI()
nowWindow.showMaximized()
sys.exit(app.exec_())