1 Star 0 Fork 10

why-mao/DreamSerial

forked from Neeil/DreamSerial 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
DreamSerial_Ui.py 20.79 KB
一键复制 编辑 原始数据 按行查看 历史
Neil Wang 提交于 2016-02-26 14:42 . Added NewLine CheckBox for TX
# -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '..\DreamSerial\UI\dreamSerialMainForm.ui'
#
# Created by: PyQt5 UI code generator 5.5.1
#
# WARNING! All changes made in this file will be lost!
from PyQt5 import QtCore, QtGui, QtWidgets
class Ui_MainWindow(object):
def setupUi(self, MainWindow):
MainWindow.setObjectName("MainWindow")
MainWindow.resize(704, 693)
self.centralwidget = QtWidgets.QWidget(MainWindow)
self.centralwidget.setObjectName("centralwidget")
self.gridLayout = QtWidgets.QGridLayout(self.centralwidget)
self.gridLayout.setObjectName("gridLayout")
self.verticalLayout_2 = QtWidgets.QVBoxLayout()
self.verticalLayout_2.setObjectName("verticalLayout_2")
self.groupBox = QtWidgets.QGroupBox(self.centralwidget)
font = QtGui.QFont()
font.setFamily("Consolas")
font.setPointSize(9)
self.groupBox.setFont(font)
self.groupBox.setObjectName("groupBox")
self.gridLayout_4 = QtWidgets.QGridLayout(self.groupBox)
self.gridLayout_4.setObjectName("gridLayout_4")
self.label = QtWidgets.QLabel(self.groupBox)
font = QtGui.QFont()
font.setFamily("Consolas")
font.setPointSize(8)
self.label.setFont(font)
self.label.setObjectName("label")
self.gridLayout_4.addWidget(self.label, 1, 0, 1, 1)
self.pbOpenPort = QtWidgets.QPushButton(self.groupBox)
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Preferred)
sizePolicy.setHorizontalStretch(0)
sizePolicy.setVerticalStretch(0)
sizePolicy.setHeightForWidth(self.pbOpenPort.sizePolicy().hasHeightForWidth())
self.pbOpenPort.setSizePolicy(sizePolicy)
self.pbOpenPort.setObjectName("pbOpenPort")
self.gridLayout_4.addWidget(self.pbOpenPort, 1, 9, 2, 1)
self.label_3 = QtWidgets.QLabel(self.groupBox)
font = QtGui.QFont()
font.setFamily("Consolas")
font.setPointSize(8)
self.label_3.setFont(font)
self.label_3.setObjectName("label_3")
self.gridLayout_4.addWidget(self.label_3, 1, 2, 1, 1)
self.cbbBaudRate = QtWidgets.QComboBox(self.groupBox)
self.cbbBaudRate.setObjectName("cbbBaudRate")
self.cbbBaudRate.addItem("")
self.cbbBaudRate.addItem("")
self.cbbBaudRate.addItem("")
self.cbbBaudRate.addItem("")
self.cbbBaudRate.addItem("")
self.cbbBaudRate.addItem("")
self.cbbBaudRate.addItem("")
self.cbbBaudRate.addItem("")
self.cbbBaudRate.addItem("")
self.cbbBaudRate.addItem("")
self.cbbBaudRate.addItem("")
self.cbbBaudRate.addItem("")
self.gridLayout_4.addWidget(self.cbbBaudRate, 2, 1, 1, 1)
self.cbbParity = QtWidgets.QComboBox(self.groupBox)
self.cbbParity.setObjectName("cbbParity")
self.cbbParity.addItem("")
self.cbbParity.addItem("")
self.cbbParity.addItem("")
self.cbbParity.addItem("")
self.cbbParity.addItem("")
self.gridLayout_4.addWidget(self.cbbParity, 2, 3, 1, 1)
self.cbbDataBit = QtWidgets.QComboBox(self.groupBox)
self.cbbDataBit.setObjectName("cbbDataBit")
self.cbbDataBit.addItem("")
self.cbbDataBit.addItem("")
self.cbbDataBit.addItem("")
self.cbbDataBit.addItem("")
self.gridLayout_4.addWidget(self.cbbDataBit, 1, 3, 1, 1)
self.label_2 = QtWidgets.QLabel(self.groupBox)
font = QtGui.QFont()
font.setFamily("Consolas")
font.setPointSize(8)
self.label_2.setFont(font)
self.label_2.setObjectName("label_2")
self.gridLayout_4.addWidget(self.label_2, 2, 0, 1, 1)
self.line_2 = QtWidgets.QFrame(self.groupBox)
self.line_2.setFrameShape(QtWidgets.QFrame.VLine)
self.line_2.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_2.setObjectName("line_2")
self.gridLayout_4.addWidget(self.line_2, 1, 4, 2, 1)
self.label_4 = QtWidgets.QLabel(self.groupBox)
font = QtGui.QFont()
font.setFamily("Consolas")
font.setPointSize(8)
self.label_4.setFont(font)
self.label_4.setObjectName("label_4")
self.gridLayout_4.addWidget(self.label_4, 2, 2, 1, 1)
self.line_3 = QtWidgets.QFrame(self.groupBox)
self.line_3.setFrameShape(QtWidgets.QFrame.VLine)
self.line_3.setFrameShadow(QtWidgets.QFrame.Sunken)
self.line_3.setObjectName("line_3")
self.gridLayout_4.addWidget(self.line_3, 1, 7, 2, 1)
self.cbbPortName = QtWidgets.QComboBox(self.groupBox)
self.cbbPortName.setObjectName("cbbPortName")
self.gridLayout_4.addWidget(self.cbbPortName, 1, 1, 1, 1)
self.label_5 = QtWidgets.QLabel(self.groupBox)
font = QtGui.QFont()
font.setPointSize(8)
self.label_5.setFont(font)
self.label_5.setObjectName("label_5")
self.gridLayout_4.addWidget(self.label_5, 1, 5, 1, 1)
self.sbResendTimePeriod = QtWidgets.QSpinBox(self.groupBox)
self.sbResendTimePeriod.setObjectName("sbResendTimePeriod")
self.gridLayout_4.addWidget(self.sbResendTimePeriod, 2, 6, 1, 1)
self.cbbStopBit = QtWidgets.QComboBox(self.groupBox)
self.cbbStopBit.setObjectName("cbbStopBit")
self.cbbStopBit.addItem("")
self.cbbStopBit.addItem("")
self.cbbStopBit.addItem("")
self.gridLayout_4.addWidget(self.cbbStopBit, 1, 6, 1, 1)
self.cbReSend = QtWidgets.QCheckBox(self.groupBox)
font = QtGui.QFont()
font.setPointSize(8)
self.cbReSend.setFont(font)
self.cbReSend.setObjectName("cbReSend")
self.gridLayout_4.addWidget(self.cbReSend, 2, 5, 1, 1)
self.verticalLayout_2.addWidget(self.groupBox)
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
self.cbRxHex = QtWidgets.QCheckBox(self.centralwidget)
font = QtGui.QFont()
font.setFamily("Consolas")
font.setPointSize(8)
self.cbRxHex.setFont(font)
self.cbRxHex.setObjectName("cbRxHex")
self.horizontalLayout_2.addWidget(self.cbRxHex)
self.cbRxAscii = QtWidgets.QCheckBox(self.centralwidget)
font = QtGui.QFont()
font.setFamily("Consolas")
font.setPointSize(8)
self.cbRxAscii.setFont(font)
self.cbRxAscii.setObjectName("cbRxAscii")
self.horizontalLayout_2.addWidget(self.cbRxAscii)
self.pushButton = QtWidgets.QPushButton(self.centralwidget)
font = QtGui.QFont()
font.setFamily("Consolas")
self.pushButton.setFont(font)
self.pushButton.setObjectName("pushButton")
self.horizontalLayout_2.addWidget(self.pushButton)
self.verticalLayout_2.addLayout(self.horizontalLayout_2)
self.pteRx = QtWidgets.QPlainTextEdit(self.centralwidget)
font = QtGui.QFont()
font.setFamily("Consolas")
self.pteRx.setFont(font)
self.pteRx.setObjectName("pteRx")
self.verticalLayout_2.addWidget(self.pteRx)
self.horizontalLayout = QtWidgets.QHBoxLayout()
self.horizontalLayout.setObjectName("horizontalLayout")
self.cbbTxType = QtWidgets.QComboBox(self.centralwidget)
font = QtGui.QFont()
font.setFamily("Consolas")
font.setPointSize(10)
self.cbbTxType.setFont(font)
self.cbbTxType.setObjectName("cbbTxType")
self.cbbTxType.addItem("")
self.cbbTxType.addItem("")
self.horizontalLayout.addWidget(self.cbbTxType)
self.leTx = QtWidgets.QLineEdit(self.centralwidget)
font = QtGui.QFont()
font.setFamily("Consolas")
font.setBold(True)
font.setWeight(75)
self.leTx.setFont(font)
self.leTx.setObjectName("leTx")
self.horizontalLayout.addWidget(self.leTx)
self.cbNewLine = QtWidgets.QCheckBox(self.centralwidget)
self.cbNewLine.setObjectName("cbNewLine")
self.horizontalLayout.addWidget(self.cbNewLine)
self.pbSend = QtWidgets.QPushButton(self.centralwidget)
font = QtGui.QFont()
font.setFamily("Consolas")
self.pbSend.setFont(font)
self.pbSend.setObjectName("pbSend")
self.horizontalLayout.addWidget(self.pbSend)
self.verticalLayout_2.addLayout(self.horizontalLayout)
self.gridLayout.addLayout(self.verticalLayout_2, 0, 0, 1, 1)
self.verticalLayout = QtWidgets.QVBoxLayout()
self.verticalLayout.setObjectName("verticalLayout")
self.FuncGroup = QtWidgets.QGroupBox(self.centralwidget)
font = QtGui.QFont()
font.setFamily("Consolas")
self.FuncGroup.setFont(font)
self.FuncGroup.setObjectName("FuncGroup")
self.verticalLayout_3 = QtWidgets.QVBoxLayout(self.FuncGroup)
self.verticalLayout_3.setObjectName("verticalLayout_3")
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
self.pbAddSignal = QtWidgets.QPushButton(self.FuncGroup)
font = QtGui.QFont()
font.setFamily("Consolas")
font.setBold(False)
font.setWeight(50)
self.pbAddSignal.setFont(font)
self.pbAddSignal.setObjectName("pbAddSignal")
self.horizontalLayout_4.addWidget(self.pbAddSignal)
self.pbRmSignal = QtWidgets.QPushButton(self.FuncGroup)
font = QtGui.QFont()
font.setFamily("Consolas")
font.setBold(False)
font.setWeight(50)
self.pbRmSignal.setFont(font)
self.pbRmSignal.setObjectName("pbRmSignal")
self.horizontalLayout_4.addWidget(self.pbRmSignal)
self.verticalLayout_3.addLayout(self.horizontalLayout_4)
self.tbwSignalList = QtWidgets.QTableWidget(self.FuncGroup)
self.tbwSignalList.setObjectName("tbwSignalList")
self.tbwSignalList.setColumnCount(0)
self.tbwSignalList.setRowCount(0)
self.verticalLayout_3.addWidget(self.tbwSignalList)
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
self.verticalLayout_3.addItem(spacerItem)
spacerItem1 = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
self.verticalLayout_3.addItem(spacerItem1)
self.verticalLayout_4 = QtWidgets.QVBoxLayout()
self.verticalLayout_4.setObjectName("verticalLayout_4")
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
self.label_6 = QtWidgets.QLabel(self.FuncGroup)
self.label_6.setObjectName("label_6")
self.horizontalLayout_5.addWidget(self.label_6)
self.sbRegLength = QtWidgets.QSpinBox(self.FuncGroup)
self.sbRegLength.setObjectName("sbRegLength")
self.horizontalLayout_5.addWidget(self.sbRegLength)
self.verticalLayout_4.addLayout(self.horizontalLayout_5)
self.pbReadAllReg = QtWidgets.QPushButton(self.FuncGroup)
self.pbReadAllReg.setObjectName("pbReadAllReg")
self.verticalLayout_4.addWidget(self.pbReadAllReg)
self.verticalLayout_3.addLayout(self.verticalLayout_4)
self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
self.label_7 = QtWidgets.QLabel(self.FuncGroup)
self.label_7.setObjectName("label_7")
self.horizontalLayout_6.addWidget(self.label_7)
self.sbStartAddress = QtWidgets.QSpinBox(self.FuncGroup)
self.sbStartAddress.setObjectName("sbStartAddress")
self.horizontalLayout_6.addWidget(self.sbStartAddress)
self.verticalLayout_3.addLayout(self.horizontalLayout_6)
self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
self.label_8 = QtWidgets.QLabel(self.FuncGroup)
self.label_8.setObjectName("label_8")
self.horizontalLayout_7.addWidget(self.label_8)
self.sbReadLength = QtWidgets.QSpinBox(self.FuncGroup)
self.sbReadLength.setObjectName("sbReadLength")
self.horizontalLayout_7.addWidget(self.sbReadLength)
self.verticalLayout_3.addLayout(self.horizontalLayout_7)
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
self.pbReadReg = QtWidgets.QPushButton(self.FuncGroup)
self.pbReadReg.setObjectName("pbReadReg")
self.horizontalLayout_3.addWidget(self.pbReadReg)
self.verticalLayout_3.addLayout(self.horizontalLayout_3)
self.verticalLayout.addWidget(self.FuncGroup)
self.gridLayout.addLayout(self.verticalLayout, 0, 1, 1, 2)
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtWidgets.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 704, 21))
self.menubar.setObjectName("menubar")
self.menuFile = QtWidgets.QMenu(self.menubar)
self.menuFile.setObjectName("menuFile")
self.menuEdit = QtWidgets.QMenu(self.menubar)
self.menuEdit.setObjectName("menuEdit")
self.menuView = QtWidgets.QMenu(self.menubar)
self.menuView.setObjectName("menuView")
self.menuWindow = QtWidgets.QMenu(self.menubar)
self.menuWindow.setObjectName("menuWindow")
self.menuSettings = QtWidgets.QMenu(self.menubar)
self.menuSettings.setObjectName("menuSettings")
self.menuHelp = QtWidgets.QMenu(self.menubar)
self.menuHelp.setObjectName("menuHelp")
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtWidgets.QStatusBar(MainWindow)
self.statusbar.setObjectName("statusbar")
MainWindow.setStatusBar(self.statusbar)
self.actionNew = QtWidgets.QAction(MainWindow)
self.actionNew.setObjectName("actionNew")
self.actionOpen = QtWidgets.QAction(MainWindow)
self.actionOpen.setObjectName("actionOpen")
self.actionSave = QtWidgets.QAction(MainWindow)
self.actionSave.setObjectName("actionSave")
self.actionSave_As = QtWidgets.QAction(MainWindow)
self.actionSave_As.setObjectName("actionSave_As")
self.actionClose = QtWidgets.QAction(MainWindow)
self.actionClose.setObjectName("actionClose")
self.actionCopy = QtWidgets.QAction(MainWindow)
self.actionCopy.setObjectName("actionCopy")
self.actionPaste = QtWidgets.QAction(MainWindow)
self.actionPaste.setObjectName("actionPaste")
self.actionCut = QtWidgets.QAction(MainWindow)
self.actionCut.setObjectName("actionCut")
self.actionUndo = QtWidgets.QAction(MainWindow)
self.actionUndo.setObjectName("actionUndo")
self.actionRedo = QtWidgets.QAction(MainWindow)
self.actionRedo.setObjectName("actionRedo")
self.actionDreamSerial_Help = QtWidgets.QAction(MainWindow)
self.actionDreamSerial_Help.setObjectName("actionDreamSerial_Help")
self.menuFile.addAction(self.actionNew)
self.menuFile.addAction(self.actionOpen)
self.menuFile.addSeparator()
self.menuFile.addAction(self.actionSave)
self.menuFile.addAction(self.actionSave_As)
self.menuFile.addAction(self.actionClose)
self.menuEdit.addAction(self.actionUndo)
self.menuEdit.addAction(self.actionRedo)
self.menuEdit.addSeparator()
self.menuEdit.addAction(self.actionCut)
self.menuEdit.addAction(self.actionCopy)
self.menuEdit.addAction(self.actionPaste)
self.menuHelp.addAction(self.actionDreamSerial_Help)
self.menubar.addAction(self.menuFile.menuAction())
self.menubar.addAction(self.menuEdit.menuAction())
self.menubar.addAction(self.menuView.menuAction())
self.menubar.addAction(self.menuWindow.menuAction())
self.menubar.addAction(self.menuSettings.menuAction())
self.menubar.addAction(self.menuHelp.menuAction())
self.retranslateUi(MainWindow)
self.cbbBaudRate.setCurrentIndex(5)
self.cbbDataBit.setCurrentIndex(3)
QtCore.QMetaObject.connectSlotsByName(MainWindow)
def retranslateUi(self, MainWindow):
_translate = QtCore.QCoreApplication.translate
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
self.groupBox.setTitle(_translate("MainWindow", "Port Settings"))
self.label.setText(_translate("MainWindow", "Port Name"))
self.pbOpenPort.setText(_translate("MainWindow", "Open Port"))
self.label_3.setText(_translate("MainWindow", "Data"))
self.cbbBaudRate.setItemText(0, _translate("MainWindow", "300"))
self.cbbBaudRate.setItemText(1, _translate("MainWindow", "600"))
self.cbbBaudRate.setItemText(2, _translate("MainWindow", "1200"))
self.cbbBaudRate.setItemText(3, _translate("MainWindow", "2400"))
self.cbbBaudRate.setItemText(4, _translate("MainWindow", "4800"))
self.cbbBaudRate.setItemText(5, _translate("MainWindow", "9600"))
self.cbbBaudRate.setItemText(6, _translate("MainWindow", "19200"))
self.cbbBaudRate.setItemText(7, _translate("MainWindow", "38400"))
self.cbbBaudRate.setItemText(8, _translate("MainWindow", "57600"))
self.cbbBaudRate.setItemText(9, _translate("MainWindow", "115200"))
self.cbbBaudRate.setItemText(10, _translate("MainWindow", "128000"))
self.cbbBaudRate.setItemText(11, _translate("MainWindow", "256000"))
self.cbbParity.setItemText(0, _translate("MainWindow", "None"))
self.cbbParity.setItemText(1, _translate("MainWindow", "Even"))
self.cbbParity.setItemText(2, _translate("MainWindow", "Odd"))
self.cbbParity.setItemText(3, _translate("MainWindow", "Mark"))
self.cbbParity.setItemText(4, _translate("MainWindow", "Space"))
self.cbbDataBit.setItemText(0, _translate("MainWindow", "5"))
self.cbbDataBit.setItemText(1, _translate("MainWindow", "6"))
self.cbbDataBit.setItemText(2, _translate("MainWindow", "7"))
self.cbbDataBit.setItemText(3, _translate("MainWindow", "8"))
self.label_2.setText(_translate("MainWindow", "Baud Rate"))
self.label_4.setText(_translate("MainWindow", "Parity"))
self.label_5.setText(_translate("MainWindow", "Stop"))
self.cbbStopBit.setItemText(0, _translate("MainWindow", "1"))
self.cbbStopBit.setItemText(1, _translate("MainWindow", "1.5"))
self.cbbStopBit.setItemText(2, _translate("MainWindow", "2"))
self.cbReSend.setText(_translate("MainWindow", "Auto"))
self.cbRxHex.setText(_translate("MainWindow", "HEX"))
self.cbRxAscii.setText(_translate("MainWindow", "ASCII"))
self.pushButton.setText(_translate("MainWindow", "Clear Received"))
self.cbbTxType.setItemText(0, _translate("MainWindow", "ASCII"))
self.cbbTxType.setItemText(1, _translate("MainWindow", "HEX"))
self.cbNewLine.setText(_translate("MainWindow", "New Line"))
self.pbSend.setText(_translate("MainWindow", "Send"))
self.FuncGroup.setTitle(_translate("MainWindow", "Functions"))
self.pbAddSignal.setText(_translate("MainWindow", "Add Signal"))
self.pbRmSignal.setText(_translate("MainWindow", "Remove Signal"))
self.label_6.setText(_translate("MainWindow", "Reg Length"))
self.pbReadAllReg.setText(_translate("MainWindow", "Read All"))
self.label_7.setText(_translate("MainWindow", "Start Address"))
self.label_8.setText(_translate("MainWindow", "Read Length"))
self.pbReadReg.setText(_translate("MainWindow", "Read Reg"))
self.menuFile.setTitle(_translate("MainWindow", "File"))
self.menuEdit.setTitle(_translate("MainWindow", "Edit"))
self.menuView.setTitle(_translate("MainWindow", "View"))
self.menuWindow.setTitle(_translate("MainWindow", "Window"))
self.menuSettings.setTitle(_translate("MainWindow", "Settings"))
self.menuHelp.setTitle(_translate("MainWindow", "Help"))
self.actionNew.setText(_translate("MainWindow", "New"))
self.actionOpen.setText(_translate("MainWindow", "Open"))
self.actionSave.setText(_translate("MainWindow", "Save"))
self.actionSave_As.setText(_translate("MainWindow", "Save As"))
self.actionClose.setText(_translate("MainWindow", "Close"))
self.actionCopy.setText(_translate("MainWindow", "Copy"))
self.actionPaste.setText(_translate("MainWindow", "Paste"))
self.actionCut.setText(_translate("MainWindow", "Cut"))
self.actionUndo.setText(_translate("MainWindow", "Undo"))
self.actionRedo.setText(_translate("MainWindow", "Redo"))
self.actionDreamSerial_Help.setText(_translate("MainWindow", "DreamSerial Help"))
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_())
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/maoyikun2015/DreamSerial.git
git@gitee.com:maoyikun2015/DreamSerial.git
maoyikun2015
DreamSerial
DreamSerial
master

搜索帮助