1 Star 0 Fork 13

wzh/PySerial

forked from sunlimpid/PySerial 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
ui.py 12.77 KB
一键复制 编辑 原始数据 按行查看 历史
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'ui.ui'
#
# Created: Wed May 22 21:29:56 2013
# by: PyQt4 UI code generator 4.10.1
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
from PyTextEdit import PyTextEdit
try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s
try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(800, 600)
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(MainWindow.sizePolicy().hasHeightForWidth())
MainWindow.setSizePolicy(sizePolicy)
MainWindow.setMinimumSize(QtCore.QSize(800, 600))
MainWindow.setSizeIncrement(QtCore.QSize(0, 0))
MainWindow.setWindowOpacity(1.0)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.dispTE = PyTextEdit(self.centralwidget)
self.dispTE.setGeometry(QtCore.QRect(4, 95, 790, 500))
sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Maximum, QtGui.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.dispTE.sizePolicy().hasHeightForWidth())
self.dispTE.setSizePolicy(sizePolicy)
self.dispTE.setMinimumSize(QtCore.QSize(790, 495))
font = QtGui.QFont()
font.setPointSize(9)
self.dispTE.setFont(font)
self.dispTE.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOn)
self.dispTE.setUndoRedoEnabled(False)
self.dispTE.setReadOnly(False)
self.dispTE.setCursorWidth(9)
self.dispTE.setObjectName(_fromUtf8("dispTE"))
self.widget = QtGui.QWidget(self.centralwidget)
self.widget.setGeometry(QtCore.QRect(5, 10, 512, 75))
self.widget.setObjectName(_fromUtf8("widget"))
self.verticalLayout = QtGui.QVBoxLayout(self.widget)
self.verticalLayout.setMargin(0)
self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
self.horizontalLayout_7 = QtGui.QHBoxLayout()
self.horizontalLayout_7.setSpacing(11)
self.horizontalLayout_7.setObjectName(_fromUtf8("horizontalLayout_7"))
self.horizontalLayout_2 = QtGui.QHBoxLayout()
self.horizontalLayout_2.setSpacing(6)
self.horizontalLayout_2.setSizeConstraint(QtGui.QLayout.SetDefaultConstraint)
self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
self.label = QtGui.QLabel(self.widget)
self.label.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label.setObjectName(_fromUtf8("label"))
self.horizontalLayout_2.addWidget(self.label)
self.portCB = QtGui.QComboBox(self.widget)
self.portCB.setEnabled(True)
self.portCB.setEditable(False)
self.portCB.setModelColumn(0)
self.portCB.setObjectName(_fromUtf8("portCB"))
self.portCB.addItem(_fromUtf8(""))
self.portCB.addItem(_fromUtf8(""))
self.portCB.addItem(_fromUtf8(""))
self.portCB.addItem(_fromUtf8(""))
self.portCB.addItem(_fromUtf8(""))
self.portCB.addItem(_fromUtf8(""))
self.portCB.addItem(_fromUtf8(""))
self.portCB.addItem(_fromUtf8(""))
self.portCB.addItem(_fromUtf8(""))
self.portCB.addItem(_fromUtf8(""))
self.horizontalLayout_2.addWidget(self.portCB)
self.horizontalLayout_7.addLayout(self.horizontalLayout_2)
self.horizontalLayout_3 = QtGui.QHBoxLayout()
self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
self.label_2 = QtGui.QLabel(self.widget)
self.label_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_2.setObjectName(_fromUtf8("label_2"))
self.horizontalLayout_3.addWidget(self.label_2)
self.baundCB = QtGui.QComboBox(self.widget)
self.baundCB.setMaximumSize(QtCore.QSize(62, 16777215))
self.baundCB.setEditable(False)
self.baundCB.setMaxVisibleItems(20)
self.baundCB.setModelColumn(0)
self.baundCB.setObjectName(_fromUtf8("baundCB"))
self.baundCB.addItem(_fromUtf8(""))
self.baundCB.addItem(_fromUtf8(""))
self.baundCB.addItem(_fromUtf8(""))
self.baundCB.addItem(_fromUtf8(""))
self.baundCB.addItem(_fromUtf8(""))
self.baundCB.addItem(_fromUtf8(""))
self.baundCB.addItem(_fromUtf8(""))
self.baundCB.addItem(_fromUtf8(""))
self.baundCB.addItem(_fromUtf8(""))
self.baundCB.addItem(_fromUtf8(""))
self.baundCB.addItem(_fromUtf8(""))
self.baundCB.addItem(_fromUtf8(""))
self.baundCB.addItem(_fromUtf8(""))
self.baundCB.addItem(_fromUtf8(""))
self.baundCB.addItem(_fromUtf8(""))
self.horizontalLayout_3.addWidget(self.baundCB)
self.horizontalLayout_7.addLayout(self.horizontalLayout_3)
self.horizontalLayout_4 = QtGui.QHBoxLayout()
self.horizontalLayout_4.setObjectName(_fromUtf8("horizontalLayout_4"))
self.label_3 = QtGui.QLabel(self.widget)
self.label_3.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_3.setObjectName(_fromUtf8("label_3"))
self.horizontalLayout_4.addWidget(self.label_3)
self.bytesizeCB = QtGui.QComboBox(self.widget)
self.bytesizeCB.setEditable(False)
self.bytesizeCB.setModelColumn(0)
self.bytesizeCB.setObjectName(_fromUtf8("bytesizeCB"))
self.bytesizeCB.addItem(_fromUtf8(""))
self.bytesizeCB.addItem(_fromUtf8(""))
self.bytesizeCB.addItem(_fromUtf8(""))
self.bytesizeCB.addItem(_fromUtf8(""))
self.horizontalLayout_4.addWidget(self.bytesizeCB)
self.horizontalLayout_7.addLayout(self.horizontalLayout_4)
self.horizontalLayout_5 = QtGui.QHBoxLayout()
self.horizontalLayout_5.setObjectName(_fromUtf8("horizontalLayout_5"))
self.label_4 = QtGui.QLabel(self.widget)
self.label_4.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_4.setObjectName(_fromUtf8("label_4"))
self.horizontalLayout_5.addWidget(self.label_4)
self.stopbitsCB = QtGui.QComboBox(self.widget)
self.stopbitsCB.setEditable(False)
self.stopbitsCB.setModelColumn(0)
self.stopbitsCB.setObjectName(_fromUtf8("stopbitsCB"))
self.stopbitsCB.addItem(_fromUtf8(""))
self.stopbitsCB.addItem(_fromUtf8(""))
self.horizontalLayout_5.addWidget(self.stopbitsCB)
self.horizontalLayout_7.addLayout(self.horizontalLayout_5)
self.horizontalLayout_6 = QtGui.QHBoxLayout()
self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6"))
self.label_5 = QtGui.QLabel(self.widget)
self.label_5.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
self.label_5.setObjectName(_fromUtf8("label_5"))
self.horizontalLayout_6.addWidget(self.label_5)
self.parityCB = QtGui.QComboBox(self.widget)
self.parityCB.setEditable(False)
self.parityCB.setModelColumn(0)
self.parityCB.setObjectName(_fromUtf8("parityCB"))
self.parityCB.addItem(_fromUtf8(""))
self.parityCB.addItem(_fromUtf8(""))
self.parityCB.addItem(_fromUtf8(""))
self.parityCB.addItem(_fromUtf8(""))
self.parityCB.addItem(_fromUtf8(""))
self.horizontalLayout_6.addWidget(self.parityCB)
self.horizontalLayout_7.addLayout(self.horizontalLayout_6)
self.verticalLayout.addLayout(self.horizontalLayout_7)
self.horizontalLayout = QtGui.QHBoxLayout()
self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
self.openPB = QtGui.QPushButton(self.widget)
self.openPB.setObjectName(_fromUtf8("openPB"))
self.horizontalLayout.addWidget(self.openPB)
self.clearPB = QtGui.QPushButton(self.widget)
self.clearPB.setObjectName(_fromUtf8("clearPB"))
self.horizontalLayout.addWidget(self.clearPB)
spacerItem = QtGui.QSpacerItem(148, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
self.horizontalLayout.addItem(spacerItem)
self.verticalLayout.addLayout(self.horizontalLayout)
self.statusLB = QtGui.QLabel(self.widget)
self.statusLB.setObjectName(_fromUtf8("statusLB"))
self.verticalLayout.addWidget(self.statusLB)
MainWindow.setCentralWidget(self.centralwidget)
self.retranslateUi(MainWindow)
self.baundCB.setCurrentIndex(12)
self.bytesizeCB.setCurrentIndex(3)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(_translate("MainWindow", "PySerial", None))
self.label.setText(_translate("MainWindow", "串口号", None))
self.portCB.setItemText(0, _translate("MainWindow", "COM1", None))
self.portCB.setItemText(1, _translate("MainWindow", "COM2", None))
self.portCB.setItemText(2, _translate("MainWindow", "COM3", None))
self.portCB.setItemText(3, _translate("MainWindow", "COM4", None))
self.portCB.setItemText(4, _translate("MainWindow", "COM5", None))
self.portCB.setItemText(5, _translate("MainWindow", "COM6", None))
self.portCB.setItemText(6, _translate("MainWindow", "COM7", None))
self.portCB.setItemText(7, _translate("MainWindow", "COM8", None))
self.portCB.setItemText(8, _translate("MainWindow", "COM9", None))
self.portCB.setItemText(9, _translate("MainWindow", "COM10", None))
self.label_2.setText(_translate("MainWindow", "波特率", None))
self.baundCB.setItemText(0, _translate("MainWindow", "110", None))
self.baundCB.setItemText(1, _translate("MainWindow", "300", None))
self.baundCB.setItemText(2, _translate("MainWindow", "600", None))
self.baundCB.setItemText(3, _translate("MainWindow", "1200", None))
self.baundCB.setItemText(4, _translate("MainWindow", "2400", None))
self.baundCB.setItemText(5, _translate("MainWindow", "4800", None))
self.baundCB.setItemText(6, _translate("MainWindow", "9600", None))
self.baundCB.setItemText(7, _translate("MainWindow", "14400", None))
self.baundCB.setItemText(8, _translate("MainWindow", "19200", None))
self.baundCB.setItemText(9, _translate("MainWindow", "38400", None))
self.baundCB.setItemText(10, _translate("MainWindow", "56000", None))
self.baundCB.setItemText(11, _translate("MainWindow", "57600", None))
self.baundCB.setItemText(12, _translate("MainWindow", "115200", None))
self.baundCB.setItemText(13, _translate("MainWindow", "128000", None))
self.baundCB.setItemText(14, _translate("MainWindow", "256000", None))
self.label_3.setText(_translate("MainWindow", "数据位", None))
self.bytesizeCB.setItemText(0, _translate("MainWindow", "5", None))
self.bytesizeCB.setItemText(1, _translate("MainWindow", "6", None))
self.bytesizeCB.setItemText(2, _translate("MainWindow", "7", None))
self.bytesizeCB.setItemText(3, _translate("MainWindow", "8", None))
self.label_4.setText(_translate("MainWindow", "停止位", None))
self.stopbitsCB.setItemText(0, _translate("MainWindow", "1", None))
self.stopbitsCB.setItemText(1, _translate("MainWindow", "2", None))
self.label_5.setText(_translate("MainWindow", "校验位", None))
self.parityCB.setItemText(0, _translate("MainWindow", "None", None))
self.parityCB.setItemText(1, _translate("MainWindow", "Odd", None))
self.parityCB.setItemText(2, _translate("MainWindow", "Even", None))
self.parityCB.setItemText(3, _translate("MainWindow", "Mark", None))
self.parityCB.setItemText(4, _translate("MainWindow", "Space", None))
self.openPB.setText(_translate("MainWindow", "打开", None))
self.clearPB.setText(_translate("MainWindow", "清除", None))
self.statusLB.setText(_translate("MainWindow", "PySerial", None))
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/zhenghuiwu/pyserial.git
git@gitee.com:zhenghuiwu/pyserial.git
zhenghuiwu
pyserial
PySerial
master

搜索帮助