v0.19
This commit is contained in:
510
need/Ui_GUI.py
Normal file
510
need/Ui_GUI.py
Normal file
@@ -0,0 +1,510 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'GUI.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.4
|
||||
#
|
||||
# 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(826, 619)
|
||||
self.centralwidget = QtWidgets.QWidget(MainWindow)
|
||||
self.centralwidget.setObjectName("centralwidget")
|
||||
self.verticalLayout_8 = QtWidgets.QVBoxLayout(self.centralwidget)
|
||||
self.verticalLayout_8.setObjectName("verticalLayout_8")
|
||||
self.verticalLayout_7 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_7.setObjectName("verticalLayout_7")
|
||||
self.tabWidget = QtWidgets.QTabWidget(self.centralwidget)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("微软雅黑")
|
||||
font.setPointSize(10)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.tabWidget.setFont(font)
|
||||
self.tabWidget.setObjectName("tabWidget")
|
||||
self.tab = QtWidgets.QWidget()
|
||||
self.tab.setObjectName("tab")
|
||||
self.gridLayout = QtWidgets.QGridLayout(self.tab)
|
||||
self.gridLayout.setObjectName("gridLayout")
|
||||
self.horizontalLayout_15 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_15.setObjectName("horizontalLayout_15")
|
||||
self.groupBox = QtWidgets.QGroupBox(self.tab)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("微软雅黑")
|
||||
font.setPointSize(10)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.groupBox.setFont(font)
|
||||
self.groupBox.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
||||
self.groupBox.setFlat(False)
|
||||
self.groupBox.setObjectName("groupBox")
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout(self.groupBox)
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.pushButton = QtWidgets.QPushButton(self.groupBox)
|
||||
self.pushButton.setObjectName("pushButton")
|
||||
self.verticalLayout.addWidget(self.pushButton)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label = QtWidgets.QLabel(self.groupBox)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.lineEdit = QtWidgets.QLineEdit(self.groupBox)
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.horizontalLayout.addWidget(self.lineEdit)
|
||||
self.verticalLayout.addLayout(self.horizontalLayout)
|
||||
self.pushButton_3 = QtWidgets.QPushButton(self.groupBox)
|
||||
self.pushButton_3.setObjectName("pushButton_3")
|
||||
self.verticalLayout.addWidget(self.pushButton_3)
|
||||
self.pushButton_2 = QtWidgets.QPushButton(self.groupBox)
|
||||
self.pushButton_2.setObjectName("pushButton_2")
|
||||
self.verticalLayout.addWidget(self.pushButton_2)
|
||||
self.horizontalLayout_15.addWidget(self.groupBox)
|
||||
self.groupBox_2 = QtWidgets.QGroupBox(self.tab)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("微软雅黑")
|
||||
font.setPointSize(10)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.groupBox_2.setFont(font)
|
||||
self.groupBox_2.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
||||
self.groupBox_2.setFlat(False)
|
||||
self.groupBox_2.setObjectName("groupBox_2")
|
||||
self.verticalLayout_2 = QtWidgets.QVBoxLayout(self.groupBox_2)
|
||||
self.verticalLayout_2.setObjectName("verticalLayout_2")
|
||||
self.pushButton_4 = QtWidgets.QPushButton(self.groupBox_2)
|
||||
self.pushButton_4.setObjectName("pushButton_4")
|
||||
self.verticalLayout_2.addWidget(self.pushButton_4)
|
||||
self.pushButton_6 = QtWidgets.QPushButton(self.groupBox_2)
|
||||
self.pushButton_6.setObjectName("pushButton_6")
|
||||
self.verticalLayout_2.addWidget(self.pushButton_6)
|
||||
self.pushButton_5 = QtWidgets.QPushButton(self.groupBox_2)
|
||||
self.pushButton_5.setObjectName("pushButton_5")
|
||||
self.verticalLayout_2.addWidget(self.pushButton_5)
|
||||
self.pushButton_18 = QtWidgets.QPushButton(self.groupBox_2)
|
||||
self.pushButton_18.setObjectName("pushButton_18")
|
||||
self.verticalLayout_2.addWidget(self.pushButton_18)
|
||||
self.horizontalLayout_15.addWidget(self.groupBox_2)
|
||||
self.groupBox_4 = QtWidgets.QGroupBox(self.tab)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("微软雅黑")
|
||||
font.setPointSize(10)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.groupBox_4.setFont(font)
|
||||
self.groupBox_4.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
||||
self.groupBox_4.setFlat(False)
|
||||
self.groupBox_4.setObjectName("groupBox_4")
|
||||
self.verticalLayout_4 = QtWidgets.QVBoxLayout(self.groupBox_4)
|
||||
self.verticalLayout_4.setObjectName("verticalLayout_4")
|
||||
self.pushButton_11 = QtWidgets.QPushButton(self.groupBox_4)
|
||||
self.pushButton_11.setObjectName("pushButton_11")
|
||||
self.verticalLayout_4.addWidget(self.pushButton_11)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.label_4 = QtWidgets.QLabel(self.groupBox_4)
|
||||
self.label_4.setTextFormat(QtCore.Qt.AutoText)
|
||||
self.label_4.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.horizontalLayout_2.addWidget(self.label_4)
|
||||
self.lineEdit_4 = QtWidgets.QLineEdit(self.groupBox_4)
|
||||
self.lineEdit_4.setObjectName("lineEdit_4")
|
||||
self.horizontalLayout_2.addWidget(self.lineEdit_4)
|
||||
self.verticalLayout_4.addLayout(self.horizontalLayout_2)
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.label_5 = QtWidgets.QLabel(self.groupBox_4)
|
||||
self.label_5.setTextFormat(QtCore.Qt.AutoText)
|
||||
self.label_5.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.horizontalLayout_3.addWidget(self.label_5)
|
||||
self.lineEdit_5 = QtWidgets.QLineEdit(self.groupBox_4)
|
||||
self.lineEdit_5.setObjectName("lineEdit_5")
|
||||
self.horizontalLayout_3.addWidget(self.lineEdit_5)
|
||||
self.verticalLayout_4.addLayout(self.horizontalLayout_3)
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
self.label_6 = QtWidgets.QLabel(self.groupBox_4)
|
||||
self.label_6.setTextFormat(QtCore.Qt.AutoText)
|
||||
self.label_6.setAlignment(QtCore.Qt.AlignCenter)
|
||||
self.label_6.setObjectName("label_6")
|
||||
self.horizontalLayout_4.addWidget(self.label_6)
|
||||
self.lineEdit_6 = QtWidgets.QLineEdit(self.groupBox_4)
|
||||
self.lineEdit_6.setObjectName("lineEdit_6")
|
||||
self.horizontalLayout_4.addWidget(self.lineEdit_6)
|
||||
self.verticalLayout_4.addLayout(self.horizontalLayout_4)
|
||||
self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_5.setObjectName("horizontalLayout_5")
|
||||
self.pushButton_12 = QtWidgets.QPushButton(self.groupBox_4)
|
||||
self.pushButton_12.setObjectName("pushButton_12")
|
||||
self.horizontalLayout_5.addWidget(self.pushButton_12)
|
||||
self.pushButton_13 = QtWidgets.QPushButton(self.groupBox_4)
|
||||
self.pushButton_13.setObjectName("pushButton_13")
|
||||
self.horizontalLayout_5.addWidget(self.pushButton_13)
|
||||
self.verticalLayout_4.addLayout(self.horizontalLayout_5)
|
||||
self.horizontalLayout_15.addWidget(self.groupBox_4)
|
||||
self.gridLayout.addLayout(self.horizontalLayout_15, 0, 0, 1, 1)
|
||||
self.tabWidget.addTab(self.tab, "")
|
||||
self.tab_2 = QtWidgets.QWidget()
|
||||
self.tab_2.setObjectName("tab_2")
|
||||
self.verticalLayout_12 = QtWidgets.QVBoxLayout(self.tab_2)
|
||||
self.verticalLayout_12.setObjectName("verticalLayout_12")
|
||||
self.horizontalLayout_13 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_13.setObjectName("horizontalLayout_13")
|
||||
self.groupBox_3 = QtWidgets.QGroupBox(self.tab_2)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("微软雅黑")
|
||||
font.setPointSize(10)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.groupBox_3.setFont(font)
|
||||
self.groupBox_3.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
||||
self.groupBox_3.setFlat(False)
|
||||
self.groupBox_3.setObjectName("groupBox_3")
|
||||
self.verticalLayout_9 = QtWidgets.QVBoxLayout(self.groupBox_3)
|
||||
self.verticalLayout_9.setObjectName("verticalLayout_9")
|
||||
self.verticalLayout_3 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_3.setObjectName("verticalLayout_3")
|
||||
self.label_2 = QtWidgets.QLabel(self.groupBox_3)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.verticalLayout_3.addWidget(self.label_2)
|
||||
self.lineEdit_2 = QtWidgets.QLineEdit(self.groupBox_3)
|
||||
self.lineEdit_2.setObjectName("lineEdit_2")
|
||||
self.verticalLayout_3.addWidget(self.lineEdit_2)
|
||||
self.label_3 = QtWidgets.QLabel(self.groupBox_3)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.verticalLayout_3.addWidget(self.label_3)
|
||||
self.lineEdit_3 = QtWidgets.QLineEdit(self.groupBox_3)
|
||||
self.lineEdit_3.setObjectName("lineEdit_3")
|
||||
self.verticalLayout_3.addWidget(self.lineEdit_3)
|
||||
self.pushButton_7 = QtWidgets.QPushButton(self.groupBox_3)
|
||||
self.pushButton_7.setObjectName("pushButton_7")
|
||||
self.verticalLayout_3.addWidget(self.pushButton_7)
|
||||
self.pushButton_8 = QtWidgets.QPushButton(self.groupBox_3)
|
||||
self.pushButton_8.setObjectName("pushButton_8")
|
||||
self.verticalLayout_3.addWidget(self.pushButton_8)
|
||||
self.verticalLayout_9.addLayout(self.verticalLayout_3)
|
||||
self.horizontalLayout_13.addWidget(self.groupBox_3)
|
||||
self.groupBox_5 = QtWidgets.QGroupBox(self.tab_2)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("微软雅黑")
|
||||
font.setPointSize(10)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.groupBox_5.setFont(font)
|
||||
self.groupBox_5.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
||||
self.groupBox_5.setFlat(False)
|
||||
self.groupBox_5.setObjectName("groupBox_5")
|
||||
self.verticalLayout_10 = QtWidgets.QVBoxLayout(self.groupBox_5)
|
||||
self.verticalLayout_10.setObjectName("verticalLayout_10")
|
||||
self.verticalLayout_5 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_5.setObjectName("verticalLayout_5")
|
||||
self.pushButton_16 = QtWidgets.QPushButton(self.groupBox_5)
|
||||
self.pushButton_16.setObjectName("pushButton_16")
|
||||
self.verticalLayout_5.addWidget(self.pushButton_16)
|
||||
self.horizontalLayout_6 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_6.setObjectName("horizontalLayout_6")
|
||||
self.label_7 = QtWidgets.QLabel(self.groupBox_5)
|
||||
self.label_7.setObjectName("label_7")
|
||||
self.horizontalLayout_6.addWidget(self.label_7)
|
||||
self.lineEdit_9 = QtWidgets.QLineEdit(self.groupBox_5)
|
||||
self.lineEdit_9.setObjectName("lineEdit_9")
|
||||
self.horizontalLayout_6.addWidget(self.lineEdit_9)
|
||||
self.verticalLayout_5.addLayout(self.horizontalLayout_6)
|
||||
self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_7.setObjectName("horizontalLayout_7")
|
||||
self.label_9 = QtWidgets.QLabel(self.groupBox_5)
|
||||
self.label_9.setObjectName("label_9")
|
||||
self.horizontalLayout_7.addWidget(self.label_9)
|
||||
self.lineEdit_10 = QtWidgets.QLineEdit(self.groupBox_5)
|
||||
self.lineEdit_10.setObjectName("lineEdit_10")
|
||||
self.horizontalLayout_7.addWidget(self.lineEdit_10)
|
||||
self.verticalLayout_5.addLayout(self.horizontalLayout_7)
|
||||
self.horizontalLayout_8 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_8.setObjectName("horizontalLayout_8")
|
||||
self.label_10 = QtWidgets.QLabel(self.groupBox_5)
|
||||
self.label_10.setObjectName("label_10")
|
||||
self.horizontalLayout_8.addWidget(self.label_10)
|
||||
self.lineEdit_11 = QtWidgets.QLineEdit(self.groupBox_5)
|
||||
self.lineEdit_11.setObjectName("lineEdit_11")
|
||||
self.horizontalLayout_8.addWidget(self.lineEdit_11)
|
||||
self.verticalLayout_5.addLayout(self.horizontalLayout_8)
|
||||
self.horizontalLayout_9 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_9.setObjectName("horizontalLayout_9")
|
||||
self.pushButton_14 = QtWidgets.QPushButton(self.groupBox_5)
|
||||
self.pushButton_14.setObjectName("pushButton_14")
|
||||
self.horizontalLayout_9.addWidget(self.pushButton_14)
|
||||
self.pushButton_15 = QtWidgets.QPushButton(self.groupBox_5)
|
||||
self.pushButton_15.setObjectName("pushButton_15")
|
||||
self.horizontalLayout_9.addWidget(self.pushButton_15)
|
||||
self.verticalLayout_5.addLayout(self.horizontalLayout_9)
|
||||
self.verticalLayout_10.addLayout(self.verticalLayout_5)
|
||||
self.horizontalLayout_13.addWidget(self.groupBox_5)
|
||||
self.groupBox_6 = QtWidgets.QGroupBox(self.tab_2)
|
||||
font = QtGui.QFont()
|
||||
font.setFamily("微软雅黑")
|
||||
font.setPointSize(10)
|
||||
font.setBold(False)
|
||||
font.setWeight(50)
|
||||
self.groupBox_6.setFont(font)
|
||||
self.groupBox_6.setAlignment(QtCore.Qt.AlignLeading|QtCore.Qt.AlignLeft|QtCore.Qt.AlignVCenter)
|
||||
self.groupBox_6.setFlat(False)
|
||||
self.groupBox_6.setObjectName("groupBox_6")
|
||||
self.verticalLayout_11 = QtWidgets.QVBoxLayout(self.groupBox_6)
|
||||
self.verticalLayout_11.setObjectName("verticalLayout_11")
|
||||
self.verticalLayout_6 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_6.setObjectName("verticalLayout_6")
|
||||
self.pushButton_17 = QtWidgets.QPushButton(self.groupBox_6)
|
||||
self.pushButton_17.setObjectName("pushButton_17")
|
||||
self.verticalLayout_6.addWidget(self.pushButton_17)
|
||||
self.horizontalLayout_10 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_10.setObjectName("horizontalLayout_10")
|
||||
self.label_8 = QtWidgets.QLabel(self.groupBox_6)
|
||||
self.label_8.setObjectName("label_8")
|
||||
self.horizontalLayout_10.addWidget(self.label_8)
|
||||
self.lineEdit_12 = QtWidgets.QLineEdit(self.groupBox_6)
|
||||
self.lineEdit_12.setObjectName("lineEdit_12")
|
||||
self.horizontalLayout_10.addWidget(self.lineEdit_12)
|
||||
self.verticalLayout_6.addLayout(self.horizontalLayout_10)
|
||||
self.horizontalLayout_11 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_11.setObjectName("horizontalLayout_11")
|
||||
self.label_11 = QtWidgets.QLabel(self.groupBox_6)
|
||||
self.label_11.setObjectName("label_11")
|
||||
self.horizontalLayout_11.addWidget(self.label_11)
|
||||
self.lineEdit_13 = QtWidgets.QLineEdit(self.groupBox_6)
|
||||
self.lineEdit_13.setObjectName("lineEdit_13")
|
||||
self.horizontalLayout_11.addWidget(self.lineEdit_13)
|
||||
self.verticalLayout_6.addLayout(self.horizontalLayout_11)
|
||||
self.horizontalLayout_12 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_12.setObjectName("horizontalLayout_12")
|
||||
self.label_12 = QtWidgets.QLabel(self.groupBox_6)
|
||||
self.label_12.setObjectName("label_12")
|
||||
self.horizontalLayout_12.addWidget(self.label_12)
|
||||
self.lineEdit_14 = QtWidgets.QLineEdit(self.groupBox_6)
|
||||
self.lineEdit_14.setObjectName("lineEdit_14")
|
||||
self.horizontalLayout_12.addWidget(self.lineEdit_14)
|
||||
self.verticalLayout_6.addLayout(self.horizontalLayout_12)
|
||||
self.pushButton_19 = QtWidgets.QPushButton(self.groupBox_6)
|
||||
self.pushButton_19.setObjectName("pushButton_19")
|
||||
self.verticalLayout_6.addWidget(self.pushButton_19)
|
||||
self.verticalLayout_11.addLayout(self.verticalLayout_6)
|
||||
self.horizontalLayout_13.addWidget(self.groupBox_6)
|
||||
self.verticalLayout_12.addLayout(self.horizontalLayout_13)
|
||||
self.tabWidget.addTab(self.tab_2, "")
|
||||
self.tab_3 = QtWidgets.QWidget()
|
||||
self.tab_3.setObjectName("tab_3")
|
||||
self.groupBox_10 = QtWidgets.QGroupBox(self.tab_3)
|
||||
self.groupBox_10.setGeometry(QtCore.QRect(5, 5, 161, 211))
|
||||
self.groupBox_10.setObjectName("groupBox_10")
|
||||
self.verticalLayout_19 = QtWidgets.QVBoxLayout(self.groupBox_10)
|
||||
self.verticalLayout_19.setObjectName("verticalLayout_19")
|
||||
self.pushButton_27 = QtWidgets.QPushButton(self.groupBox_10)
|
||||
self.pushButton_27.setObjectName("pushButton_27")
|
||||
self.verticalLayout_19.addWidget(self.pushButton_27)
|
||||
self.pushButton_28 = QtWidgets.QPushButton(self.groupBox_10)
|
||||
self.pushButton_28.setObjectName("pushButton_28")
|
||||
self.verticalLayout_19.addWidget(self.pushButton_28)
|
||||
self.tabWidget.addTab(self.tab_3, "")
|
||||
self.tab_4 = QtWidgets.QWidget()
|
||||
self.tab_4.setObjectName("tab_4")
|
||||
self.groupBox_11 = QtWidgets.QGroupBox(self.tab_4)
|
||||
self.groupBox_11.setGeometry(QtCore.QRect(5, 5, 246, 211))
|
||||
self.groupBox_11.setObjectName("groupBox_11")
|
||||
self.verticalLayout_20 = QtWidgets.QVBoxLayout(self.groupBox_11)
|
||||
self.verticalLayout_20.setObjectName("verticalLayout_20")
|
||||
self.pushButton_29 = QtWidgets.QPushButton(self.groupBox_11)
|
||||
self.pushButton_29.setObjectName("pushButton_29")
|
||||
self.verticalLayout_20.addWidget(self.pushButton_29)
|
||||
self.verticalLayout_13 = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout_13.setObjectName("verticalLayout_13")
|
||||
self.horizontalLayout_16 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_16.setObjectName("horizontalLayout_16")
|
||||
self.label_13 = QtWidgets.QLabel(self.groupBox_11)
|
||||
self.label_13.setObjectName("label_13")
|
||||
self.horizontalLayout_16.addWidget(self.label_13)
|
||||
self.lineEdit_7 = QtWidgets.QLineEdit(self.groupBox_11)
|
||||
self.lineEdit_7.setObjectName("lineEdit_7")
|
||||
self.horizontalLayout_16.addWidget(self.lineEdit_7)
|
||||
self.verticalLayout_13.addLayout(self.horizontalLayout_16)
|
||||
self.horizontalLayout_17 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_17.setObjectName("horizontalLayout_17")
|
||||
self.label_14 = QtWidgets.QLabel(self.groupBox_11)
|
||||
self.label_14.setObjectName("label_14")
|
||||
self.horizontalLayout_17.addWidget(self.label_14)
|
||||
self.lineEdit_8 = QtWidgets.QLineEdit(self.groupBox_11)
|
||||
self.lineEdit_8.setObjectName("lineEdit_8")
|
||||
self.horizontalLayout_17.addWidget(self.lineEdit_8)
|
||||
self.verticalLayout_13.addLayout(self.horizontalLayout_17)
|
||||
self.horizontalLayout_18 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_18.setObjectName("horizontalLayout_18")
|
||||
self.label_15 = QtWidgets.QLabel(self.groupBox_11)
|
||||
self.label_15.setObjectName("label_15")
|
||||
self.horizontalLayout_18.addWidget(self.label_15)
|
||||
self.lineEdit_15 = QtWidgets.QLineEdit(self.groupBox_11)
|
||||
self.lineEdit_15.setObjectName("lineEdit_15")
|
||||
self.horizontalLayout_18.addWidget(self.lineEdit_15)
|
||||
self.verticalLayout_13.addLayout(self.horizontalLayout_18)
|
||||
self.horizontalLayout_19 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_19.setObjectName("horizontalLayout_19")
|
||||
self.label_16 = QtWidgets.QLabel(self.groupBox_11)
|
||||
self.label_16.setObjectName("label_16")
|
||||
self.horizontalLayout_19.addWidget(self.label_16)
|
||||
self.lineEdit_16 = QtWidgets.QLineEdit(self.groupBox_11)
|
||||
self.lineEdit_16.setObjectName("lineEdit_16")
|
||||
self.horizontalLayout_19.addWidget(self.lineEdit_16)
|
||||
self.verticalLayout_13.addLayout(self.horizontalLayout_19)
|
||||
self.verticalLayout_20.addLayout(self.verticalLayout_13)
|
||||
self.pushButton_30 = QtWidgets.QPushButton(self.groupBox_11)
|
||||
self.pushButton_30.setObjectName("pushButton_30")
|
||||
self.verticalLayout_20.addWidget(self.pushButton_30)
|
||||
self.groupBox_12 = QtWidgets.QGroupBox(self.tab_4)
|
||||
self.groupBox_12.setGeometry(QtCore.QRect(255, 5, 191, 211))
|
||||
self.groupBox_12.setObjectName("groupBox_12")
|
||||
self.verticalLayout_21 = QtWidgets.QVBoxLayout(self.groupBox_12)
|
||||
self.verticalLayout_21.setObjectName("verticalLayout_21")
|
||||
self.pushButton_31 = QtWidgets.QPushButton(self.groupBox_12)
|
||||
self.pushButton_31.setObjectName("pushButton_31")
|
||||
self.verticalLayout_21.addWidget(self.pushButton_31)
|
||||
self.horizontalLayout_20 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_20.setObjectName("horizontalLayout_20")
|
||||
self.label_17 = QtWidgets.QLabel(self.groupBox_12)
|
||||
self.label_17.setObjectName("label_17")
|
||||
self.horizontalLayout_20.addWidget(self.label_17)
|
||||
self.lineEdit_17 = QtWidgets.QLineEdit(self.groupBox_12)
|
||||
self.lineEdit_17.setObjectName("lineEdit_17")
|
||||
self.horizontalLayout_20.addWidget(self.lineEdit_17)
|
||||
self.verticalLayout_21.addLayout(self.horizontalLayout_20)
|
||||
self.pushButton_32 = QtWidgets.QPushButton(self.groupBox_12)
|
||||
self.pushButton_32.setObjectName("pushButton_32")
|
||||
self.verticalLayout_21.addWidget(self.pushButton_32)
|
||||
self.tabWidget.addTab(self.tab_4, "")
|
||||
self.verticalLayout_7.addWidget(self.tabWidget)
|
||||
self.textBrowser = QtWidgets.QTextBrowser(self.centralwidget)
|
||||
self.textBrowser.setObjectName("textBrowser")
|
||||
self.verticalLayout_7.addWidget(self.textBrowser)
|
||||
self.horizontalLayout_14 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_14.setObjectName("horizontalLayout_14")
|
||||
spacerItem = QtWidgets.QSpacerItem(618, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
|
||||
self.horizontalLayout_14.addItem(spacerItem)
|
||||
self.pushButton_9 = QtWidgets.QPushButton(self.centralwidget)
|
||||
self.pushButton_9.setObjectName("pushButton_9")
|
||||
self.horizontalLayout_14.addWidget(self.pushButton_9)
|
||||
self.pushButton_10 = QtWidgets.QPushButton(self.centralwidget)
|
||||
self.pushButton_10.setObjectName("pushButton_10")
|
||||
self.horizontalLayout_14.addWidget(self.pushButton_10)
|
||||
self.verticalLayout_7.addLayout(self.horizontalLayout_14)
|
||||
self.progressBar = QtWidgets.QProgressBar(self.centralwidget)
|
||||
sizePolicy = QtWidgets.QSizePolicy(QtWidgets.QSizePolicy.Preferred, QtWidgets.QSizePolicy.Preferred)
|
||||
sizePolicy.setHorizontalStretch(0)
|
||||
sizePolicy.setVerticalStretch(0)
|
||||
sizePolicy.setHeightForWidth(self.progressBar.sizePolicy().hasHeightForWidth())
|
||||
self.progressBar.setSizePolicy(sizePolicy)
|
||||
self.progressBar.setProperty("value", 0)
|
||||
self.progressBar.setObjectName("progressBar")
|
||||
self.verticalLayout_7.addWidget(self.progressBar)
|
||||
self.verticalLayout_8.addLayout(self.verticalLayout_7)
|
||||
MainWindow.setCentralWidget(self.centralwidget)
|
||||
self.menubar = QtWidgets.QMenuBar(MainWindow)
|
||||
self.menubar.setGeometry(QtCore.QRect(0, 0, 826, 22))
|
||||
self.menubar.setObjectName("menubar")
|
||||
self.menu = QtWidgets.QMenu(self.menubar)
|
||||
self.menu.setObjectName("menu")
|
||||
self.menu_2 = QtWidgets.QMenu(self.menubar)
|
||||
self.menu_2.setObjectName("menu_2")
|
||||
MainWindow.setMenuBar(self.menubar)
|
||||
self.statusbar = QtWidgets.QStatusBar(MainWindow)
|
||||
self.statusbar.setObjectName("statusbar")
|
||||
MainWindow.setStatusBar(self.statusbar)
|
||||
self.actionopen = QtWidgets.QAction(MainWindow)
|
||||
self.actionopen.setObjectName("actionopen")
|
||||
self.actionclose = QtWidgets.QAction(MainWindow)
|
||||
self.actionclose.setObjectName("actionclose")
|
||||
self.actionAbout = QtWidgets.QAction(MainWindow)
|
||||
self.actionAbout.setObjectName("actionAbout")
|
||||
self.action_3 = QtWidgets.QAction(MainWindow)
|
||||
self.action_3.setObjectName("action_3")
|
||||
self.actionIEEE754 = QtWidgets.QAction(MainWindow)
|
||||
self.actionIEEE754.setObjectName("actionIEEE754")
|
||||
self.menu.addAction(self.actionopen)
|
||||
self.menu.addSeparator()
|
||||
self.menu.addAction(self.action_3)
|
||||
self.menu_2.addAction(self.actionAbout)
|
||||
self.menu_2.addAction(self.actionIEEE754)
|
||||
self.menubar.addAction(self.menu.menuAction())
|
||||
self.menubar.addAction(self.menu_2.menuAction())
|
||||
|
||||
self.retranslateUi(MainWindow)
|
||||
self.tabWidget.setCurrentIndex(3)
|
||||
QtCore.QMetaObject.connectSlotsByName(MainWindow)
|
||||
|
||||
def retranslateUi(self, MainWindow):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
|
||||
self.groupBox.setTitle(_translate("MainWindow", "大纲转说明-鉴定模板"))
|
||||
self.pushButton.setText(_translate("MainWindow", "选择大纲文档"))
|
||||
self.label.setText(_translate("MainWindow", "设计人员:"))
|
||||
self.pushButton_3.setText(_translate("MainWindow", "测试记录转说明"))
|
||||
self.pushButton_2.setText(_translate("MainWindow", "开始转换"))
|
||||
self.groupBox_2.setTitle(_translate("MainWindow", "追踪关系填写"))
|
||||
self.pushButton_4.setText(_translate("MainWindow", "选择文件"))
|
||||
self.pushButton_6.setText(_translate("MainWindow", "大纲追踪关系填写(依据大纲文件)"))
|
||||
self.pushButton_5.setText(_translate("MainWindow", "测试说明追踪填写(依据说明文件)"))
|
||||
self.pushButton_18.setText(_translate("MainWindow", "测试报告追踪填写(依据记录文件)"))
|
||||
self.groupBox_4.setTitle(_translate("MainWindow", "根据说明生成测试记录"))
|
||||
self.pushButton_11.setText(_translate("MainWindow", "选择文件"))
|
||||
self.label_4.setText(_translate("MainWindow", "测试人员:"))
|
||||
self.label_5.setText(_translate("MainWindow", "监测人员:"))
|
||||
self.label_6.setText(_translate("MainWindow", "测试时间:"))
|
||||
self.pushButton_12.setText(_translate("MainWindow", "说明生成记录"))
|
||||
self.pushButton_13.setText(_translate("MainWindow", "记录反向生成说明"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab), _translate("MainWindow", "文档生产工具"))
|
||||
self.groupBox_3.setTitle(_translate("MainWindow", "UAS单元测试转换"))
|
||||
self.label_2.setText(_translate("MainWindow", "被测软件名:"))
|
||||
self.label_3.setText(_translate("MainWindow", "被测软件标识:"))
|
||||
self.pushButton_7.setText(_translate("MainWindow", "请选择SAU报告文档"))
|
||||
self.pushButton_8.setText(_translate("MainWindow", "开始转换"))
|
||||
self.groupBox_5.setTitle(_translate("MainWindow", "自动填充"))
|
||||
self.pushButton_16.setText(_translate("MainWindow", "选择文档"))
|
||||
self.label_7.setText(_translate("MainWindow", "单元格左侧:"))
|
||||
self.label_9.setText(_translate("MainWindow", "填充的内容:"))
|
||||
self.label_10.setText(_translate("MainWindow", "填充的数量:"))
|
||||
self.pushButton_14.setText(_translate("MainWindow", "清空单元格"))
|
||||
self.pushButton_15.setText(_translate("MainWindow", "填充"))
|
||||
self.groupBox_6.setTitle(_translate("MainWindow", "提取单元格标题右侧的单元格内容"))
|
||||
self.pushButton_17.setText(_translate("MainWindow", "选择文档"))
|
||||
self.label_8.setText(_translate("MainWindow", "单元格标题:"))
|
||||
self.label_11.setText(_translate("MainWindow", "单元格标题:"))
|
||||
self.label_12.setText(_translate("MainWindow", "单元格标题:"))
|
||||
self.pushButton_19.setText(_translate("MainWindow", "点击提取"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_2), _translate("MainWindow", "文档小工具"))
|
||||
self.groupBox_10.setTitle(_translate("MainWindow", "部件测试表格"))
|
||||
self.pushButton_27.setText(_translate("MainWindow", "选择UAS文件"))
|
||||
self.pushButton_28.setText(_translate("MainWindow", "点击生成"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_3), _translate("MainWindow", "报告生成工具"))
|
||||
self.groupBox_11.setTitle(_translate("MainWindow", "FPGA记录自动填写"))
|
||||
self.pushButton_29.setText(_translate("MainWindow", "选择FPGA记录文件"))
|
||||
self.label_13.setText(_translate("MainWindow", "测试时间"))
|
||||
self.label_14.setText(_translate("MainWindow", "测试人员"))
|
||||
self.label_15.setText(_translate("MainWindow", "监测人员"))
|
||||
self.label_16.setText(_translate("MainWindow", "项目编号"))
|
||||
self.pushButton_30.setText(_translate("MainWindow", "自动填写开始"))
|
||||
self.groupBox_12.setTitle(_translate("MainWindow", "FPGA记录转说明"))
|
||||
self.pushButton_31.setText(_translate("MainWindow", "请选择完整FPGA记录文件"))
|
||||
self.label_17.setText(_translate("MainWindow", "设计人员"))
|
||||
self.pushButton_32.setText(_translate("MainWindow", "点击生成说明"))
|
||||
self.tabWidget.setTabText(self.tabWidget.indexOf(self.tab_4), _translate("MainWindow", "FPGA工具"))
|
||||
self.pushButton_9.setText(_translate("MainWindow", "清空消息"))
|
||||
self.pushButton_10.setText(_translate("MainWindow", "显示帮助"))
|
||||
self.menu.setTitle(_translate("MainWindow", "文件"))
|
||||
self.menu_2.setTitle(_translate("MainWindow", "工具"))
|
||||
self.actionopen.setText(_translate("MainWindow", "打开文件"))
|
||||
self.actionclose.setText(_translate("MainWindow", "close"))
|
||||
self.actionAbout.setText(_translate("MainWindow", "关于工具"))
|
||||
self.action_3.setText(_translate("MainWindow", "退出"))
|
||||
self.actionIEEE754.setText(_translate("MainWindow", "IEEE转换工具"))
|
||||
50
need/about.py
Normal file
50
need/about.py
Normal file
@@ -0,0 +1,50 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'about.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.12.1
|
||||
#
|
||||
# WARNING! All changes made in this file will be lost!
|
||||
|
||||
from PyQt5 import QtCore, QtGui, QtWidgets
|
||||
|
||||
|
||||
class Ui_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(290, 80)
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout(Dialog)
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label = QtWidgets.QLabel(Dialog)
|
||||
self.label.setText("")
|
||||
self.label.setPixmap(QtGui.QPixmap(r'need/static/zxlogo.gif'))
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.verticalLayout = QtWidgets.QVBoxLayout()
|
||||
self.verticalLayout.setObjectName("verticalLayout")
|
||||
self.label_2 = QtWidgets.QLabel(Dialog)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.verticalLayout.addWidget(self.label_2)
|
||||
self.label_5 = QtWidgets.QLabel(Dialog)
|
||||
self.label_5.setText("")
|
||||
self.label_5.setObjectName("label_5")
|
||||
self.verticalLayout.addWidget(self.label_5)
|
||||
self.label_3 = QtWidgets.QLabel(Dialog)
|
||||
self.label_3.setObjectName("label_3")
|
||||
self.verticalLayout.addWidget(self.label_3)
|
||||
self.label_4 = QtWidgets.QLabel(Dialog)
|
||||
self.label_4.setObjectName("label_4")
|
||||
self.verticalLayout.addWidget(self.label_4)
|
||||
spacerItem = QtWidgets.QSpacerItem(20, 40, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
|
||||
self.verticalLayout.addItem(spacerItem)
|
||||
self.horizontalLayout.addLayout(self.verticalLayout)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "关于"))
|
||||
self.label_2.setText(_translate("Dialog", "软件名称:CTTools测试工具集合"))
|
||||
self.label_3.setText(_translate("Dialog", "版本:V0.12/2022"))
|
||||
self.label_4.setText(_translate("Dialog", "作者:chen/wang"))
|
||||
BIN
need/document_templates/FPGA记录to说明模板.docx
Normal file
BIN
need/document_templates/FPGA记录to说明模板.docx
Normal file
Binary file not shown.
BIN
need/document_templates/SunwiseAUnit单元测试转换模板.docx
Normal file
BIN
need/document_templates/SunwiseAUnit单元测试转换模板.docx
Normal file
Binary file not shown.
BIN
need/document_templates/cpu新记录to说明模版.docx
Normal file
BIN
need/document_templates/cpu新记录to说明模版.docx
Normal file
Binary file not shown.
BIN
need/document_templates/get_content.docx
Normal file
BIN
need/document_templates/get_content.docx
Normal file
Binary file not shown.
BIN
need/document_templates/tpl模板文件.zip
Normal file
BIN
need/document_templates/tpl模板文件.zip
Normal file
Binary file not shown.
BIN
need/document_templates/~$GA记录to说明模板.docx
Normal file
BIN
need/document_templates/~$GA记录to说明模板.docx
Normal file
Binary file not shown.
BIN
need/document_templates/反向测试说明模板.docx
Normal file
BIN
need/document_templates/反向测试说明模板.docx
Normal file
Binary file not shown.
BIN
need/document_templates/大纲追踪模板.docx
Normal file
BIN
need/document_templates/大纲追踪模板.docx
Normal file
Binary file not shown.
13
need/document_templates/报告模板变量.md
Normal file
13
need/document_templates/报告模板变量.md
Normal file
@@ -0,0 +1,13 @@
|
||||
# 报告模板变量
|
||||
|
||||
## 1.判断变量
|
||||
|
||||
- is_jianding-是否为鉴定文件变量,{% if is_jianding == ‘1’ %},string类型
|
||||
|
||||
|
||||
|
||||
## 2.用户输入变量
|
||||
|
||||
- proj_bianhao-项目编号,例如R2255
|
||||
- soft_name-软件名,例如XX图像处理软件
|
||||
-
|
||||
BIN
need/document_templates/报告追踪模板.docx
Normal file
BIN
need/document_templates/报告追踪模板.docx
Normal file
Binary file not shown.
BIN
need/document_templates/文档模板/测评大纲模板-2022年10月11日.docx
Normal file
BIN
need/document_templates/文档模板/测评大纲模板-2022年10月11日.docx
Normal file
Binary file not shown.
BIN
need/document_templates/文档模板/测评报告模板-2022年10月11日.docx
Normal file
BIN
need/document_templates/文档模板/测评报告模板-2022年10月11日.docx
Normal file
Binary file not shown.
BIN
need/document_templates/测评报告模板.docx
Normal file
BIN
need/document_templates/测评报告模板.docx
Normal file
Binary file not shown.
BIN
need/document_templates/测试说明模板.docx
Normal file
BIN
need/document_templates/测试说明模板.docx
Normal file
Binary file not shown.
BIN
need/document_templates/说明生成记录模板.docx
Normal file
BIN
need/document_templates/说明生成记录模板.docx
Normal file
Binary file not shown.
BIN
need/document_templates/说明追踪模板.docx
Normal file
BIN
need/document_templates/说明追踪模板.docx
Normal file
Binary file not shown.
BIN
need/document_templates/部件桩函数工具1.docx
Normal file
BIN
need/document_templates/部件桩函数工具1.docx
Normal file
Binary file not shown.
146
need/fpga_JtoS.py
Normal file
146
need/fpga_JtoS.py
Normal file
@@ -0,0 +1,146 @@
|
||||
from PyQt5 import QtCore
|
||||
from PyQt5.QtCore import pyqtSignal
|
||||
from pathlib import *
|
||||
from PyQt5.QtWidgets import QMessageBox
|
||||
from docxtpl import DocxTemplate, InlineImage
|
||||
from docx import Document
|
||||
from docx.table import Table
|
||||
from docx.text.paragraph import Paragraph
|
||||
import io
|
||||
|
||||
class create_FPGA_JtoS(QtCore.QThread):
|
||||
sin_out = pyqtSignal(str)
|
||||
|
||||
def __init__(self, parent):
|
||||
super().__init__()
|
||||
self.parent = parent
|
||||
|
||||
def run(self):
|
||||
self.sin_out.emit("进入测试记录转说明线程......")
|
||||
self.sin_out.emit("开始转换......")
|
||||
# 如果没有选择文件路径则退出
|
||||
if not self.parent.open_file_name:
|
||||
self.sin_out.emit('nofile')
|
||||
self.parent.tabWidget.setEnabled(True)
|
||||
return
|
||||
|
||||
# 打开模板文件进行渲染,然后就是用docxtpl生成用例
|
||||
try:
|
||||
tpl_path = Path.cwd() / "need" / "document_templates" / "FPGA记录to说明模板.docx"
|
||||
self.sin_out.emit('导入模板文件路径为:' + str(tpl_path))
|
||||
tpl = DocxTemplate(tpl_path) # 模板导入成功
|
||||
|
||||
except:
|
||||
QMessageBox.warning(self.parent, "出错了", "导入模板出错请检查模板文件是否存在或名字不正确")
|
||||
return
|
||||
|
||||
try:
|
||||
doc = Document(self.parent.open_file_name[0])
|
||||
self.sin_out.emit('已识别到FPGA测试记录文件...')
|
||||
except:
|
||||
self.sin_out.emit('open failed:选择的文档')
|
||||
self.parent.tabWidget.setEnabled(True)
|
||||
return
|
||||
|
||||
self.sin_out.emit('复制测试说明文档模板到本程序所在目录...')
|
||||
curpath = Path.cwd() / 'need'
|
||||
shuoming_path_tmp = curpath / 'document_templates' / 'FPGA记录to说明模板.docx'
|
||||
print(shuoming_path_tmp)
|
||||
if shuoming_path_tmp.is_file():
|
||||
self.sin_out.emit('已检测到有说明模板文件...')
|
||||
else:
|
||||
self.sin_out.emit('open failed:选择的文档')
|
||||
return
|
||||
|
||||
# 获取表格数量
|
||||
tables = doc.tables
|
||||
tb_count = len(tables)
|
||||
self.sin_out.emit('total:' + str(tb_count))
|
||||
# 创建一个字典来储存单个用例
|
||||
data_list = []
|
||||
table_index = 1
|
||||
# 获取表格数量
|
||||
for ele in doc._element.body.iter():
|
||||
data = {'type': ''}
|
||||
if ele.tag.endswith('}p'):
|
||||
elePstyle = ele.findall('.//{http://schemas.openxmlformats.org/wordprocessingml/2006/main}pStyle')
|
||||
if len(elePstyle) >= 1:
|
||||
parag = Paragraph(ele, doc)
|
||||
if parag.style.name.startswith("Heading") or parag.style.name.startswith("标题"):
|
||||
rank = parag.style.name.split(" ")[-1]
|
||||
text = parag.text
|
||||
if text == "" or text.startswith("文档齐套性审查单") \
|
||||
or text.startswith("软件研制任务书审查单") \
|
||||
or text.startswith("附录") \
|
||||
or text.startswith("附件") \
|
||||
or text.startswith("需求文档审查单"):
|
||||
pass
|
||||
else:
|
||||
data['type'] = rank
|
||||
data['title'] = text
|
||||
data_list.append(data)
|
||||
elif ele.tag.endswith('}tbl'):
|
||||
data = {'name': '', 'biaoshi': '', 'zhuizong': [], 'zongsu': '', 'init': '', 'qianti': '', 'step': []}
|
||||
data['type'] = 'table'
|
||||
table = Table(ele, doc)
|
||||
if table.cell(0, 0).text == '测试用例名称':
|
||||
self.sin_out.emit(str(table_index))
|
||||
|
||||
try:
|
||||
self.sin_out.emit(str(table_index))
|
||||
self.sin_out.emit(f'正在处理第{table_index}个表格')
|
||||
# 1、获取测试用例名称
|
||||
data['name'] = table.cell(0, 3).text
|
||||
# 2、获取用例标识
|
||||
data['biaoshi'] = table.cell(0, 9).text
|
||||
# 3、获取追踪关系 注意word中换行为\r\x07
|
||||
temp = table.cell(1, 3)
|
||||
for tem in temp.paragraphs:
|
||||
data['zhuizong'].append(tem.text)
|
||||
# 4、获取综述
|
||||
data['zongsu'] = table.cell(2, 3).text
|
||||
# 5、初始化
|
||||
data['init'] = table.cell(3, 3).text
|
||||
# 6、获取前提与约束
|
||||
data['qianti'] = table.cell(4, 3).text
|
||||
# 7、获取步骤信息-总行数减去12为步骤行数
|
||||
row_count = len(table.rows)
|
||||
step_count = row_count - 12
|
||||
for j in range(step_count):
|
||||
buzhou = {'shuru': '', 'yuqi': '', 'num': '', 'image': '', 'is_image': '0'}
|
||||
buzhou['num'] = table.rows[7 + j].cells[0].text
|
||||
buzhou['shuru'] = table.rows[7 + j].cells[2].text
|
||||
cel = table.rows[7 + j].cells[2]
|
||||
if len(
|
||||
cel._element.findall('.//{http://schemas.openxmlformats.org/wordprocessingml/2006/main}drawing')
|
||||
) > 0:
|
||||
img_ele = cel._element.xpath('.//pic:pic')[0]
|
||||
embed = img_ele.xpath('.//a:blip/@r:embed')[0]
|
||||
related_part = doc.part.related_parts[embed]
|
||||
image = related_part.image
|
||||
# blob属性就是二进制图片属性
|
||||
image_bytes = image.blob
|
||||
buzhou['image'] = InlineImage(tpl, io.BytesIO(image_bytes))
|
||||
buzhou['is_image'] = '1'
|
||||
buzhou['yuqi'] = table.rows[7 + j].cells[4].text
|
||||
data['step'].append(buzhou)
|
||||
# 8、最后加入data_list
|
||||
data_list.append(data)
|
||||
table_index += 1
|
||||
except:
|
||||
self.sin_out.emit(f'第{table_index}个表格处理错误!')
|
||||
table_index += 1
|
||||
pass
|
||||
# 开始渲染模板文件
|
||||
try:
|
||||
self.sin_out.emit(str(tb_count + 1))
|
||||
context = {
|
||||
"tables": data_list,
|
||||
"renyuan": self.parent.lineEdit_17.text(),
|
||||
}
|
||||
tpl.render(context)
|
||||
tpl.save("FPGA反向生成的说明文档.docx")
|
||||
self.sin_out.emit('stopsuccess')
|
||||
except:
|
||||
self.sin_out.emit('stoperror')
|
||||
return
|
||||
155
need/fpga_record_thrend.py
Normal file
155
need/fpga_record_thrend.py
Normal file
@@ -0,0 +1,155 @@
|
||||
import pythoncom
|
||||
from PyQt5 import QtCore
|
||||
from PyQt5.QtCore import pyqtSignal
|
||||
from pathlib import *
|
||||
from docx import Document
|
||||
import re
|
||||
from docx.shared import Pt
|
||||
|
||||
#常量
|
||||
TABLE_FONT_SIZE = Pt(10.5)
|
||||
|
||||
class create_FPGA_record(QtCore.QThread):
|
||||
sin_out = pyqtSignal(str)
|
||||
|
||||
def __init__(self,parent):
|
||||
super().__init__()
|
||||
self.parent = parent
|
||||
|
||||
def run(self):
|
||||
|
||||
|
||||
self.sin_out.emit("开始填写FPGA记录......")
|
||||
self.sin_out.emit("开始填写文档......")
|
||||
|
||||
#如果没有选择路径则退出
|
||||
if not self.parent.open_file_name:
|
||||
self.sin_out.emit('nofile')
|
||||
self.parent.tabWidget.setEnabled(True)
|
||||
return
|
||||
|
||||
#告诉windows单线程
|
||||
pythoncom.CoInitialize()
|
||||
#在用户选择的目录中查找UAS单位测试报告文档
|
||||
self.sin_out.emit('打开单元测试原文件...')
|
||||
|
||||
try:
|
||||
doc = Document(self.parent.open_file_name[0])
|
||||
except:
|
||||
self.sin_out.emit('open failed:选择的文档')
|
||||
pythoncom.CoUninitialize()
|
||||
self.parent.tabWidget.setEnabled(True)
|
||||
return
|
||||
|
||||
table_count = len(doc.tables)
|
||||
self.sin_out.emit('total:'+ str(table_count))
|
||||
# 如果大纲标识一致需要累加
|
||||
static_dagang_biaoshi = ''
|
||||
index = 1
|
||||
num = 0
|
||||
for table in doc.tables:
|
||||
num += 1
|
||||
self.sin_out.emit(str(num))
|
||||
self.sin_out.emit(f'正在处理第{num}个表格')
|
||||
if table.cell(0,0).text == '测试用例名称':
|
||||
|
||||
try:
|
||||
#~~~~~~~~~~~~~~~第一步处理表格中所在标题填入~~~~~~~~~~~~~~~
|
||||
prev_para = table._element.getprevious()
|
||||
# 如果找到前一个元素是paragraph、但没有找到子节点有pStyle节点,则再往上找
|
||||
while prev_para is not None and prev_para.tag.endswith('}p') and \
|
||||
len(prev_para.findall('.//{http://schemas.openxmlformats.org/wordprocessingml/2006/main}pStyle')) == 0:
|
||||
prev_para = prev_para.getprevious()
|
||||
if prev_para is not None and prev_para.tag.endswith('}p'):
|
||||
t_ele = prev_para.findall('.//{http://schemas.openxmlformats.org/wordprocessingml/2006/main}t')
|
||||
title = ''
|
||||
for i in range(len(t_ele)):
|
||||
title = title + t_ele[i].text
|
||||
# 将title放入到cell(0,1)-完成第一步了
|
||||
table.cell(0,3).text = title
|
||||
|
||||
|
||||
#~~~~~~~~~~~~~~~第二步找到追踪关系中大纲标识更改后填入~~~~~~~~~~~~~~~(要求用户必须3行!)
|
||||
temp = table.cell(1,3).text.split("\n")[-1]
|
||||
dagang_biaoshi = re.split('[::]',temp)[-1]
|
||||
|
||||
# 如果大纲标识一致,则累加
|
||||
if dagang_biaoshi != static_dagang_biaoshi:
|
||||
static_dagang_biaoshi = dagang_biaoshi
|
||||
yongli_biaoshi = dagang_biaoshi.replace('XQ','R1_YL') + '_001'
|
||||
# 填入标识
|
||||
table.cell(0,8).text = yongli_biaoshi
|
||||
index = 1
|
||||
else:
|
||||
index += 1
|
||||
if len(str(index)) <= 3:
|
||||
str_index = (3-len(str(index)))*'0' + str(index)
|
||||
yongli_biaoshi = dagang_biaoshi.replace('XQ','R1_YL') + '_' + str_index
|
||||
table.cell(0,8).text = yongli_biaoshi
|
||||
|
||||
#~~~~~~~~~~~~~~~输出用户知道~~~~~~~~~~~~~~~
|
||||
self.sin_out.emit(f'处理完毕测试项:{title},{yongli_biaoshi}')
|
||||
|
||||
#~~~~~~~~~~~~~~~第三步填写“测试用例综述”~~~~~~~~~~~~~~~
|
||||
if title:
|
||||
zongsu_string = f'使用功能仿真的方法,对{title}进行测试'
|
||||
table.cell(2,3).text = zongsu_string
|
||||
else:
|
||||
print('注意:未识别到正确标题!,填入综述失败')
|
||||
|
||||
#~~~~~~~~~~~~~~~第四步“执行状态”填写为已执行、“测试时间”、“测试人员”、“监测人员”为可更改项~~~~~~~~~~~~~~~
|
||||
#执行状态-固定!
|
||||
table.rows[-4].cells[2].text = '已执行'
|
||||
#测试人员
|
||||
table.rows[-3].cells[2].text = self.parent.lineEdit_8.text()
|
||||
table.rows[-4].cells[7].text = self.parent.lineEdit_7.text()
|
||||
table.rows[-3].cells[7].text = self.parent.lineEdit_15.text()
|
||||
|
||||
#~~~~~~~~~~~~~~~第五步填写当通过与否为通过时,写"/"~~~~~~~~~~~~~~~
|
||||
table.rows[-2].cells[2].text = '/'
|
||||
|
||||
# 判断有几个步骤-根据总行数判断,并循环查看是否为通过
|
||||
flag = 1
|
||||
for i in range(len(table.rows) - 12):
|
||||
temp = table.rows[-6 - i].cells[-1].text
|
||||
if temp == '不通过':
|
||||
flag = 0
|
||||
if temp == '未通过':
|
||||
flag = 0
|
||||
if flag == 1:
|
||||
table.rows[-2].cells[2].text = '/'
|
||||
else:
|
||||
project_code = self.parent.lineEdit_16.text()
|
||||
pro_biaoshi = f'PT_{project_code}_'
|
||||
table.rows[-2].cells[2].text = pro_biaoshi
|
||||
|
||||
#~~~~~~~~~~~~~~~第六步截图为空填写‘/’否则不变~~~~~~~~~~~~~~~
|
||||
cell = table.cell(-5,0)
|
||||
has_image = False
|
||||
for paragraph in cell.paragraphs:
|
||||
tupian_list = paragraph._element.findall('.//{http://schemas.openxmlformats.org/wordprocessingml/2006/main}drawing')
|
||||
if len(tupian_list) != 0:
|
||||
has_image = True
|
||||
if has_image:
|
||||
pass
|
||||
else:
|
||||
table.cell(-5,0).text = '/'
|
||||
except:
|
||||
self.sin_out.emit(f'第{num}个表格处理失败,请查看!!!')
|
||||
pass
|
||||
|
||||
# 设置字体
|
||||
for row in table.rows:
|
||||
for cell in row.cells:
|
||||
for paragraph in cell.paragraphs:
|
||||
for run in paragraph.runs:
|
||||
run.font.size = TABLE_FONT_SIZE
|
||||
# 保存文档
|
||||
try:
|
||||
doc.save('~新生产的fpga记录~.docx')
|
||||
self.sin_out.emit('stopsuccess')
|
||||
except:
|
||||
self.sin_out.emit('stoperror')
|
||||
return
|
||||
|
||||
|
||||
2186
need/main.py
Normal file
2186
need/main.py
Normal file
File diff suppressed because it is too large
Load Diff
170
need/new_JtoS.py
Normal file
170
need/new_JtoS.py
Normal file
@@ -0,0 +1,170 @@
|
||||
from PyQt5 import QtCore
|
||||
from PyQt5.QtCore import pyqtSignal
|
||||
from pathlib import * # noqa: F403
|
||||
from PyQt5.QtWidgets import QMessageBox
|
||||
from docxtpl import DocxTemplate, InlineImage # type:ignore
|
||||
from docx import Document
|
||||
from docx.table import Table
|
||||
from docx.text.paragraph import Paragraph
|
||||
import io
|
||||
|
||||
|
||||
class create_new_JtoS(QtCore.QThread):
|
||||
sin_out = pyqtSignal(str)
|
||||
PREFIX = r'{http://schemas.openxmlformats.org/wordprocessingml/2006/main}'
|
||||
|
||||
def __init__(self, parent):
|
||||
super().__init__()
|
||||
self.parent = parent
|
||||
|
||||
def run(self):
|
||||
self.sin_out.emit("进入CPU测试记录转说明线程......")
|
||||
self.sin_out.emit("开始转换......")
|
||||
# 如果没有选择文件路径则退出
|
||||
if not self.parent.open_file_name:
|
||||
self.sin_out.emit('nofile')
|
||||
self.parent.tabWidget.setEnabled(True)
|
||||
return
|
||||
|
||||
# 打开模板文件进行渲染,然后就是用docxtpl生成用例
|
||||
try:
|
||||
tpl_path = Path.cwd( # noqa: F405
|
||||
) / "need" / "document_templates" / "cpu新记录to说明模版.docx"
|
||||
self.sin_out.emit('导入模板文件路径为:' + str(tpl_path))
|
||||
tpl = DocxTemplate(tpl_path) # 模板导入成功
|
||||
|
||||
except: # noqa: E722
|
||||
QMessageBox.warning(self.parent, "出错了", "导入模板出错请检查模板文件是否存在或名字不正确")
|
||||
return
|
||||
|
||||
try:
|
||||
doc = Document(self.parent.open_file_name[0])
|
||||
self.sin_out.emit('已识别到CPU测试记录文件...')
|
||||
except: # noqa: E722
|
||||
self.sin_out.emit('open failed:选择的文档')
|
||||
self.parent.tabWidget.setEnabled(True)
|
||||
return
|
||||
|
||||
self.sin_out.emit('复制测试说明文档模板到本程序所在目录...')
|
||||
curpath = Path.cwd() / 'need' # noqa: F405
|
||||
shuoming_path_tmp = curpath / 'document_templates' / 'cpu新记录to说明模版.docx'
|
||||
print(shuoming_path_tmp)
|
||||
if shuoming_path_tmp.is_file():
|
||||
self.sin_out.emit('已检测到有说明模板文件...')
|
||||
else:
|
||||
self.sin_out.emit('open failed:选择的文档')
|
||||
return
|
||||
|
||||
# 获取表格数量
|
||||
tables = doc.tables
|
||||
tb_count = len(tables)
|
||||
self.sin_out.emit('total:' + str(tb_count))
|
||||
# 创建一个字典来储存单个用例
|
||||
data_list = []
|
||||
table_index = 1
|
||||
# 获取表格数量
|
||||
for ele in doc._element.body.iter():
|
||||
data = {'type': ''}
|
||||
if ele.tag.endswith('}p'):
|
||||
for child in ele.iter():
|
||||
if child.tag.endswith('pStyle'):
|
||||
rank = child.get(f"{self.PREFIX}val")
|
||||
t_ele = ele.findall(
|
||||
f".//{self.PREFIX}t") # type:ignore
|
||||
title = ''
|
||||
for i in range(len(t_ele)):
|
||||
if not t_ele[i].text.isdigit():
|
||||
title = title + t_ele[i].text
|
||||
data['type'] = rank
|
||||
data['title'] = title
|
||||
data_list.append(data)
|
||||
|
||||
elif ele.tag.endswith('}tbl'):
|
||||
data = {
|
||||
'name': '',
|
||||
'biaoshi': '',
|
||||
'zhuizong': [],
|
||||
'zongsu': '',
|
||||
'init': '',
|
||||
'qianti': '',
|
||||
'step': []
|
||||
}
|
||||
data['type'] = 'table'
|
||||
table = Table(ele, doc)
|
||||
if table.cell(1, 0).text == '测试用例名称':
|
||||
self.sin_out.emit(str(table_index))
|
||||
|
||||
try:
|
||||
self.sin_out.emit(str(table_index))
|
||||
self.sin_out.emit(f'正在处理第{table_index}个表格')
|
||||
# 1、获取测试用例名称
|
||||
data['name'] = table.cell(1, 3).text
|
||||
# 2、获取用例标识
|
||||
data['biaoshi'] = table.cell(1, 9).text
|
||||
# 3、获取追踪关系 注意word中换行为\r\x07
|
||||
temp = table.cell(2, 3)
|
||||
for tem in temp.paragraphs:
|
||||
data['zhuizong'].append(tem.text)
|
||||
# 4、获取综述
|
||||
data['zongsu'] = table.cell(3, 3).text.replace(
|
||||
'\n', '\a')
|
||||
# 5、初始化
|
||||
data['init'] = table.cell(4,
|
||||
3).text.replace('\n', '\a')
|
||||
# 6、获取前提与约束
|
||||
data['qianti'] = table.cell(5, 3).text.replace(
|
||||
'\n', '\a')
|
||||
# 7、获取步骤信息-总行数减去12为步骤行数
|
||||
row_count = len(table.rows)
|
||||
step_count = row_count - 12
|
||||
for j in range(step_count):
|
||||
buzhou = {
|
||||
'shuru': '',
|
||||
'yuqi': '',
|
||||
'num': '',
|
||||
'image': '',
|
||||
'is_image': '0'
|
||||
}
|
||||
buzhou['num'] = table.rows[8 + j].cells[0].text
|
||||
if buzhou['num'] == '':
|
||||
buzhou['num'] = j + 1
|
||||
buzhou['shuru'] = table.rows[
|
||||
8 + j].cells[2].text.replace('\n', '\a')
|
||||
cel = table.rows[8 + j].cells[2]
|
||||
if len(
|
||||
cel._element.findall(
|
||||
'.//{http://schemas.openxmlformats.org/wordprocessingml/2006/main}drawing'
|
||||
)) > 0:
|
||||
img_ele = cel._element.xpath('.//pic:pic')[0]
|
||||
embed = img_ele.xpath('.//a:blip/@r:embed')[0]
|
||||
related_part = doc.part.related_parts[embed]
|
||||
image = related_part.image
|
||||
# blob属性就是二进制图片属性
|
||||
image_bytes = image.blob
|
||||
buzhou['image'] = InlineImage(
|
||||
tpl, io.BytesIO(image_bytes))
|
||||
buzhou['is_image'] = '1'
|
||||
buzhou['yuqi'] = table.rows[
|
||||
8 + j].cells[4].text.replace('\n', '\a')
|
||||
data['step'].append(buzhou)
|
||||
# 8、最后加入data_list
|
||||
data_list.append(data)
|
||||
table_index += 1
|
||||
except: # noqa: E722
|
||||
self.sin_out.emit(f'第{table_index}个表格处理错误!')
|
||||
table_index += 1
|
||||
pass
|
||||
# 开始渲染模板文件
|
||||
try:
|
||||
self.sin_out.emit('注意:如果生成文档没有标题,请检查您文档章节号格式是否正确!!!')
|
||||
self.sin_out.emit('all_doned:')
|
||||
context = {
|
||||
"tables": data_list,
|
||||
"renyuan": self.parent.lineEdit_17.text(),
|
||||
}
|
||||
tpl.render(context)
|
||||
tpl.save("CPU新版反向生成说明.docx")
|
||||
self.sin_out.emit('stopsuccess')
|
||||
except: # noqa: E722
|
||||
self.sin_out.emit('stoperror')
|
||||
return
|
||||
14
need/others/readme.txt
Normal file
14
need/others/readme.txt
Normal file
@@ -0,0 +1,14 @@
|
||||
注意事项:
|
||||
1.本工具只能处理docx格式word文档,如果是doc的,需打开后另存为docx,不能直接改名称;
|
||||
2.目前不支持文档路径中带特殊字符,如空格等;
|
||||
3.document_templates为文档模板文档,其中非代码部分可以调整格式,调整后按新模板生成;
|
||||
|
||||
功能说明:
|
||||
1、大纲转说明,使用的是成都鉴定测评模板,注意测试项格式的“;”以及“\r”(换行)
|
||||
2、追踪关系填写,可以根据大纲、说明和记录进行填写,说明和记录生成无需求规格说明的章节号和内容(需要根据大纲生成联合人工处理)
|
||||
3、根据大纲生成说明、根据说明生成测试记录,如果有3级标题,则需要人工添加二级标题
|
||||
4、文档小工具-UAS单元测试转换:是对UAS工具生成文档转换成本单位测评中心的用例
|
||||
5、自动填充以及选择文档功能和TDP工具一样,无变化;
|
||||
6、FPGA记录生产以及FPGA的记录转说明功能。
|
||||
|
||||
|
||||
BIN
need/static/zxlogo.gif
Normal file
BIN
need/static/zxlogo.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
154
need/threads.py
Normal file
154
need/threads.py
Normal file
@@ -0,0 +1,154 @@
|
||||
import pythoncom
|
||||
from PyQt5 import QtCore
|
||||
from PyQt5.QtCore import pyqtSignal
|
||||
from win32com.client import DispatchEx
|
||||
from pathlib import *
|
||||
from PyQt5.QtWidgets import QMessageBox
|
||||
from docxtpl import DocxTemplate
|
||||
|
||||
class create_bujian(QtCore.QThread):
|
||||
sin_out = pyqtSignal(str)
|
||||
|
||||
def __init__(self,parent):
|
||||
super().__init__()
|
||||
self.parent = parent
|
||||
|
||||
def run(self):
|
||||
self.sin_out.emit("进入部件测试获取调用函数线程......")
|
||||
self.sin_out.emit("开始填写文档......")
|
||||
|
||||
#如果没有选择路径则退出
|
||||
if not self.parent.open_file_name:
|
||||
self.sin_out.emit('nofile')
|
||||
self.parent.tabWidget.setEnabled(True)
|
||||
return
|
||||
|
||||
#告诉windows单线程
|
||||
pythoncom.CoInitialize()
|
||||
#在用户选择的目录中查找UAS单位测试报告文档
|
||||
self.sin_out.emit('打开单元测试原文件...')
|
||||
|
||||
#使用win32com打开-记得关闭
|
||||
#打开word应用
|
||||
self.w = DispatchEx('Word.Application')
|
||||
#self.w.visible=True
|
||||
self.w.DisplayAlerts = 0
|
||||
try:
|
||||
bujianfile = self.w.Documents.Open(self.parent.open_file_name[0])
|
||||
except:
|
||||
self.sin_out.emit('open failed:选择的文档')
|
||||
self.w.Quit()
|
||||
pythoncom.CoUninitialize()
|
||||
self.parent.tabWidget.setEnabled(True)
|
||||
return
|
||||
|
||||
curpath = Path.cwd() / 'need'
|
||||
danyuan_file_tmp = curpath / 'document_templates' / '部件桩函数工具1.docx'
|
||||
print(danyuan_file_tmp)
|
||||
|
||||
if danyuan_file_tmp.is_file():
|
||||
self.sin_out.emit('已检测到有部件模板文件...')
|
||||
else:
|
||||
self.sin_out.emit('open failed:选择的文档')
|
||||
return
|
||||
|
||||
#创建个列表放数据-important
|
||||
data_list = []
|
||||
|
||||
#try统计表格数量
|
||||
try:
|
||||
csx_tb_count = bujianfile.Tables.Count
|
||||
self.sin_out.emit('total:'+ str(csx_tb_count))
|
||||
self.sin_out.emit("正在调用word文档操作接口,可能会有点慢...")
|
||||
except:
|
||||
self.sin_out.emit('不存在表格!')
|
||||
QMessageBox.warning(self.parent,'出错了','测试说明文档格式错误或者没有正确表格')
|
||||
try:
|
||||
bujianfile.Close()
|
||||
except:
|
||||
pass
|
||||
self.w.Quit()
|
||||
pythoncom.CoUninitialize()
|
||||
self.parent.tabWidget.setEnabled(True)
|
||||
return
|
||||
|
||||
#开始处理表格-important
|
||||
#我先统计有多少个生成的表格-即用例有多少个呗
|
||||
yongli_count = 0
|
||||
for i in range(csx_tb_count):
|
||||
if bujianfile.Tables[i].Rows.Count > 2:
|
||||
#注意win32com的Cell从1开始不是从0开始
|
||||
if bujianfile.Tables[i].Cell(1, 1).Range.Text.find('用例名称') != -1:
|
||||
yongli_count += 1
|
||||
|
||||
|
||||
yongli_num = 0
|
||||
hanshuming_duibi = ''
|
||||
alowFunctionInject = True
|
||||
for i in range(csx_tb_count):
|
||||
self.sin_out.emit(str(i))
|
||||
#准备填入的data
|
||||
data = {'functionName':'','subitem':[]}
|
||||
|
||||
#找到函数名,这里容易出问题~~~~~~~~~~~~~~~~
|
||||
if bujianfile.Tables[i].Rows.Count > 2:
|
||||
if bujianfile.Tables[i].Cell(1, 1).Range.Text.find('功能描述') != -1:
|
||||
bujianfile.Tables[i].Cell(1, 1).Range.Select()
|
||||
self.w.Selection.MoveUp()
|
||||
self.w.Selection.MoveUp()
|
||||
self.w.Selection.MoveUp()
|
||||
s = self.w.Selection.Paragraphs(1).Range.Text[:-1]
|
||||
s1 = s.split(". ")[-1]
|
||||
#放入函数名比对
|
||||
data['functionName'] = s1
|
||||
data_list.append(data)
|
||||
yongli_num += 1 #用例创建加一
|
||||
|
||||
#找章节号~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
if bujianfile.Tables[i].Rows.Count > 2:
|
||||
if bujianfile.Tables[i].Cell(1, 1).Range.Text.find('用例名称') != -1:
|
||||
#函数名获取
|
||||
if s1 != hanshuming_duibi:
|
||||
hanshuming_duibi = s1
|
||||
alowFunctionInject = True
|
||||
else:
|
||||
alowFunctionInject = False
|
||||
|
||||
elif bujianfile.Tables[i].Cell(1, 2).Range.Text.find('定义') != -1:
|
||||
#定义个桩函数dict
|
||||
if alowFunctionInject == True:
|
||||
temp = bujianfile.Tables[i].Cell(1, 3).Range.Text[:-2]
|
||||
temp1 = temp.split("(")[0]
|
||||
temp2 = temp1.split(" ")[-1]
|
||||
data_list[yongli_num - 1]['subitem'].append(temp2)
|
||||
|
||||
|
||||
print('最后data_list',data_list)
|
||||
#最后关闭文档
|
||||
try:
|
||||
self.w.Quit()
|
||||
pythoncom.CoUninitialize()
|
||||
self.parent.tabWidget.setEnabled(True)
|
||||
except:
|
||||
QMessageBox.warning(self.parent,"关闭文档失败","关闭文档失败!")
|
||||
return
|
||||
|
||||
try:
|
||||
tpl_path = Path.cwd() / "need" / "document_templates" / "部件桩函数工具1.docx"
|
||||
self.sin_out.emit('导入模板文件路径为:' + str(tpl_path))
|
||||
tpl = DocxTemplate(tpl_path) #模板导入成功
|
||||
except:
|
||||
QMessageBox.warning(self.parent,"出错了","导入模板出错请检查模板文件是否存在或名字不正确")
|
||||
return
|
||||
|
||||
#开始渲染模板文件
|
||||
try:
|
||||
context = {
|
||||
"tables":data_list,
|
||||
}
|
||||
tpl.render(context)
|
||||
tpl.save("部件提起调用函数表格.docx")
|
||||
self.sin_out.emit('stopsuccess')
|
||||
except:
|
||||
self.sin_out.emit('stoperror')
|
||||
return
|
||||
18
need/utils.py
Normal file
18
need/utils.py
Normal file
@@ -0,0 +1,18 @@
|
||||
import datetime
|
||||
|
||||
def get_current_time():
|
||||
data = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S.%f')
|
||||
data = "[" + data + " R] "
|
||||
return data
|
||||
|
||||
def get_current_name():
|
||||
data = datetime.datetime.now().strftime('%Y-%m-%d-%H-%M-%S-%f')
|
||||
return data
|
||||
|
||||
def get_current_date():
|
||||
data = datetime.datetime.now().strftime('%Y-%m-%d %H-%M-%S')
|
||||
return data
|
||||
|
||||
def get_current_hour():
|
||||
data = datetime.datetime.now().strftime('%H.%M.%S')
|
||||
return data
|
||||
65
need/zhuan.py
Normal file
65
need/zhuan.py
Normal file
@@ -0,0 +1,65 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
# Form implementation generated from reading ui file 'zhuan.ui'
|
||||
#
|
||||
# Created by: PyQt5 UI code generator 5.15.4
|
||||
#
|
||||
# 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_Dialog(object):
|
||||
def setupUi(self, Dialog):
|
||||
Dialog.setObjectName("Dialog")
|
||||
Dialog.resize(461, 70)
|
||||
self.widget = QtWidgets.QWidget(Dialog)
|
||||
self.widget.setGeometry(QtCore.QRect(10, 35, 446, 23))
|
||||
self.widget.setObjectName("widget")
|
||||
self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.widget)
|
||||
self.horizontalLayout_3.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_3.setObjectName("horizontalLayout_3")
|
||||
self.horizontalLayout = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout.setObjectName("horizontalLayout")
|
||||
self.label = QtWidgets.QLabel(self.widget)
|
||||
self.label.setObjectName("label")
|
||||
self.horizontalLayout.addWidget(self.label)
|
||||
self.lineEdit = QtWidgets.QLineEdit(self.widget)
|
||||
self.lineEdit.setObjectName("lineEdit")
|
||||
self.horizontalLayout.addWidget(self.lineEdit)
|
||||
self.horizontalLayout_3.addLayout(self.horizontalLayout)
|
||||
self.horizontalLayout_2 = QtWidgets.QHBoxLayout()
|
||||
self.horizontalLayout_2.setObjectName("horizontalLayout_2")
|
||||
self.label_2 = QtWidgets.QLabel(self.widget)
|
||||
self.label_2.setObjectName("label_2")
|
||||
self.horizontalLayout_2.addWidget(self.label_2)
|
||||
self.lineEdit_2 = QtWidgets.QLineEdit(self.widget)
|
||||
self.lineEdit_2.setObjectName("lineEdit_2")
|
||||
self.horizontalLayout_2.addWidget(self.lineEdit_2)
|
||||
self.horizontalLayout_3.addLayout(self.horizontalLayout_2)
|
||||
self.widget1 = QtWidgets.QWidget(Dialog)
|
||||
self.widget1.setGeometry(QtCore.QRect(10, 10, 216, 18))
|
||||
self.widget1.setObjectName("widget1")
|
||||
self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.widget1)
|
||||
self.horizontalLayout_4.setContentsMargins(0, 0, 0, 0)
|
||||
self.horizontalLayout_4.setObjectName("horizontalLayout_4")
|
||||
self.radioButton = QtWidgets.QRadioButton(self.widget1)
|
||||
self.radioButton.setChecked(True)
|
||||
self.radioButton.setObjectName("radioButton")
|
||||
self.horizontalLayout_4.addWidget(self.radioButton)
|
||||
self.radioButton_2 = QtWidgets.QRadioButton(self.widget1)
|
||||
self.radioButton_2.setObjectName("radioButton_2")
|
||||
self.horizontalLayout_4.addWidget(self.radioButton_2)
|
||||
|
||||
self.retranslateUi(Dialog)
|
||||
QtCore.QMetaObject.connectSlotsByName(Dialog)
|
||||
|
||||
def retranslateUi(self, Dialog):
|
||||
_translate = QtCore.QCoreApplication.translate
|
||||
Dialog.setWindowTitle(_translate("Dialog", "IEEE754转换工具"))
|
||||
self.label.setText(_translate("Dialog", "16进制表示"))
|
||||
self.label_2.setText(_translate("Dialog", "float值"))
|
||||
self.radioButton.setText(_translate("Dialog", "单精度(32位)"))
|
||||
self.radioButton_2.setText(_translate("Dialog", "双精度(64位)"))
|
||||
21
need/zhuan_tool.py
Normal file
21
need/zhuan_tool.py
Normal file
@@ -0,0 +1,21 @@
|
||||
#python处理floatIEE754格式转换
|
||||
import struct
|
||||
|
||||
def IEEE754_16_to_float(x,byte_type):
|
||||
if byte_type == 32:
|
||||
return struct.unpack('>f',struct.pack('>I',int(x,16)))[0]
|
||||
if byte_type == 64:
|
||||
return struct.unpack('>d',struct.pack('>Q',int(x,16)))[0]
|
||||
|
||||
def IEEE754_float_to_16(x,byte_type):
|
||||
if byte_type == 32:
|
||||
return hex(struct.unpack('>I',struct.pack('>f',x))[0])[2:].upper()
|
||||
if byte_type == 64:
|
||||
return hex(struct.unpack('>Q',struct.pack('>d',x))[0])[2:].upper()
|
||||
|
||||
if __name__ == '__main__':
|
||||
##测试程序##
|
||||
x = 'BE051EB8'
|
||||
y = -0.13
|
||||
print(IEEE754_16_to_float(x,32))
|
||||
print(IEEE754_float_to_16(y,32))
|
||||
Reference in New Issue
Block a user