-
Notifications
You must be signed in to change notification settings - Fork 0
/
NeuroBox_UI.py
367 lines (358 loc) · 17.8 KB
/
NeuroBox_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
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'NeuroBox_UI.ui'
#
# Created by: PyQt5 UI code generator 5.15.7
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit this file unless you know what you are doing.
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(1172, 476)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.light_loop = QtWidgets.QLabel(self.centralwidget)
self.light_loop.setGeometry(QtCore.QRect(1040, 235, 82, 20))
self.light_loop.setFrameShape(QtWidgets.QFrame.Box)
self.light_loop.setFrameShadow(QtWidgets.QFrame.Raised)
self.light_loop.setObjectName("light_loop")
self.loop_counter_label = QtWidgets.QLabel(self.centralwidget)
self.loop_counter_label.setGeometry(QtCore.QRect(1097, 238, 47, 16))
self.loop_counter_label.setObjectName("loop_counter_label")
self.treeWidget = QtWidgets.QTreeWidget(self.centralwidget)
self.treeWidget.setGeometry(QtCore.QRect(350, 20, 641, 151))
self.treeWidget.setFrameShape(QtWidgets.QFrame.Box)
self.treeWidget.setFrameShadow(QtWidgets.QFrame.Sunken)
self.treeWidget.setColumnCount(0)
self.treeWidget.setObjectName("treeWidget")
self.start_button = QtWidgets.QPushButton(self.centralwidget)
self.start_button.setEnabled(False)
self.start_button.setGeometry(QtCore.QRect(1010, 40, 141, 41))
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.start_button.setFont(font)
self.start_button.setObjectName("start_button")
self.frame = QtWidgets.QFrame(self.centralwidget)
self.frame.setGeometry(QtCore.QRect(10, 205, 981, 81))
self.frame.setFrameShape(QtWidgets.QFrame.Panel)
self.frame.setFrameShadow(QtWidgets.QFrame.Sunken)
self.frame.setLineWidth(1)
self.frame.setMidLineWidth(1)
self.frame.setObjectName("frame")
self.devider_c = QtWidgets.QFrame(self.frame)
self.devider_c.setGeometry(QtCore.QRect(640, 0, 61, 81))
self.devider_c.setFrameShape(QtWidgets.QFrame.VLine)
self.devider_c.setFrameShadow(QtWidgets.QFrame.Sunken)
self.devider_c.setObjectName("devider_c")
self.divider_b = QtWidgets.QFrame(self.frame)
self.divider_b.setGeometry(QtCore.QRect(330, 0, 61, 81))
self.divider_b.setFrameShape(QtWidgets.QFrame.VLine)
self.divider_b.setFrameShadow(QtWidgets.QFrame.Sunken)
self.divider_b.setObjectName("divider_b")
self.condition_a = QtWidgets.QComboBox(self.frame)
self.condition_a.setEnabled(False)
self.condition_a.setGeometry(QtCore.QRect(130, 50, 69, 22))
self.condition_a.setEditable(True)
self.condition_a.setCurrentText("")
self.condition_a.setObjectName("condition_a")
self.label_condition_a = QtWidgets.QLabel(self.frame)
self.label_condition_a.setGeometry(QtCore.QRect(60, 50, 61, 20))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(11)
self.label_condition_a.setFont(font)
self.label_condition_a.setObjectName("label_condition_a")
self.label_time_a = QtWidgets.QLabel(self.frame)
self.label_time_a.setGeometry(QtCore.QRect(220, 50, 51, 20))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(11)
self.label_time_a.setFont(font)
self.label_time_a.setObjectName("label_time_a")
self.label_channel_a = QtWidgets.QLabel(self.frame)
self.label_channel_a.setGeometry(QtCore.QRect(170, 2, 81, 20))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(11)
self.label_channel_a.setFont(font)
self.label_channel_a.setObjectName("label_channel_a")
self.label_channel_b = QtWidgets.QLabel(self.frame)
self.label_channel_b.setGeometry(QtCore.QRect(480, 2, 81, 20))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(11)
self.label_channel_b.setFont(font)
self.label_channel_b.setObjectName("label_channel_b")
self.condition_b = QtWidgets.QComboBox(self.frame)
self.condition_b.setEnabled(False)
self.condition_b.setGeometry(QtCore.QRect(440, 50, 69, 22))
self.condition_b.setEditable(True)
self.condition_b.setCurrentText("")
self.condition_b.setObjectName("condition_b")
self.label_time_b = QtWidgets.QLabel(self.frame)
self.label_time_b.setGeometry(QtCore.QRect(530, 50, 51, 20))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(11)
self.label_time_b.setFont(font)
self.label_time_b.setObjectName("label_time_b")
self.label_condition_b = QtWidgets.QLabel(self.frame)
self.label_condition_b.setGeometry(QtCore.QRect(370, 50, 61, 20))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(11)
self.label_condition_b.setFont(font)
self.label_condition_b.setObjectName("label_condition_b")
self.label_step = QtWidgets.QLabel(self.frame)
self.label_step.setGeometry(QtCore.QRect(10, 50, 41, 20))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(11)
self.label_step.setFont(font)
self.label_step.setObjectName("label_step")
self.divider_middle = QtWidgets.QFrame(self.frame)
self.divider_middle.setGeometry(QtCore.QRect(0, 20, 981, 41))
self.divider_middle.setFrameShape(QtWidgets.QFrame.HLine)
self.divider_middle.setFrameShadow(QtWidgets.QFrame.Raised)
self.divider_middle.setObjectName("divider_middle")
self.light_B = QtWidgets.QLabel(self.divider_middle)
self.light_B.setGeometry(QtCore.QRect(360, 5, 311, 16))
self.light_B.setFrameShape(QtWidgets.QFrame.Box)
self.light_B.setFrameShadow(QtWidgets.QFrame.Sunken)
self.light_B.setText("")
self.light_B.setObjectName("light_B")
self.light_C = QtWidgets.QLabel(self.divider_middle)
self.light_C.setGeometry(QtCore.QRect(670, 5, 361, 16))
self.light_C.setFrameShape(QtWidgets.QFrame.Box)
self.light_C.setFrameShadow(QtWidgets.QFrame.Sunken)
self.light_C.setText("")
self.light_C.setObjectName("light_C")
self.label_channel_c = QtWidgets.QLabel(self.frame)
self.label_channel_c.setGeometry(QtCore.QRect(790, 2, 81, 20))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(11)
self.label_channel_c.setFont(font)
self.label_channel_c.setObjectName("label_channel_c")
self.label_condition_c = QtWidgets.QLabel(self.frame)
self.label_condition_c.setGeometry(QtCore.QRect(680, 50, 61, 20))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(11)
self.label_condition_c.setFont(font)
self.label_condition_c.setObjectName("label_condition_c")
self.label_time_c = QtWidgets.QLabel(self.frame)
self.label_time_c.setGeometry(QtCore.QRect(840, 50, 51, 20))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(11)
self.label_time_c.setFont(font)
self.label_time_c.setObjectName("label_time_c")
self.condition_c = QtWidgets.QComboBox(self.frame)
self.condition_c.setEnabled(False)
self.condition_c.setGeometry(QtCore.QRect(750, 50, 69, 22))
self.condition_c.setEditable(True)
self.condition_c.setCurrentText("")
self.condition_c.setObjectName("condition_c")
self.light_A = QtWidgets.QLabel(self.frame)
self.light_A.setGeometry(QtCore.QRect(49, 25, 311, 16))
self.light_A.setFrameShape(QtWidgets.QFrame.Box)
self.light_A.setFrameShadow(QtWidgets.QFrame.Sunken)
self.light_A.setLineWidth(1)
self.light_A.setText("")
self.light_A.setObjectName("light_A")
self.divider_a = QtWidgets.QFrame(self.frame)
self.divider_a.setGeometry(QtCore.QRect(20, -10, 61, 91))
self.divider_a.setFrameShape(QtWidgets.QFrame.VLine)
self.divider_a.setFrameShadow(QtWidgets.QFrame.Sunken)
self.divider_a.setObjectName("divider_a")
self.time_a = QtWidgets.QSpinBox(self.frame)
self.time_a.setEnabled(False)
self.time_a.setGeometry(QtCore.QRect(279, 50, 71, 22))
self.time_a.setMinimum(1)
self.time_a.setMaximum(86400)
self.time_a.setObjectName("time_a")
self.time_b = QtWidgets.QSpinBox(self.frame)
self.time_b.setEnabled(False)
self.time_b.setGeometry(QtCore.QRect(585, 50, 71, 22))
self.time_b.setMinimum(1)
self.time_b.setMaximum(86400)
self.time_b.setObjectName("time_b")
self.time_c = QtWidgets.QSpinBox(self.frame)
self.time_c.setEnabled(False)
self.time_c.setGeometry(QtCore.QRect(900, 50, 71, 22))
self.time_c.setMinimum(1)
self.time_c.setMaximum(86400)
self.time_c.setObjectName("time_c")
self.divider_middle.raise_()
self.devider_c.raise_()
self.divider_b.raise_()
self.condition_a.raise_()
self.label_condition_a.raise_()
self.label_time_a.raise_()
self.label_channel_a.raise_()
self.label_channel_b.raise_()
self.condition_b.raise_()
self.label_time_b.raise_()
self.label_step.raise_()
self.label_channel_c.raise_()
self.label_condition_b.raise_()
self.label_condition_c.raise_()
self.label_time_c.raise_()
self.condition_c.raise_()
self.light_A.raise_()
self.divider_a.raise_()
self.time_a.raise_()
self.time_b.raise_()
self.time_c.raise_()
self.groupBox = QtWidgets.QGroupBox(self.centralwidget)
self.groupBox.setGeometry(QtCore.QRect(10, 20, 281, 141))
font = QtGui.QFont()
font.setPointSize(11)
self.groupBox.setFont(font)
self.groupBox.setAutoFillBackground(True)
self.groupBox.setFlat(True)
self.groupBox.setObjectName("groupBox")
self.port_comboBox = QtWidgets.QComboBox(self.groupBox)
self.port_comboBox.setGeometry(QtCore.QRect(10, 30, 161, 31))
self.port_comboBox.setEditable(True)
self.port_comboBox.setObjectName("port_comboBox")
self.port_connect_button = QtWidgets.QPushButton(self.groupBox)
self.port_connect_button.setGeometry(QtCore.QRect(10, 90, 81, 31))
self.port_connect_button.setObjectName("port_connect_button")
self.port_disconnect_button = QtWidgets.QPushButton(self.groupBox)
self.port_disconnect_button.setEnabled(False)
self.port_disconnect_button.setGeometry(QtCore.QRect(110, 90, 101, 31))
self.port_disconnect_button.setObjectName("port_disconnect_button")
self.port_refresh_button = QtWidgets.QPushButton(self.groupBox)
self.port_refresh_button.setGeometry(QtCore.QRect(180, 30, 91, 31))
font = QtGui.QFont()
font.setPointSize(9)
self.port_refresh_button.setFont(font)
self.port_refresh_button.setObjectName("port_refresh_button")
self.stop_button = QtWidgets.QPushButton(self.centralwidget)
self.stop_button.setEnabled(False)
self.stop_button.setGeometry(QtCore.QRect(1010, 110, 141, 41))
palette = QtGui.QPalette()
brush = QtGui.QBrush(QtGui.QColor(255, 0, 0))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Active, QtGui.QPalette.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(240, 240, 240))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Inactive, QtGui.QPalette.Button, brush)
brush = QtGui.QBrush(QtGui.QColor(240, 240, 240))
brush.setStyle(QtCore.Qt.SolidPattern)
palette.setBrush(QtGui.QPalette.Disabled, QtGui.QPalette.Button, brush)
self.stop_button.setPalette(palette)
font = QtGui.QFont()
font.setPointSize(12)
font.setBold(True)
font.setWeight(75)
self.stop_button.setFont(font)
self.stop_button.setAutoFillBackground(False)
self.stop_button.setStyleSheet("")
self.stop_button.setDefault(False)
self.stop_button.setFlat(False)
self.stop_button.setObjectName("stop_button")
self.clear_rule_button = QtWidgets.QPushButton(self.centralwidget)
self.clear_rule_button.setEnabled(False)
self.clear_rule_button.setGeometry(QtCore.QRect(780, 290, 101, 31))
self.clear_rule_button.setObjectName("clear_rule_button")
self.add_rule_button = QtWidgets.QPushButton(self.centralwidget)
self.add_rule_button.setEnabled(False)
self.add_rule_button.setGeometry(QtCore.QRect(890, 290, 101, 31))
self.add_rule_button.setObjectName("add_rule_button")
self.apply_setting_button = QtWidgets.QPushButton(self.centralwidget)
self.apply_setting_button.setEnabled(False)
self.apply_setting_button.setGeometry(QtCore.QRect(1010, 283, 141, 38))
self.apply_setting_button.setObjectName("apply_setting_button")
self.label_cycle = QtWidgets.QLabel(self.centralwidget)
self.label_cycle.setGeometry(QtCore.QRect(1040, 205, 81, 20))
font = QtGui.QFont()
font.setFamily("Arial")
font.setPointSize(11)
self.label_cycle.setFont(font)
self.label_cycle.setObjectName("label_cycle")
self.total_cycle = QtWidgets.QSpinBox(self.centralwidget)
self.total_cycle.setEnabled(False)
self.total_cycle.setGeometry(QtCore.QRect(1040, 255, 81, 22))
self.total_cycle.setMinimum(1)
self.total_cycle.setObjectName("total_cycle")
self.divider_middle_2 = QtWidgets.QFrame(self.centralwidget)
self.divider_middle_2.setGeometry(QtCore.QRect(10, 275, 981, 20))
self.divider_middle_2.setFrameShape(QtWidgets.QFrame.HLine)
self.divider_middle_2.setFrameShadow(QtWidgets.QFrame.Raised)
self.divider_middle_2.setObjectName("divider_middle_2")
self.frame.raise_()
self.light_loop.raise_()
self.loop_counter_label.raise_()
self.treeWidget.raise_()
self.start_button.raise_()
self.groupBox.raise_()
self.stop_button.raise_()
self.clear_rule_button.raise_()
self.add_rule_button.raise_()
self.apply_setting_button.raise_()
self.label_cycle.raise_()
self.total_cycle.raise_()
self.divider_middle_2.raise_()
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 1172, 21))
self.menubar.setObjectName("menubar")
self.menuFiles = QtWidgets.QMenu(self.menubar)
self.menuFiles.setObjectName("menuFiles")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.action_load = QtWidgets.QAction(MainWindow)
self.action_load.setEnabled(False)
self.action_load.setObjectName("action_load")
self.action_save = QtWidgets.QAction(MainWindow)
self.action_save.setEnabled(False)
self.action_save.setObjectName("action_save")
self.menuFiles.addAction(self.action_load)
self.menuFiles.addAction(self.action_save)
self.menubar.addAction(self.menuFiles.menuAction())
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "NeuroBox"))
self.light_loop.setText(_translate("MainWindow", "Cycle :"))
self.loop_counter_label.setText(_translate("MainWindow", "0"))
self.start_button.setText(_translate("MainWindow", "START"))
self.label_condition_a.setText(_translate("MainWindow", "Condition"))
self.label_time_a.setText(_translate("MainWindow", "Time(s)"))
self.label_channel_a.setText(_translate("MainWindow", "Channel A"))
self.label_channel_b.setText(_translate("MainWindow", "Channel B"))
self.label_time_b.setText(_translate("MainWindow", "Time(s)"))
self.label_condition_b.setText(_translate("MainWindow", "Condition"))
self.label_step.setText(_translate("MainWindow", "Step"))
self.label_channel_c.setText(_translate("MainWindow", "Channel C"))
self.label_condition_c.setText(_translate("MainWindow", "Condition"))
self.label_time_c.setText(_translate("MainWindow", "Time(s)"))
self.groupBox.setTitle(_translate("MainWindow", "Select device"))
self.port_connect_button.setText(_translate("MainWindow", "Connect"))
self.port_disconnect_button.setText(_translate("MainWindow", "Disconnect"))
self.port_refresh_button.setText(_translate("MainWindow", "Refresh"))
self.stop_button.setText(_translate("MainWindow", "STOP"))
self.clear_rule_button.setText(_translate("MainWindow", "CLEAR"))
self.add_rule_button.setText(_translate("MainWindow", "ADD"))
self.apply_setting_button.setText(_translate("MainWindow", "APPLY"))
self.label_cycle.setText(_translate("MainWindow", "Trial Cycle"))
self.menuFiles.setTitle(_translate("MainWindow", "Files"))
self.action_load.setText(_translate("MainWindow", "Load"))
self.action_save.setText(_translate("MainWindow", "Save"))
if __name__ == "__main__":
import sys
app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())