-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.py
240 lines (231 loc) · 11.8 KB
/
gui.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
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'gui.ui'
#
# Created by: PyQt5 UI code generator 5.9.2
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
from mplwidget import MplWidget
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.resize(800, 600)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
self.frame = QtWidgets.QFrame(self.centralwidget)
self.frame.setMinimumSize(QtCore.QSize(0, 60))
self.frame.setMaximumSize(QtCore.QSize(16777215, 60))
self.frame.setFrameShape(QtWidgets.QFrame.StyledPanel)
self.frame.setFrameShadow(QtWidgets.QFrame.Raised)
self.untref = QtWidgets.QLabel(self.frame)
self.untref.setGeometry(QtCore.QRect(-10, -10, 171, 81))
self.untref.setPixmap(QtGui.QPixmap("../../UNTREF_Logo_2016.svg.png"))
self.untref.setScaledContents(True)
self.title = QtWidgets.QLabel(self.frame)
self.title.setGeometry(QtCore.QRect(160, 0, 221, 61))
font = QtGui.QFont("Arial", 12)
self.title.setFont(font)
self.title.setScaledContents(False)
self.t_i = QtWidgets.QLineEdit(self.frame)
self.t_i.setGeometry(QtCore.QRect(400, 20, 21, 21))
self.t = QtWidgets.QLabel(self.frame)
self.t.setGeometry(QtCore.QRect(420, 20, 31, 21))
self.t_s = QtWidgets.QLineEdit(self.frame)
self.t_s.setGeometry(QtCore.QRect(450, 20, 21, 21))
self.fs = QtWidgets.QLineEdit(self.frame)
self.fs.setGeometry(QtCore.QRect(560, 20, 61, 22))
self.fsLabel = QtWidgets.QLabel(self.frame)
self.fsLabel.setGeometry(QtCore.QRect(490, 20, 71, 21))
self.gridLayout.addWidget(self.frame, 0, 0, 1, 3)
self.manipulacion = QtWidgets.QGroupBox(self.centralwidget)
self.gridLayout_8 = QtWidgets.QGridLayout(self.manipulacion)
self.desp = QtWidgets.QLineEdit(self.manipulacion)
self.desp.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_8.addWidget(self.desp, 6, 0, 1, 1)
self.desp_label = QtWidgets.QLabel(self.manipulacion)
self.desp_label.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_8.addWidget(self.desp_label, 4, 0, 2, 2)
self.giro = QtWidgets.QCheckBox(self.manipulacion)
self.gridLayout_8.addWidget(self.giro, 1, 0, 1, 1)
self.giro_desp = QtWidgets.QRadioButton(self.manipulacion)
self.giro_desp.setChecked(True)
self.gridLayout_8.addWidget(self.giro_desp, 2, 0, 1, 1)
self.desp_giro = QtWidgets.QRadioButton(self.manipulacion)
self.desp_giro.setChecked(False)
self.gridLayout_8.addWidget(self.desp_giro, 3, 0, 1, 1)
self.gridLayout.addWidget(self.manipulacion, 1, 2, 1, 1)
self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
self.tab = QtWidgets.QWidget()
self.gridLayout_4 = QtWidgets.QGridLayout(self.tab)
self.mpl_s1 = MplWidget(self.tab)
self.gridLayout_4.addWidget(self.mpl_s1, 0, 0, 1, 1)
self.mpl_s1m = MplWidget(self.tab)
self.gridLayout_4.addWidget(self.mpl_s1m, 0, 1, 1, 1)
self.tabWidget.addTab(self.tab, "")
self.tab_2 = QtWidgets.QWidget()
self.gridLayout_5 = QtWidgets.QGridLayout(self.tab_2)
self.mpl_s2 = MplWidget(self.tab_2)
self.gridLayout_5.addWidget(self.mpl_s2, 0, 0, 1, 1)
self.mpl_s2m = MplWidget(self.tab_2)
self.gridLayout_5.addWidget(self.mpl_s2m, 0, 1, 1, 1)
self.tabWidget.addTab(self.tab_2, "")
self.tab_3 = QtWidgets.QWidget()
self.gridLayout_6 = QtWidgets.QGridLayout(self.tab_3)
self.mpl_fft1 = MplWidget(self.tab_3)
self.gridLayout_6.addWidget(self.mpl_fft1, 0, 0, 1, 1)
self.mpl_fft2 = MplWidget(self.tab_3)
self.gridLayout_6.addWidget(self.mpl_fft2, 0, 1, 1, 1)
self.tabWidget.addTab(self.tab_3, "")
self.tab_4 = QtWidgets.QWidget()
self.gridLayout_7 = QtWidgets.QGridLayout(self.tab_4)
self.mpl_convo = MplWidget(self.tab_4)
self.gridLayout_7.addWidget(self.mpl_convo, 0, 2, 1, 1)
self.mpl_both = MplWidget(self.tab_4)
self.gridLayout_7.addWidget(self.mpl_both, 0, 1, 1, 1)
self.tabWidget.addTab(self.tab_4, "")
self.gridLayout.addWidget(self.tabWidget, 3, 0, 1, 3)
self.process = QtWidgets.QPushButton(self.centralwidget)
self.gridLayout.addWidget(self.process, 2, 2, 1, 1)
self.senial2 = QtWidgets.QGroupBox(self.centralwidget)
self.gridLayout_3 = QtWidgets.QGridLayout(self.senial2)
self.s2_type = QtWidgets.QComboBox(self.senial2)
self.s2_type.addItem("Sinusoide")
self.s2_type.addItem("Cuadrada")
self.s2_type.addItem("Sawtooth")
self.s2_type.addItem("Sinc")
self.s2_type.addItem("Pulso rectangular")
self.s2_type.addItem("Pulso triangular")
self.s2_type.addItem("Escalon")
self.s2_type.addItem("Signo")
self.s2_type.addItem("Exponencial decreciente")
self.s2_type.addItem("Exponencial bilateral")
self.gridLayout_3.addWidget(self.s2_type, 0, 0, 1, 3)
self.amplitudS2 = QtWidgets.QLabel(self.senial2)
self.amplitudS2.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_3.addWidget(self.amplitudS2, 1, 0, 1, 1)
self.periodoS2 = QtWidgets.QLabel(self.senial2)
self.periodoS2.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_3.addWidget(self.periodoS2, 1, 2, 1, 1)
self.amp_s2 = QtWidgets.QLineEdit(self.senial2)
self.amp_s2.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_3.addWidget(self.amp_s2, 2, 0, 1, 1)
self.per_s2 = QtWidgets.QLineEdit(self.senial2)
self.per_s2.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_3.addWidget(self.per_s2, 2, 2, 1, 1)
self.dutyS2 = QtWidgets.QLabel(self.senial2)
self.dutyS2.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_3.addWidget(self.dutyS2, 3, 0, 1, 1)
self.widthS2 = QtWidgets.QLabel(self.senial2)
self.widthS2.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_3.addWidget(self.widthS2, 3, 2, 1, 1)
self.duty_s2 = QtWidgets.QLineEdit(self.senial2)
self.duty_s2.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_3.addWidget(self.duty_s2, 4, 0, 1, 1)
self.width_s2 = QtWidgets.QLineEdit(self.senial2)
self.width_s2.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_3.addWidget(self.width_s2, 4, 2, 1, 1)
self.primer_s2 = QtWidgets.QLineEdit(self.senial2)
self.primer_s2.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_3.addWidget(self.primer_s2, 4, 1, 1, 1)
self.primerS2 = QtWidgets.QLabel(self.senial2)
self.primerS2.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_3.addWidget(self.primerS2, 3, 1, 1, 1)
self.gridLayout.addWidget(self.senial2, 1, 1, 2, 1)
self.senial1 = QtWidgets.QGroupBox(self.centralwidget)
self.gridLayout_2 = QtWidgets.QGridLayout(self.senial1)
self.periodoS1 = QtWidgets.QLabel(self.senial1)
self.periodoS1.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_2.addWidget(self.periodoS1, 1, 2, 1, 1)
self.widthS1 = QtWidgets.QLabel(self.senial1)
self.widthS1.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_2.addWidget(self.widthS1, 3, 2, 1, 1)
self.s1_type = QtWidgets.QComboBox(self.senial1)
self.s1_type.addItem("Sinusoide")
self.s1_type.addItem("Cuadrada")
self.s1_type.addItem("Sawtooth")
self.s1_type.addItem("Sinc")
self.s1_type.addItem("Pulso rectangular")
self.s1_type.addItem("Pulso triangular")
self.s1_type.addItem("Escalon")
self.s1_type.addItem("Signo")
self.s1_type.addItem("Exponencial decreciente")
self.s1_type.addItem("Exponencial bilateral")
self.gridLayout_2.addWidget(self.s1_type, 0, 0, 1, 3)
self.per_s1 = QtWidgets.QLineEdit(self.senial1)
self.per_s1.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_2.addWidget(self.per_s1, 2, 2, 1, 1)
self.duty_s1 = QtWidgets.QLineEdit(self.senial1)
self.duty_s1.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_2.addWidget(self.duty_s1, 4, 0, 1, 1)
self.width_s1 = QtWidgets.QLineEdit(self.senial1)
self.width_s1.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_2.addWidget(self.width_s1, 4, 2, 1, 1)
self.amp_s1 = QtWidgets.QLineEdit(self.senial1)
self.amp_s1.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_2.addWidget(self.amp_s1, 2, 0, 1, 1)
self.dutyS1 = QtWidgets.QLabel(self.senial1)
self.dutyS1.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_2.addWidget(self.dutyS1, 3, 0, 1, 1)
self.amplitudS1 = QtWidgets.QLabel(self.senial1)
self.amplitudS1.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_2.addWidget(self.amplitudS1, 1, 0, 1, 1)
self.primer_s1 = QtWidgets.QLineEdit(self.senial1)
self.primer_s1.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_2.addWidget(self.primer_s1, 4, 1, 1, 1)
self.primerS1 = QtWidgets.QLabel(self.senial1)
self.primerS1.setAlignment(QtCore.Qt.AlignCenter)
self.gridLayout_2.addWidget(self.primerS1, 3, 1, 1, 1)
self.gridLayout_2.setRowStretch(0, 1)
self.gridLayout_2.setRowStretch(2, 1)
self.gridLayout_2.setRowStretch(4, 1)
self.gridLayout.addWidget(self.senial1, 1, 0, 2, 1)
self.gridLayout.setColumnStretch(0, 2)
self.gridLayout.setColumnStretch(1, 2)
self.gridLayout.setColumnStretch(2, 1)
self.gridLayout.setRowStretch(0, 1)
self.gridLayout.setRowStretch(1, 1)
self.gridLayout.setRowStretch(3, 2)
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle("Tp2 - Se\u00F1ales y Sistemas")
MainWindow.setWindowIcon(QtGui.QIcon("../../UNTREF_Logo_2016.svg.png"))
self.title.setText("Manipulacion de Se\u00F1ales")
self.t_i.setText("-2")
self.t.setText("< t <")
self.t_s.setText("2")
self.fs.setText("1000")
self.fsLabel.setText("F. Muestreo")
self.manipulacion.setTitle("Manipulacion")
self.desp.setText("1")
self.desp_label.setText("Desplazamiento [s]")
self.giro.setText("Giro")
self.giro_desp.setText("Giro-Desp")
self.desp_giro.setText("Desp-Giro")
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), "Se\u00F1al 1")
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), "Se\u00F1al 2")
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), "FFT")
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), "Convolucion")
self.process.setText("Procesar")
self.senial2.setTitle("Se\u00F1al 2")
self.amplitudS2.setText("Amplitud")
self.periodoS2.setText("Periodo")
self.amp_s2.setText("2")
self.per_s2.setText("1")
self.dutyS2.setText("Duty")
self.widthS2.setText("Width")
self.duty_s2.setText("50")
self.width_s2.setText("0.5")
self.primer_s2.setText("0.1")
self.primerS2.setText("Primer")
self.senial1.setTitle("Se\u00F1al 1")
self.periodoS1.setText("Periodo [s]")
self.widthS1.setText("Width")
self.per_s1.setText("1")
self.duty_s1.setText("50")
self.width_s1.setText("0.5")
self.amp_s1.setText("2")
self.dutyS1.setText("Duty [%]")
self.amplitudS1.setText("Amplitud")
self.primer_s1.setText("0.1")
self.primerS1.setText("Primer")