forked from Ayamachii/Realtime-Digital-Filter-Designer-Suite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui.py
275 lines (269 loc) · 16 KB
/
ui.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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
# Form implementation generated from reading ui file 'UI.ui'
#
# Created by: PyQt6 UI code generator 6.5.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic6 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt6 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1257, 767)
self.centralwidget = QtWidgets.QWidget(parent=MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
self.verticalLayout_8 = QtWidgets.QVBoxLayout()
self.verticalLayout_8.setObjectName("verticalLayout_8")
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.verticalLayout_3 = QtWidgets.QVBoxLayout()
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.horizontalLayout_5.addLayout(self.verticalLayout)
self.verticalLayout_7 = QtWidgets.QVBoxLayout()
self.verticalLayout_7.setObjectName("verticalLayout_7")
self.horizontalLayout_5.addLayout(self.verticalLayout_7)
self.verticalLayout_3.addLayout(self.horizontalLayout_5)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.comboBox_pole_zero = QtWidgets.QComboBox(parent=self.centralwidget)
self.comboBox_pole_zero.setObjectName("comboBox_pole_zero")
self.comboBox_pole_zero.addItem("")
self.comboBox_pole_zero.addItem("")
self.horizontalLayout_2.addWidget(self.comboBox_pole_zero)
self.radioButton_conj = QtWidgets.QRadioButton(parent=self.centralwidget)
font = QtGui.QFont()
font.setBold(False)
font.setWeight(50)
self.radioButton_conj.setFont(font)
self.radioButton_conj.setObjectName("radioButton_conj")
self.horizontalLayout_2.addWidget(self.radioButton_conj)
self.verticalLayout_3.addLayout(self.horizontalLayout_2)
self.zeroes_poles_graph = PlotWidget(parent=self.centralwidget)
self.zeroes_poles_graph.setMinimumSize(QtCore.QSize(300, 300))
self.zeroes_poles_graph.setObjectName("zeroes_poles_graph")
self.verticalLayout_3.addWidget(self.zeroes_poles_graph)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.pushButton_clear_poles = QtWidgets.QPushButton(parent=self.centralwidget)
self.pushButton_clear_poles.setObjectName("pushButton_clear_poles")
self.horizontalLayout.addWidget(self.pushButton_clear_poles)
self.pushButton_clear_zeros = QtWidgets.QPushButton(parent=self.centralwidget)
self.pushButton_clear_zeros.setObjectName("pushButton_clear_zeros")
self.horizontalLayout.addWidget(self.pushButton_clear_zeros)
self.pushButton_clear_all = QtWidgets.QPushButton(parent=self.centralwidget)
self.pushButton_clear_all.setObjectName("pushButton_clear_all")
self.horizontalLayout.addWidget(self.pushButton_clear_all)
self.verticalLayout_3.addLayout(self.horizontalLayout)
self.horizontalLayout_3.addLayout(self.verticalLayout_3)
self.verticalLayout_5 = QtWidgets.QVBoxLayout()
self.verticalLayout_5.setObjectName("verticalLayout_5")
self.label_3 = QtWidgets.QLabel(parent=self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_3.sizePolicy().hasHeightForWidth())
self.label_3.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setBold(True)
font.setItalic(True)
font.setWeight(75)
self.label_3.setFont(font)
self.label_3.setObjectName("label_3")
self.verticalLayout_5.addWidget(self.label_3)
self.mag_response_garph = PlotWidget(parent=self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.mag_response_garph.sizePolicy().hasHeightForWidth())
self.mag_response_garph.setSizePolicy(sizePolicy)
self.mag_response_garph.setMinimumSize(QtCore.QSize(300, 200))
self.mag_response_garph.setAutoFillBackground(True)
self.mag_response_garph.setObjectName("mag_response_garph")
self.verticalLayout_5.addWidget(self.mag_response_garph)
spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.verticalLayout_5.addItem(spacerItem)
self.horizontalLayout_3.addLayout(self.verticalLayout_5)
self.verticalLayout_6 = QtWidgets.QVBoxLayout()
self.verticalLayout_6.setObjectName("verticalLayout_6")
self.label_4 = QtWidgets.QLabel(parent=self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_4.sizePolicy().hasHeightForWidth())
self.label_4.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setBold(True)
font.setItalic(True)
font.setWeight(75)
self.label_4.setFont(font)
self.label_4.setObjectName("label_4")
self.verticalLayout_6.addWidget(self.label_4)
self.phase_response_garph = PlotWidget(parent=self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.phase_response_garph.sizePolicy().hasHeightForWidth())
self.phase_response_garph.setSizePolicy(sizePolicy)
self.phase_response_garph.setMinimumSize(QtCore.QSize(300, 200))
self.phase_response_garph.setAutoFillBackground(True)
self.phase_response_garph.setObjectName("phase_response_garph")
self.verticalLayout_6.addWidget(self.phase_response_garph)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Minimum)
self.verticalLayout_6.addItem(spacerItem1)
self.horizontalLayout_3.addLayout(self.verticalLayout_6)
self.verticalLayout_4 = QtWidgets.QVBoxLayout()
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.pushButton = QtWidgets.QPushButton(parent=self.centralwidget)
self.pushButton.setObjectName("pushButton")
self.verticalLayout_4.addWidget(self.pushButton)
self.label_2 = QtWidgets.QLabel(parent=self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Minimum)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_2.sizePolicy().hasHeightForWidth())
self.label_2.setSizePolicy(sizePolicy)
self.label_2.setObjectName("label_2")
self.verticalLayout_4.addWidget(self.label_2)
self.listWidget = QtWidgets.QListWidget(parent=self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Minimum, QtWidgets.QSizePolicy.Policy.MinimumExpanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.listWidget.sizePolicy().hasHeightForWidth())
self.listWidget.setSizePolicy(sizePolicy)
self.listWidget.setMinimumSize(QtCore.QSize(50, 50))
self.listWidget.setObjectName("listWidget")
self.verticalLayout_4.addWidget(self.listWidget)
self.horizontalLayout_3.addLayout(self.verticalLayout_4)
self.verticalLayout_8.addLayout(self.horizontalLayout_3)
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.tabWidget_2 = QtWidgets.QTabWidget(parent=self.centralwidget)
self.tabWidget_2.setMaximumSize(QtCore.QSize(250, 16777215))
self.tabWidget_2.setObjectName("tabWidget_2")
self.tab = QtWidgets.QWidget()
self.tab.setObjectName("tab")
self.verticalLayout_9 = QtWidgets.QVBoxLayout(self.tab)
self.verticalLayout_9.setObjectName("verticalLayout_9")
self.pushButton_6 = QtWidgets.QPushButton(parent=self.tab)
self.pushButton_6.setObjectName("pushButton_6")
self.verticalLayout_9.addWidget(self.pushButton_6)
self.tabWidget_2.addTab(self.tab, "")
self.widget = QtWidgets.QWidget()
self.widget.setObjectName("widget")
self.horizontalLayout_8 = QtWidgets.QHBoxLayout(self.widget)
self.horizontalLayout_8.setObjectName("horizontalLayout_8")
# self.tabWidget_2.addTab(self.widget, "")
self.verticalLayout_2.addWidget(self.tabWidget_2)
self.verticalLayout_10 = QtWidgets.QVBoxLayout()
self.verticalLayout_10.setObjectName("verticalLayout_10")
self.label = QtWidgets.QLabel(parent=self.centralwidget)
font = QtGui.QFont()
font.setBold(True)
font.setItalic(True)
font.setWeight(75)
self.label.setFont(font)
self.label.setObjectName("label")
self.verticalLayout_10.addWidget(self.label)
self.horizontalSlider = QtWidgets.QSlider(parent=self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Fixed, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.horizontalSlider.sizePolicy().hasHeightForWidth())
self.horizontalSlider.setSizePolicy(sizePolicy)
self.horizontalSlider.setMinimumSize(QtCore.QSize(250, 0))
self.horizontalSlider.setMaximumSize(QtCore.QSize(250, 16777215))
self.horizontalSlider.setOrientation(QtCore.Qt.Orientation.Horizontal)
self.horizontalSlider.setObjectName("horizontalSlider")
self.horizontalSlider.setMinimum(21)
self.horizontalSlider.setMaximum(150)
self.verticalLayout_10.addWidget(self.horizontalSlider)
self.verticalLayout_2.addLayout(self.verticalLayout_10)
self.horizontalLayout_4.addLayout(self.verticalLayout_2)
self.verticalLayout_11 = QtWidgets.QVBoxLayout()
self.verticalLayout_11.setObjectName("verticalLayout_11")
self.label_11 = QtWidgets.QLabel(parent=self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_11.sizePolicy().hasHeightForWidth())
self.label_11.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setBold(True)
font.setItalic(True)
font.setWeight(75)
self.label_11.setFont(font)
self.label_11.setObjectName("label_11")
self.verticalLayout_11.addWidget(self.label_11)
self.signal_input_graph = PlotWidget(parent=self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.signal_input_graph.sizePolicy().hasHeightForWidth())
self.signal_input_graph.setSizePolicy(sizePolicy)
self.signal_input_graph.setMinimumSize(QtCore.QSize(300, 250))
self.signal_input_graph.setAutoFillBackground(True)
self.signal_input_graph.setObjectName("signal_input_graph")
self.verticalLayout_11.addWidget(self.signal_input_graph)
self.horizontalLayout_4.addLayout(self.verticalLayout_11)
self.verticalLayout_12 = QtWidgets.QVBoxLayout()
self.verticalLayout_12.setObjectName("verticalLayout_12")
self.label_12 = QtWidgets.QLabel(parent=self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Preferred, QtWidgets.QSizePolicy.Policy.Fixed)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.label_12.sizePolicy().hasHeightForWidth())
self.label_12.setSizePolicy(sizePolicy)
font = QtGui.QFont()
font.setBold(True)
font.setItalic(True)
font.setWeight(75)
self.label_12.setFont(font)
self.label_12.setObjectName("label_12")
self.verticalLayout_12.addWidget(self.label_12)
self.filter_output_graph = PlotWidget(parent=self.centralwidget)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.filter_output_graph.sizePolicy().hasHeightForWidth())
self.filter_output_graph.setSizePolicy(sizePolicy)
self.filter_output_graph.setMinimumSize(QtCore.QSize(300, 250))
self.filter_output_graph.setAutoFillBackground(True)
self.filter_output_graph.setObjectName("filter_output_graph")
self.verticalLayout_12.addWidget(self.filter_output_graph)
self.horizontalLayout_4.addLayout(self.verticalLayout_12)
self.verticalLayout_8.addLayout(self.horizontalLayout_4)
self.gridLayout.addLayout(self.verticalLayout_8, 0, 0, 1, 1)
MainWindow.setCentralWidget(self.centralwidget)
self.statusbar = QtWidgets.QStatusBar(parent=MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.retranslateUi(MainWindow)
self.tabWidget_2.setCurrentIndex(0)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.comboBox_pole_zero.setItemText(0, _translate("MainWindow", "Zero"))
self.comboBox_pole_zero.setItemText(1, _translate("MainWindow", "Pole"))
self.radioButton_conj.setText(_translate("MainWindow", "Add conjugate"))
self.pushButton_clear_poles.setText(_translate("MainWindow", "clear poles"))
self.pushButton_clear_zeros.setText(_translate("MainWindow", "clear zeroes"))
self.pushButton_clear_all.setText(_translate("MainWindow", "clear all"))
self.label_3.setText(_translate("MainWindow", "Magnitude Response"))
self.label_4.setText(_translate("MainWindow", "Phase Response"))
self.pushButton.setText(_translate("MainWindow", "correct phase"))
self.label_2.setText(_translate("MainWindow", "All-pass Filter"))
self.pushButton_6.setText(_translate("MainWindow", "Load Signal"))
self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.tab), _translate("MainWindow", "Load Signal"))
# self.tabWidget_2.setTabText(self.tabWidget_2.indexOf(self.widget), _translate("MainWindow", "Padding Area"))
self.label.setText(_translate("MainWindow", "Filter control"))
self.label_11.setText(_translate("MainWindow", "Signal Input"))
self.label_12.setText(_translate("MainWindow", "Filtered Output"))
from pyqtgraph import PlotWidget