-
Notifications
You must be signed in to change notification settings - Fork 0
/
depGUI.py
135 lines (107 loc) · 3.47 KB
/
depGUI.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
import sys
import spectools
import specGUI
import deptools
import depGUI
import matplotlib
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from matplotlib.backends.backend_qt5agg import (
FigureCanvasQTAgg,
NavigationToolbar2QT as NavigationToolbar
)
matplotlib.use('QtAgg')
plt.style.use('./au-uv.mplstyle')
plt.autoscale(False)
from pyqt_color_picker import ColorPickerDialog
from PyQt5.QtWidgets import (
QApplication,
QCheckBox,
QFormLayout,
QLineEdit,
QVBoxLayout,
QHBoxLayout,
QPushButton,
QListWidget,
QListWidgetItem,
QLabel,
QWidget,
QFileDialog,
QDoubleSpinBox,
QTabWidget,
QDialog
)
from PyQt5.QtGui import (
QPalette,
QColor
)
from PyQt5.QtCore import *
from PyQt5.Qt import (
QRect
)
class DepMplCanvas(FigureCanvasQTAgg):
def __init__(self, parent=None):
self.fig, self.axes = plt.subplots(1, 1)
self.fig.set_size_inches(16/2.5, 9/2.5)
self.axes.set_ylim(0, 1)
self.axes.set_xlim(0, 1)
super(DepMplCanvas, self).__init__(self.fig)
class depositionFittingTab():
def __init__(self):
self.outerLayout = QVBoxLayout()
# Create a layout for the plot and scan list
self.topLayout = QHBoxLayout()
# Create a layout for the plot
self.plotLayout = QVBoxLayout()
# Create a layout for the scan
self.scanLayout = QVBoxLayout()
# Create a layout for the buttons
self.bottomLayout = QHBoxLayout()
# ---------------------------
# Plot
# ---------------------------
self.sc = DepMplCanvas(self)
self.toolbar = NavigationToolbar(self.sc)
self.plotLayout.addWidget(self.toolbar)
self.plotLayout.addWidget(self.sc)
#self.sc.axes.plot([0,1,2,3,4], [10,1,20,3,40])
# ---------------------------
# Spectrum Menu
# ---------------------------
# button for adding a scan
self.add_scan_btn = QPushButton("Add Scan")
self.add_scan_btn.pressed.connect(self.add_scan)
#self.scanLayout.addWidget(self.add_scan_btn)
# display list of spectra
#self.speclist = QListWidget()
#self.listLayout.addWidget(self.speclist)
# ---------------------------
# Bottom Buttons
# ---------------------------
self.eb_clear = QPushButton("Clear Plot")
self.eb_clear.pressed.connect(self.clear_plot)
self.bottomLayout.addWidget(self.eb_clear)
self.eb_adata = QPushButton("Export Fit Parameters")
self.eb_adata.pressed.connect(self.export_adata)
self.bottomLayout.addWidget(self.eb_adata)
# ---------------------------
# Nest the inner layouts into the outer layout
# ---------------------------
self.topLayout.addLayout(self.plotLayout)
#self.topLayout.addLayout(self.scanLayout)
#self.topLayout.addWidget(self.add_scan_btn)
self.outerLayout.addLayout(self.topLayout)
self.outerLayout.addLayout(self.bottomLayout)
def add_scan(self):
"""
Add a timescan
"""
print("to be implimented")
def clear_plot(self):
print('clear plot is to be implemented')
def export_sdata(self):
print('export data is to be implemented')
def export_adata(self):
print('export data is to be implemented')
def remove_data(self):
print('remove data is to be implemented')