forked from ColinFred/Pyserial-Demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ui_demo_1.py
218 lines (212 loc) · 12.3 KB
/
ui_demo_1.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
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'demo_1.ui'
#
# Created by: PyQt5 UI code generator 5.6
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName("Form")
Form.resize(707, 458)
self.formGroupBox = QtWidgets.QGroupBox(Form)
self.formGroupBox.setGeometry(QtCore.QRect(20, 20, 167, 301))
self.formGroupBox.setObjectName("formGroupBox")
self.formLayout = QtWidgets.QFormLayout(self.formGroupBox)
self.formLayout.setContentsMargins(10, 10, 10, 10)
self.formLayout.setSpacing(10)
self.formLayout.setObjectName("formLayout")
self.s1__lb_1 = QtWidgets.QLabel(self.formGroupBox)
self.s1__lb_1.setObjectName("s1__lb_1")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.s1__lb_1)
self.s1__box_1 = QtWidgets.QPushButton(self.formGroupBox)
self.s1__box_1.setAutoRepeatInterval(100)
self.s1__box_1.setDefault(True)
self.s1__box_1.setObjectName("s1__box_1")
self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.s1__box_1)
self.s1__lb_2 = QtWidgets.QLabel(self.formGroupBox)
self.s1__lb_2.setObjectName("s1__lb_2")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.s1__lb_2)
self.s1__box_2 = QtWidgets.QComboBox(self.formGroupBox)
self.s1__box_2.setObjectName("s1__box_2")
self.formLayout.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.s1__box_2)
self.s1__lb_3 = QtWidgets.QLabel(self.formGroupBox)
self.s1__lb_3.setObjectName("s1__lb_3")
self.formLayout.setWidget(3, QtWidgets.QFormLayout.LabelRole, self.s1__lb_3)
self.s1__box_3 = QtWidgets.QComboBox(self.formGroupBox)
self.s1__box_3.setObjectName("s1__box_3")
self.s1__box_3.addItem("")
self.s1__box_3.addItem("")
self.s1__box_3.addItem("")
self.s1__box_3.addItem("")
self.s1__box_3.addItem("")
self.s1__box_3.addItem("")
self.s1__box_3.addItem("")
self.s1__box_3.addItem("")
self.s1__box_3.addItem("")
self.s1__box_3.addItem("")
self.s1__box_3.addItem("")
self.s1__box_3.addItem("")
self.formLayout.setWidget(3, QtWidgets.QFormLayout.FieldRole, self.s1__box_3)
self.s1__lb_4 = QtWidgets.QLabel(self.formGroupBox)
self.s1__lb_4.setObjectName("s1__lb_4")
self.formLayout.setWidget(4, QtWidgets.QFormLayout.LabelRole, self.s1__lb_4)
self.s1__box_4 = QtWidgets.QComboBox(self.formGroupBox)
self.s1__box_4.setObjectName("s1__box_4")
self.s1__box_4.addItem("")
self.s1__box_4.addItem("")
self.s1__box_4.addItem("")
self.s1__box_4.addItem("")
self.formLayout.setWidget(4, QtWidgets.QFormLayout.FieldRole, self.s1__box_4)
self.s1__lb_5 = QtWidgets.QLabel(self.formGroupBox)
self.s1__lb_5.setObjectName("s1__lb_5")
self.formLayout.setWidget(5, QtWidgets.QFormLayout.LabelRole, self.s1__lb_5)
self.s1__box_5 = QtWidgets.QComboBox(self.formGroupBox)
self.s1__box_5.setObjectName("s1__box_5")
self.s1__box_5.addItem("")
self.formLayout.setWidget(5, QtWidgets.QFormLayout.FieldRole, self.s1__box_5)
self.open_button = QtWidgets.QPushButton(self.formGroupBox)
self.open_button.setObjectName("open_button")
self.formLayout.setWidget(7, QtWidgets.QFormLayout.SpanningRole, self.open_button)
self.close_button = QtWidgets.QPushButton(self.formGroupBox)
self.close_button.setObjectName("close_button")
self.formLayout.setWidget(8, QtWidgets.QFormLayout.SpanningRole, self.close_button)
self.s1__lb_6 = QtWidgets.QLabel(self.formGroupBox)
self.s1__lb_6.setObjectName("s1__lb_6")
self.formLayout.setWidget(6, QtWidgets.QFormLayout.LabelRole, self.s1__lb_6)
self.s1__box_6 = QtWidgets.QComboBox(self.formGroupBox)
self.s1__box_6.setObjectName("s1__box_6")
self.s1__box_6.addItem("")
self.formLayout.setWidget(6, QtWidgets.QFormLayout.FieldRole, self.s1__box_6)
self.state_label = QtWidgets.QLabel(self.formGroupBox)
self.state_label.setText("")
self.state_label.setTextFormat(QtCore.Qt.AutoText)
self.state_label.setScaledContents(True)
self.state_label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.state_label.setObjectName("state_label")
self.formLayout.setWidget(2, QtWidgets.QFormLayout.SpanningRole, self.state_label)
self.verticalGroupBox = QtWidgets.QGroupBox(Form)
self.verticalGroupBox.setGeometry(QtCore.QRect(210, 20, 401, 241))
self.verticalGroupBox.setObjectName("verticalGroupBox")
self.verticalLayout = QtWidgets.QVBoxLayout(self.verticalGroupBox)
self.verticalLayout.setContentsMargins(10, 10, 10, 10)
self.verticalLayout.setObjectName("verticalLayout")
self.s2__receive_text = QtWidgets.QTextBrowser(self.verticalGroupBox)
self.s2__receive_text.setObjectName("s2__receive_text")
self.verticalLayout.addWidget(self.s2__receive_text)
self.verticalGroupBox_2 = QtWidgets.QGroupBox(Form)
self.verticalGroupBox_2.setGeometry(QtCore.QRect(210, 280, 401, 101))
self.verticalGroupBox_2.setObjectName("verticalGroupBox_2")
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.verticalGroupBox_2)
self.verticalLayout_2.setContentsMargins(10, 10, 10, 10)
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.s3__send_text = QtWidgets.QTextEdit(self.verticalGroupBox_2)
self.s3__send_text.setObjectName("s3__send_text")
self.verticalLayout_2.addWidget(self.s3__send_text)
self.s3__send_button = QtWidgets.QPushButton(Form)
self.s3__send_button.setGeometry(QtCore.QRect(620, 310, 61, 31))
self.s3__send_button.setObjectName("s3__send_button")
self.s3__clear_button = QtWidgets.QPushButton(Form)
self.s3__clear_button.setGeometry(QtCore.QRect(620, 350, 61, 31))
self.s3__clear_button.setObjectName("s3__clear_button")
self.formGroupBox1 = QtWidgets.QGroupBox(Form)
self.formGroupBox1.setGeometry(QtCore.QRect(20, 340, 171, 101))
self.formGroupBox1.setObjectName("formGroupBox1")
self.formLayout_2 = QtWidgets.QFormLayout(self.formGroupBox1)
self.formLayout_2.setContentsMargins(10, 10, 10, 10)
self.formLayout_2.setSpacing(10)
self.formLayout_2.setObjectName("formLayout_2")
self.label = QtWidgets.QLabel(self.formGroupBox1)
self.label.setObjectName("label")
self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.label)
self.label_2 = QtWidgets.QLabel(self.formGroupBox1)
self.label_2.setObjectName("label_2")
self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.LabelRole, self.label_2)
self.lineEdit = QtWidgets.QLineEdit(self.formGroupBox1)
self.lineEdit.setObjectName("lineEdit")
self.formLayout_2.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.lineEdit)
self.lineEdit_2 = QtWidgets.QLineEdit(self.formGroupBox1)
self.lineEdit_2.setObjectName("lineEdit_2")
self.formLayout_2.setWidget(1, QtWidgets.QFormLayout.FieldRole, self.lineEdit_2)
self.hex_send = QtWidgets.QCheckBox(Form)
self.hex_send.setGeometry(QtCore.QRect(620, 280, 71, 16))
self.hex_send.setObjectName("hex_send")
self.hex_receive = QtWidgets.QCheckBox(Form)
self.hex_receive.setGeometry(QtCore.QRect(620, 40, 71, 16))
self.hex_receive.setObjectName("hex_receive")
self.s2__clear_button = QtWidgets.QPushButton(Form)
self.s2__clear_button.setGeometry(QtCore.QRect(620, 80, 61, 31))
self.s2__clear_button.setObjectName("s2__clear_button")
self.timer_send_cb = QtWidgets.QCheckBox(Form)
self.timer_send_cb.setGeometry(QtCore.QRect(260, 390, 71, 16))
self.timer_send_cb.setObjectName("timer_send_cb")
self.lineEdit_3 = QtWidgets.QLineEdit(Form)
self.lineEdit_3.setGeometry(QtCore.QRect(350, 390, 61, 20))
self.lineEdit_3.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.lineEdit_3.setObjectName("lineEdit_3")
self.dw = QtWidgets.QLabel(Form)
self.dw.setGeometry(QtCore.QRect(420, 390, 54, 20))
self.dw.setObjectName("dw")
self.verticalGroupBox.raise_()
self.verticalGroupBox_2.raise_()
self.formGroupBox.raise_()
self.s3__send_button.raise_()
self.s3__clear_button.raise_()
self.formGroupBox.raise_()
self.hex_send.raise_()
self.hex_receive.raise_()
self.s2__clear_button.raise_()
self.timer_send_cb.raise_()
self.lineEdit_3.raise_()
self.dw.raise_()
self.retranslateUi(Form)
QtCore.QMetaObject.connectSlotsByName(Form)
def retranslateUi(self, Form):
_translate = QtCore.QCoreApplication.translate
Form.setWindowTitle(_translate("Form", "Form"))
self.formGroupBox.setTitle(_translate("Form", "串口设置"))
self.s1__lb_1.setText(_translate("Form", "串口检测:"))
self.s1__box_1.setText(_translate("Form", "检测串口"))
self.s1__lb_2.setText(_translate("Form", "串口选择:"))
self.s1__lb_3.setText(_translate("Form", "波特率:"))
self.s1__box_3.setItemText(0, _translate("Form", "115200"))
self.s1__box_3.setItemText(1, _translate("Form", "2400"))
self.s1__box_3.setItemText(2, _translate("Form", "4800"))
self.s1__box_3.setItemText(3, _translate("Form", "9600"))
self.s1__box_3.setItemText(4, _translate("Form", "14400"))
self.s1__box_3.setItemText(5, _translate("Form", "19200"))
self.s1__box_3.setItemText(6, _translate("Form", "38400"))
self.s1__box_3.setItemText(7, _translate("Form", "57600"))
self.s1__box_3.setItemText(8, _translate("Form", "76800"))
self.s1__box_3.setItemText(9, _translate("Form", "12800"))
self.s1__box_3.setItemText(10, _translate("Form", "230400"))
self.s1__box_3.setItemText(11, _translate("Form", "460800"))
self.s1__lb_4.setText(_translate("Form", "数据位:"))
self.s1__box_4.setItemText(0, _translate("Form", "8"))
self.s1__box_4.setItemText(1, _translate("Form", "7"))
self.s1__box_4.setItemText(2, _translate("Form", "6"))
self.s1__box_4.setItemText(3, _translate("Form", "5"))
self.s1__lb_5.setText(_translate("Form", "校验位:"))
self.s1__box_5.setItemText(0, _translate("Form", "N"))
self.open_button.setText(_translate("Form", "打开串口"))
self.close_button.setText(_translate("Form", "关闭串口"))
self.s1__lb_6.setText(_translate("Form", "停止位:"))
self.s1__box_6.setItemText(0, _translate("Form", "1"))
self.verticalGroupBox.setTitle(_translate("Form", "接受区"))
self.verticalGroupBox_2.setTitle(_translate("Form", "发送区"))
self.s3__send_text.setHtml(_translate("Form", "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">\n"
"<html><head><meta name=\"qrichtext\" content=\"1\" /><style type=\"text/css\">\n"
"p, li { white-space: pre-wrap; }\n"
"</style></head><body style=\" font-family:\'SimSun\'; font-size:9pt; font-weight:400; font-style:normal;\">\n"
"<p style=\" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;\">123456</p></body></html>"))
self.s3__send_button.setText(_translate("Form", "发送"))
self.s3__clear_button.setText(_translate("Form", "清除"))
self.formGroupBox1.setTitle(_translate("Form", "串口状态"))
self.label.setText(_translate("Form", "已接收:"))
self.label_2.setText(_translate("Form", "已发送:"))
self.hex_send.setText(_translate("Form", "Hex发送"))
self.hex_receive.setText(_translate("Form", "Hex接收"))
self.s2__clear_button.setText(_translate("Form", "清除"))
self.timer_send_cb.setText(_translate("Form", "定时发送"))
self.lineEdit_3.setText(_translate("Form", "1000"))
self.dw.setText(_translate("Form", "ms/次"))