-
Notifications
You must be signed in to change notification settings - Fork 0
/
id_gen.py
45 lines (37 loc) · 1.54 KB
/
id_gen.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
from PyQt5 import QtCore, QtGui, QtWidgets
from serialID import genId
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
self.id = genId()
MainWindow.setObjectName("MainWindow")
MainWindow.setGeometry(400, 200, 400, 800)
MainWindow.resize(800, 600)
font = QtGui.QFont()
font.setPointSize(24)
MainWindow.setFont(font)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.pushButton = QtWidgets.QPushButton(self.centralwidget)
self.pushButton.setGeometry(QtCore.QRect(210, 140, 401, 291))
font = QtGui.QFont()
font.setPointSize(64)
self.pushButton.setFont(font)
self.pushButton.setObjectName("pushButton")
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
self.pushButton.clicked.connect(self.button1_click)
def button1_click(self):
self.id.communicate()
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.pushButton.setText(_translate("MainWindow", "CONNECT"))
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_())