leslie vor 2 Jahren
Commit
03126c92cd

+ 140 - 0
.gitignore

@@ -0,0 +1,140 @@
+### Python template
+# Byte-compiled / optimized / DLL files
+__pycache__/
+*.py[cod]
+*$py.class
+
+# C extensions
+*.so
+
+# Distribution / packaging
+.Python
+build/
+develop-eggs/
+dist/
+downloads/
+eggs/
+.eggs/
+lib/
+lib64/
+parts/
+sdist/
+var/
+wheels/
+share/python-wheels/
+*.egg-info/
+.installed.cfg
+*.egg
+MANIFEST
+
+# PyInstaller
+#  Usually these files are written by a python script from a template
+#  before PyInstaller builds the exe, so as to inject date/other infos into it.
+*.manifest
+*.spec
+
+# Installer logs
+pip-log.txt
+pip-delete-this-directory.txt
+
+# Unit test / coverage reports
+htmlcov/
+.tox/
+.nox/
+.coverage
+.coverage.*
+.cache
+nosetests.xml
+coverage.xml
+*.cover
+*.py,cover
+.hypothesis/
+.pytest_cache/
+cover/
+
+# Translations
+*.mo
+*.pot
+
+# Django stuff:
+*.log
+local_settings.py
+db.sqlite3
+db.sqlite3-journal
+
+# Flask stuff:
+instance/
+.webassets-cache
+
+# Scrapy stuff:
+.scrapy
+
+# Sphinx documentation
+docs/_build/
+
+# PyBuilder
+.pybuilder/
+target/
+
+# Jupyter Notebook
+.ipynb_checkpoints
+
+# IPython
+profile_default/
+ipython_config.py
+
+# pyenv
+#   For a library or package, you might want to ignore these files since the code is
+#   intended to run in multiple environments; otherwise, check them in:
+# .python-version
+
+# pipenv
+#   According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
+#   However, in case of collaboration, if having platform-specific dependencies or dependencies
+#   having no cross-platform support, pipenv may install dependencies that don't work, or not
+#   install all needed dependencies.
+#Pipfile.lock
+
+# PEP 582; used by e.g. github.com/David-OConnor/pyflow
+__pypackages__/
+
+# Celery stuff
+celerybeat-schedule
+celerybeat.pid
+
+# SageMath parsed files
+*.sage.py
+
+# Environments
+.env
+.venv
+env/
+venv/
+ENV/
+env.bak/
+venv.bak/
+
+# Spyder project settings
+.spyderproject
+.spyproject
+
+# Rope project settings
+.ropeproject
+
+# mkdocs documentation
+/site
+
+# mypy
+.mypy_cache/
+.dmypy.json
+dmypy.json
+
+# Pyre type checker
+.pyre/
+
+# pytype static type analyzer
+.pytype/
+
+# Cython debug symbols
+cython_debug/
+.idea

+ 65 - 0
ScanUtils/CRC16.py

@@ -0,0 +1,65 @@
+# -*- coding: utf-8 -*-
+
+# @Author: ZH
+# @Time  : 2021/1/10 14:39
+# @File  : CRC16.py
+
+chCRCHTalbe = [
+0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
+0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
+0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
+0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
+0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
+0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
+0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
+0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
+0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
+0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
+0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
+0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
+0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
+0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
+0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
+0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
+0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
+0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x00, 0xC1, 0x81, 0x40,
+0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
+0x00, 0xC1, 0x81, 0x40, 0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41,
+0x00, 0xC1, 0x81, 0x40, 0x01, 0xC0, 0x80, 0x41, 0x01, 0xC0, 0x80, 0x41,
+0x00, 0xC1, 0x81, 0x40]
+chCRCLTalbe = [
+0x00, 0xC0, 0xC1, 0x01, 0xC3, 0x03, 0x02, 0xC2, 0xC6, 0x06, 0x07, 0xC7,
+0x05, 0xC5, 0xC4, 0x04, 0xCC, 0x0C, 0x0D, 0xCD, 0x0F, 0xCF, 0xCE, 0x0E,
+0x0A, 0xCA, 0xCB, 0x0B, 0xC9, 0x09, 0x08, 0xC8, 0xD8, 0x18, 0x19, 0xD9,
+0x1B, 0xDB, 0xDA, 0x1A, 0x1E, 0xDE, 0xDF, 0x1F, 0xDD, 0x1D, 0x1C, 0xDC,
+0x14, 0xD4, 0xD5, 0x15, 0xD7, 0x17, 0x16, 0xD6, 0xD2, 0x12, 0x13, 0xD3,
+0x11, 0xD1, 0xD0, 0x10, 0xF0, 0x30, 0x31, 0xF1, 0x33, 0xF3, 0xF2, 0x32,
+0x36, 0xF6, 0xF7, 0x37, 0xF5, 0x35, 0x34, 0xF4, 0x3C, 0xFC, 0xFD, 0x3D,
+0xFF, 0x3F, 0x3E, 0xFE, 0xFA, 0x3A, 0x3B, 0xFB, 0x39, 0xF9, 0xF8, 0x38,
+0x28, 0xE8, 0xE9, 0x29, 0xEB, 0x2B, 0x2A, 0xEA, 0xEE, 0x2E, 0x2F, 0xEF,
+0x2D, 0xED, 0xEC, 0x2C, 0xE4, 0x24, 0x25, 0xE5, 0x27, 0xE7, 0xE6, 0x26,
+0x22, 0xE2, 0xE3, 0x23, 0xE1, 0x21, 0x20, 0xE0, 0xA0, 0x60, 0x61, 0xA1,
+0x63, 0xA3, 0xA2, 0x62, 0x66, 0xA6, 0xA7, 0x67, 0xA5, 0x65, 0x64, 0xA4,
+0x6C, 0xAC, 0xAD, 0x6D, 0xAF, 0x6F, 0x6E, 0xAE, 0xAA, 0x6A, 0x6B, 0xAB,
+0x69, 0xA9, 0xA8, 0x68, 0x78, 0xB8, 0xB9, 0x79, 0xBB, 0x7B, 0x7A, 0xBA,
+0xBE, 0x7E, 0x7F, 0xBF, 0x7D, 0xBD, 0xBC, 0x7C, 0xB4, 0x74, 0x75, 0xB5,
+0x77, 0xB7, 0xB6, 0x76, 0x72, 0xB2, 0xB3, 0x73, 0xB1, 0x71, 0x70, 0xB0,
+0x50, 0x90, 0x91, 0x51, 0x93, 0x53, 0x52, 0x92, 0x96, 0x56, 0x57, 0x97,
+0x55, 0x95, 0x94, 0x54, 0x9C, 0x5C, 0x5D, 0x9D, 0x5F, 0x9F, 0x9E, 0x5E,
+0x5A, 0x9A, 0x9B, 0x5B, 0x99, 0x59, 0x58, 0x98, 0x88, 0x48, 0x49, 0x89,
+0x4B, 0x8B, 0x8A, 0x4A, 0x4E, 0x8E, 0x8F, 0x4F, 0x8D, 0x4D, 0x4C, 0x8C,
+0x44, 0x84, 0x85, 0x45, 0x87, 0x47, 0x46, 0x86, 0x82, 0x42, 0x43, 0x83,
+0x41, 0x81, 0x80, 0x40]
+
+def crc16(data,crc=0):
+    chCRCHi = 0xFF
+    chCRCLo = 0xFF
+    for byte in data:
+        temp = byte&0xFF
+        wIndex = chCRCLo^temp
+        chCRCLo = chCRCHi ^ chCRCHTalbe[wIndex]
+        chCRCHi = chCRCLTalbe[wIndex]
+    return (((chCRCHi&0xff)<<8)+chCRCLo)&0xffff
+
+if __name__ == "__main__":
+    print('{:02X}'.format(crc16(b'1234567890')))

+ 48 - 0
ScanUtils/CRC8.py

@@ -0,0 +1,48 @@
+# -*- coding: utf-8 -*-
+
+# @Author: 郑海
+# @Email : 147320920@qq.com
+# @Time  : 2018/9/26 13:04
+# @File  : CRC8.py
+
+
+#生成多项式:X8+X5+X4+1=0x31 ,CRC8TAB[1]=生成多项式
+crc8tb = (
+	0x00, 0x31, 0x62, 0x53, 0xC4, 0xF5, 0xA6, 0x97,
+	0xB9, 0x88, 0xDB, 0xEA, 0x7D, 0x4C, 0x1F, 0x2E,
+	0x43, 0x72, 0x21, 0x10, 0x87, 0xB6, 0xE5, 0xD4,
+	0xFA, 0xCB, 0x98, 0xA9, 0x3E, 0x0F, 0x5C, 0x6D,
+	0x86, 0xB7, 0xE4, 0xD5, 0x42, 0x73, 0x20, 0x11,
+	0x3F, 0x0E, 0x5D, 0x6C, 0xFB, 0xCA, 0x99, 0xA8,
+	0xC5, 0xF4, 0xA7, 0x96, 0x01, 0x30, 0x63, 0x52,
+	0x7C, 0x4D, 0x1E, 0x2F, 0xB8, 0x89, 0xDA, 0xEB,
+	0x3D, 0x0C, 0x5F, 0x6E, 0xF9, 0xC8, 0x9B, 0xAA,
+	0x84, 0xB5, 0xE6, 0xD7, 0x40, 0x71, 0x22, 0x13,
+	0x7E, 0x4F, 0x1C, 0x2D, 0xBA, 0x8B, 0xD8, 0xE9,
+	0xC7, 0xF6, 0xA5, 0x94, 0x03, 0x32, 0x61, 0x50,
+	0xBB, 0x8A, 0xD9, 0xE8, 0x7F, 0x4E, 0x1D, 0x2C,
+	0x02, 0x33, 0x60, 0x51, 0xC6, 0xF7, 0xA4, 0x95,
+	0xF8, 0xC9, 0x9A, 0xAB, 0x3C, 0x0D, 0x5E, 0x6F,
+	0x41, 0x70, 0x23, 0x12, 0x85, 0xB4, 0xE7, 0xD6,
+	0x7A, 0x4B, 0x18, 0x29, 0xBE, 0x8F, 0xDC, 0xED,
+	0xC3, 0xF2, 0xA1, 0x90, 0x07, 0x36, 0x65, 0x54,
+	0x39, 0x08, 0x5B, 0x6A, 0xFD, 0xCC, 0x9F, 0xAE,
+	0x80, 0xB1, 0xE2, 0xD3, 0x44, 0x75, 0x26, 0x17,
+	0xFC, 0xCD, 0x9E, 0xAF, 0x38, 0x09, 0x5A, 0x6B,
+	0x45, 0x74, 0x27, 0x16, 0x81, 0xB0, 0xE3, 0xD2,
+	0xBF, 0x8E, 0xDD, 0xEC, 0x7B, 0x4A, 0x19, 0x28,
+	0x06, 0x37, 0x64, 0x55, 0xC2, 0xF3, 0xA0, 0x91,
+	0x47, 0x76, 0x25, 0x14, 0x83, 0xB2, 0xE1, 0xD0,
+	0xFE, 0xCF, 0x9C, 0xAD, 0x3A, 0x0B, 0x58, 0x69,
+	0x04, 0x35, 0x66, 0x57, 0xC0, 0xF1, 0xA2, 0x93,
+	0xBD, 0x8C, 0xDF, 0xFE, 0x79, 0x48, 0x1B, 0x2A,
+	0xC1, 0xF0, 0xA3, 0x92, 0x05, 0x34, 0x67, 0x56,
+	0x78, 0x49, 0x1A, 0x2B, 0xBC, 0x8D, 0xDE, 0xEF,
+	0x82, 0xB3, 0xE0, 0xD1, 0x46, 0x77, 0x24, 0x15,
+	0x3B, 0x0A, 0x59, 0x68, 0xFF, 0xCE, 0x9D, 0xAC
+)
+def getCrc8(data):
+    crc = 0
+    for byte in data:
+        crc = crc8tb[crc^byte]
+    return crc

+ 30 - 0
ScanUtils/Config.py

@@ -0,0 +1,30 @@
+# coding:utf8
+'''
+@Project :Scan 
+@File :Config.py
+@Author :Leslie
+@Date :2023/5/8 16:20 
+'''
+import winreg
+
+import yaml
+class Configuration:
+
+    def getConfiguration(self):
+        with open('setting.yml', 'r', encoding='utf-8') as f:
+            file_content = f.read()
+            content = yaml.load(file_content, yaml.FullLoader)
+            a =[]
+            a =content['materials']
+        return a
+
+    def get_desktop(self):
+        key = winreg.OpenKey(winreg.HKEY_CURRENT_USER,
+                             r'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders', )
+
+        return winreg.QueryValueEx(key, "Desktop")[0]
+
+
+if __name__ == '__main__':
+    print(Configuration().getConfiguration())
+    print(Configuration().get_desktop())

+ 56 - 0
ScanUtils/Dialogadd.py

@@ -0,0 +1,56 @@
+# coding:utf8
+'''
+@Project :Scan 
+@File :Dialogadd.py
+@Author :Leslie
+@Date :2023/5/8 11:08 
+'''
+from PyQt5.QtWidgets import QDialogButtonBox, QDateTimeEdit, QDialog, QComboBox, QTableView, QAbstractItemView, \
+    QHeaderView, QTableWidget, QTableWidgetItem, QMessageBox, QListWidget, QListWidgetItem, QStatusBar, QMenuBar, QMenu, \
+    QAction, QLineEdit, QStyle, QFormLayout, QVBoxLayout, QWidget, QApplication, QHBoxLayout, QPushButton, QMainWindow, \
+    QGridLayout, QLabel
+from PyQt5.QtGui import QIcon, QPixmap, QStandardItem, QStandardItemModel, QCursor, QFont, QBrush, QColor, QPainter, \
+    QMouseEvent, QImage, QTransform
+from PyQt5.QtCore import QStringListModel, QAbstractListModel, QModelIndex, QSize, Qt, QObject, pyqtSignal, QTimer, \
+    QEvent, QDateTime, QDate
+
+
+
+class Dialogadd(QDialog):
+
+    # 自定义消息
+    dialogSignel = pyqtSignal(int, str)
+
+    def __init__(self, parent=None):
+        super(Dialogadd, self).__init__(parent)
+        layout = QVBoxLayout(self)
+        self.label = QLabel(self)
+        self.lineEdit = QLineEdit(self)
+        self.label.setText("请输入物料类型")
+        layout.addWidget(self.label)
+        layout.addWidget(self.lineEdit)
+
+        buttons = QDialogButtonBox(QDialogButtonBox.Ok | QDialogButtonBox.Cancel, Qt.Horizontal, self)
+        buttons.accepted.connect(self.accept)  # 点击ok
+        buttons.rejected.connect(self.reject)  # 点击cancel
+        layout.addWidget(buttons)
+
+    def accept(self):  # 点击ok是发送内置信号
+        material = self.lineEdit.text()
+        if not material:
+            return ;
+        self.dialogSignel.emit(0, material)
+        self.destroy()
+
+    def reject(self):  # 点击cancel时,发送自定义信号
+        self.destroy()
+
+
+
+if __name__ == '__main__':
+        import sys
+
+        app = QApplication(sys.argv)
+        Dialog = Dialogadd()
+        Dialog.show()
+        sys.exit(app.exec_())

+ 230 - 0
ScanUtils/ScanInput.py

@@ -0,0 +1,230 @@
+# coding:utf8
+'''
+@Project :Scan 
+@File :ScanInput.py
+@Author :Leslie
+@Date :2023/5/6 9:03 
+'''
+import datetime
+import os
+from PyQt5.QtCore import *
+
+import time
+
+from PyQt5.QtCore import QCoreApplication, QThread, pyqtSignal, QDate
+from PyQt5.QtGui import QIcon
+
+from PyQt5.QtWidgets import QApplication, QWidget, QFileDialog, QPlainTextEdit, QMessageBox
+
+import CRC8
+from ScanUtils import Config
+from ScanUtils.Config import Configuration
+from ScanUtils.Dialogadd import Dialogadd
+
+from ScanUtils.ui.Scan import Ui_Form
+from VersionSet import VersionSet
+
+softwareIconPath = r'./pic/scan.png'
+folderName = 'material'
+
+# softwareIconPath = r'./pic/scan.png'
+
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
+from PyQt5.QtWidgets import *
+
+
+# class WorkThread(QThread):
+#     sinOut = pyqtSignal(str)
+#     def run(self):
+#         while True:
+#             time.sleep(5)
+#             self.sinOut.emit("1111run")
+
+
+class ScanInput(QWidget):
+
+    def __init__(self, versionCode,productDate, parent=None, closeToDlg=None):
+        super(ScanInput, self).__init__(parent)
+        self.ui = Ui_Form()
+        self.ui.setupUi(self)
+        self.setWindowTitle("物料扫码")
+        self.setWindowIcon(QIcon(softwareIconPath))
+        self.ui.versionCode.setText(versionCode)
+        self.ui.Deliverydate.setText(productDate)
+
+        self.QComboBoxnit()
+
+        self.ui.save.clicked.connect(self.actSaveTriggered)
+        self.ui.open.clicked.connect(self.actOpenTriggered)
+
+        self.ui.materialType.currentTextChanged.connect(self.materialTypeChanged)
+
+        # 创建保存.txt的文件夹
+        self.mkdirFile()
+
+        # 线程传参
+        self.autoSave = AutoSaveThread(self)
+        self.autoSave.start()
+
+
+
+
+    # 下拉框属性
+    def getParamDict(self):
+        paramDict = Config.Configuration().getConfiguration()
+        return paramDict
+
+    # 下拉框初始化
+    def QComboBoxnit(self):
+        paramDict = self.getParamDict()
+        for item in paramDict:
+            self.ui.materialType.addItem(item)
+
+    # 打开文件
+    def actOpenTriggered(self):
+        curPath = QCoreApplication.applicationDirPath()
+
+        QMessageBox.information(self, '提示', '请选择以版本代码+发料日期为名的.txt文件')
+
+
+        #     调用打开文件对话框打开一个文件
+        QFileName = QFileDialog.getOpenFileName(self, "选取文件", curPath,
+                                                "文本文件(*.txt)")
+
+
+
+        if QFileName[0]:
+
+            fileName = QFileName[0].split("/")[-1].split(".")[0].split("_")
+            versionCode = fileName[0]
+            deliveryDate = fileName[1]
+
+            self.ui.Deliverydate.setText(deliveryDate)
+            self.ui.versionCode.setText(versionCode)
+
+            f = open(QFileName[0], 'r')
+            with f:
+                data = f.read()
+                self.ui.plainTextEdit.setPlainText(data)
+
+    # 文件保存
+    def actSaveTriggered(self):
+
+        desktopPath = Configuration().get_desktop()
+
+        # print(VersionSet.getCurrentParam())
+        versionCode = self.ui.versionCode.text()
+        Deliverydate = self.ui.Deliverydate.text()
+        filenameStr = versionCode + "_" + Deliverydate + ".txt"
+
+        filePathName = desktopPath + '\\' + folderName + '\\' + filenameStr
+
+
+        aFileName = QFileDialog.getSaveFileName(self, "另存为", filePathName, "文本文档(*.txt)")
+
+        text = self.ui.plainTextEdit.toPlainText()
+        if str(aFileName[0]) == "":
+            QMessageBox.warning(self, "提示", "没有保存数据,请重新保存。")
+            saveFlag = 0
+            return aFileName, saveFlag
+        else:
+            saveFlag = 1
+            try:
+                with open(aFileName[0], 'w') as f:
+                    f.write(text)
+            except Exception as e:
+                QMessageBox.information(self, "提示", str(e), )
+            QMessageBox.information(self, "提示", "数据文件保存成功!", QMessageBox.Ok)
+            return aFileName, saveFlag
+
+
+
+    # 物料类别选择
+    def materialTypeChanged(self, materialType):
+        print(materialType)
+
+        if not materialType == '无':
+            str = "= = = = = = = = = = = = " + materialType + " = = = = = = = = = = = = ="
+            self.ui.plainTextEdit.insertPlainText(str + "\n")
+            self.ui.plainTextEdit.insertPlainText("\n")
+
+
+    # 创建保存文件的文件夹
+    def mkdirFile(self):
+
+        desktopPath = Configuration().get_desktop()
+
+        folderNamePath = desktopPath + '\\' + folderName
+
+        if not os.path.exists(folderNamePath):
+            os.mkdir(folderNamePath)
+        else:
+            return True
+
+    # 添加物料类别的界面 目前没用
+    def openDialog(self):
+        dialog = Dialogadd(self)
+        # 连接【子窗口内置消息和主窗口的槽函数】
+        # dialog.datetime.dateChanged.connect(self.slot_inner)
+        # 连接【子窗口自定义消息和主窗口槽函数】
+        dialog.dialogSignel.connect(self.slot_emit)
+        dialog.show()
+
+
+
+# 自动保存 线程任务
+class AutoSaveThread(QThread):
+
+    # 初始化传参
+    def __init__(self, inputDiog,parent=None):
+        super(AutoSaveThread, self).__init__(parent)
+
+        self.inputDiog = inputDiog
+
+        self.versionCode = inputDiog.ui.versionCode.text()
+
+        self.deliveryDate = inputDiog.ui.Deliverydate.text()
+
+
+    def run(self):
+        self.loop_monitor()
+
+    def time_printer(self):
+
+        # 定时
+        if self.inputDiog.ui.plainTextEdit.toPlainText():
+
+            desktopPath = Configuration().get_desktop()
+
+            versionCode = self.versionCode
+            deliveryDate = self.Deliverydate
+
+            filenameStr = versionCode+"_"+deliveryDate + ".txt"
+
+            filePathName = desktopPath + '\\' + folderName + '\\' + filenameStr
+
+            txt = self.inputDiog.ui.plainTextEdit.toPlainText()
+
+            file = open(filePathName, 'w')
+
+            file.write(txt)
+
+            file.close()
+
+            self.loop_monitor()
+        else:
+            self.loop_monitor()
+
+    def loop_monitor(self):
+        time.sleep(20)
+        self.time_printer()
+
+
+if __name__ == '__main__':
+    import sys
+
+    app = QApplication(sys.argv)
+    ui = ScanInput()
+    ui.show()
+    sys.exit(app.exec_())

+ 658 - 0
ScanUtils/VersionSet.py

@@ -0,0 +1,658 @@
+import time
+
+from PyQt5.QtCore import *
+from PyQt5.QtGui import *
+from PyQt5.QtWidgets import *
+
+from ScanUtils import CRC8
+
+
+from ScanUtils.ui.VersionSet import Ui_Form
+
+
+
+softwareIconPath = r'./pic/scan.png'
+
+# class MySlot(QObject):
+#     def get(self,msg):
+#         print("信息" + msg)
+
+
+
+class VersionSet(QWidget):
+
+    #自定义信号
+    mySignal = pyqtSignal(str)
+
+    # def run1(self):
+    #     self.mySignal.emit('Hello PyQt5')
+
+    def __init__(self, parent = None, closeToDlg = None):
+        '''构造函数'''
+        super(VersionSet, self).__init__(parent)
+        self.ui = Ui_Form()
+        self.ui.setupUi(self)
+
+        self.setWindowIcon(QIcon(softwareIconPath))
+
+        self.setWindowTitle("生产物料扫码记录")
+
+        self.setWindowFlags(self.windowFlags() | Qt.CustomizeWindowHint)#QtCore.Qt.WindowStaysOnTopHint顶层显示
+        #禁用最小化
+        # self.setWindowFlags(self.windowFlags() & ~Qt.WindowMinimizeButtonHint)
+        #禁用最大化
+        # self.setWindowFlags(self.windowFlags() & ~Qt.WindowMaximizeButtonHint)
+        #禁止拉伸窗口大小
+        # self.setFixedSize(self.width(), self.height())
+        self.closeToDlg = closeToDlg
+        self.widgetInit()
+
+
+
+
+    # 设置参数
+    def getParamDict(self, newRule = True):
+        paramDict = {}
+        if newRule:#新规则2023年4月20日
+            paramDict['芯片主版本'] = (('HX02', 2), ('HX03', 3))#4位
+            paramDict['芯片次版本'] = (('第1版(A)', 1), ('第2版(B)', 2), ('第3版(C)', 3), ('第4版(D)', 4), ('第5版(E)', 5))#4位
+
+            paramDict['数字电容容值'] = (('无电容', 0), ('1uF', 1), ('4.7uF', 2), ('10uF', 3), ('22uF', 4), ('33uF', 5), ('47uF', 6), ('68uF', 7), ('100uF', 8))#4位
+            # 2022年9月28日由3位扩展到5位
+            paramDict['数字电容品牌'] = (('试验品牌', 0), ('AVX', 1), ('Vishay', 2), ('Sunlord', 3), ('火炬', 4), ('湘江', 5), ('振华', 6), ('丰华', 7), ('国巨', 8))
+            paramDict['电容耐压'] = (('16V', 0), ('20V', 1), ('25V', 2))#3位
+
+            paramDict['起爆电容容值'] = (('无电容', 0), ('33uF', 1), ('47uF', 2), ('68uF', 3), ('100uF', 4), ('220uF', 5))#3位
+            paramDict['起爆电容品牌'] = (('试验品牌', 0), ('AVX', 1), ('Vishay', 2), ('Sunlord', 3))#3位
+
+            paramDict['引火件形式'] = (('无', 0), ('焊接刚性药头', 1), ('贴片刚性药头', 2), ('贴片发热电阻', 3), ('碗状电阻器', 4))#3位
+            paramDict['桥丝规格'] = (('16um(7.9~8.6欧)', 0), ('2欧姆', 1))#5位
+            paramDict['脚线焊接方式'] = (('无孔焊接', 0), ('有孔焊接', 1), ('铭威铆接', 2), ('创德铆接', 3))#4位
+            paramDict['PCB供应商'] = (('丰达兴', 0), ('闽威', 1))
+        else:#旧规则
+            paramDict['芯片主版本'] = (('HX02', 2), ('HX03', 3))  # 4位
+            paramDict['芯片次版本'] = (('第1版(A)', 1), ('第2版(B)', 2), ('第3版(C)', 3), ('第4版(D)', 4), ('第5版(E)', 5))  # 4位
+
+            paramDict['数字电容容值'] = (
+            ('无电容', 0), ('1uF', 1), ('4.7uF', 2), ('10uF', 3), ('22uF', 4), ('33uF', 5), ('47uF', 6), ('68uF', 7),
+            ('100uF', 8))  # 4位
+            # 2022年9月28日由3位扩展到5位
+            paramDict['数字电容品牌'] = (
+            ('AVX', 1), ('Vishay', 2), ('Sunlord', 3), ('火炬', 4), ('湘江', 5), ('振华', 6), ('丰华', 7), ('国巨', 8))
+            paramDict['数字电容耐压'] = (('16V', 0), ('20V', 1), ('25V', 2))  # 3位
+
+            paramDict['起爆电容容值'] = (('无电容', 0), ('33uF', 1), ('47uF', 2), ('68uF', 3), ('100uF', 4))  # 3位
+            paramDict['起爆电容品牌'] = (('AVX', 1), ('Vishay', 2), ('Sunlord', 3))  # 3位
+            paramDict['起爆电容耐压'] = (('16V', 0), ('20V', 1), ('25V', 2))  # 3位
+
+            paramDict['引火件形式'] = (('无', 0), ('焊接刚性药头', 1), ('贴片刚性药头', 2), ('贴片发热电阻', 3), ('碗状电阻器', 4))  # 3位
+            paramDict['桥丝规格'] = (('16um(7.9~8.6欧)', 0), ('2欧姆', 1))  # 5位
+            paramDict['脚线焊接方式'] = (('焊接(有孔)', 1), ('铆接', 2), ('焊接(无孔)', 3))  # 4位
+
+        return paramDict
+
+    # 初始化:
+    def widgetInit(self):
+        paramDict = self.getParamDict(True)
+
+        for item in paramDict['芯片主版本']:
+            self.ui.chipVer_1.addItem(item[0])
+
+        for item in paramDict['芯片次版本']:
+            self.ui.chipVer_2.addItem(item[0])
+
+        for item in paramDict['数字电容容值']:
+            self.ui.workCapValue.addItem(item[0])
+
+        for item in paramDict['数字电容品牌']:
+            self.ui.workCapVender.addItem(item[0])
+
+        for item in paramDict['起爆电容容值']:
+            self.ui.blastCapValue.addItem(item[0])
+
+        for item in paramDict['起爆电容品牌']:
+            self.ui.blastCapVender.addItem(item[0])
+
+        for item in paramDict['电容耐压']:
+            self.ui.capVoltage.addItem(item[0])
+
+        for item in paramDict['引火件形式']:
+            self.ui.bridgeType.addItem(item[0])
+
+        for item in paramDict['桥丝规格']:
+            self.ui.bridgeValue.addItem(item[0])
+
+        for item in paramDict['PCB供应商']:
+            self.ui.pcbVender.addItem(item[0])
+
+        for item in range(32):
+            self.ui.pcbVer.addItem(str(item).zfill(2))#5位
+
+        for item in paramDict['脚线焊接方式']:
+            self.ui.lineType.addItem(item[0])
+
+        self.setDefault()
+
+        self.updateStatus()
+
+        self.ui.chipVer_1.activated.connect(self.updateStatus)
+        self.ui.chipVer_2.activated.connect(self.updateStatus)
+
+        self.ui.workCapValue.activated.connect(self.updateStatus)
+        self.ui.workCapVender.activated.connect(self.updateStatus)
+
+        self.ui.blastCapValue.activated.connect(self.updateStatus)
+        self.ui.blastCapVender.activated.connect(self.updateStatus)
+
+        self.ui.capVoltage.activated.connect(self.updateStatus)
+
+        self.ui.bridgeType.activated.connect(self.updateStatus)
+        self.ui.bridgeValue.activated.connect(self.updateStatus)
+
+        self.ui.pcbVender.activated.connect(self.updateStatus)
+        self.ui.pcbVer.activated.connect(self.updateStatus)
+        self.ui.lineType.activated.connect(self.updateStatus)
+
+        self.ui.productDate.dateChanged.connect(self.updateStatus)
+
+        # self.ui.copy.clicked.connect(self.copySolf)
+        self.ui.commit.clicked.connect(self.open_ScanInput)
+        # self.ui.read.clicked.connect(self.readSolf
+        # self.ui.write.clicked.connect(self.writeSolf)
+        # self.ui.analyst.clicked.connect(self.analystSolf).
+
+    # 打开窗口
+    def open_ScanInput(self):
+        versionCode= self.ui.versionCode.text()
+        productDate = self.ui.productDate.text()
+        from ScanUtils.ScanInput import ScanInput
+        self.ScanInput_ui = ScanInput(versionCode,productDate)
+
+        #self.ScanInput_ui.ui.versionCode.setText(versionCode)
+        # self.ScanInput_ui.ui.Deliverydate.setText(productDate)
+
+        self.ScanInput_ui.show()
+
+
+
+
+
+
+    def setDefault(self):
+        self.ui.workCapValue.setCurrentIndex(4)#默认22uF
+        self.ui.workCapVender.setCurrentIndex(6)#默认振华
+        self.ui.blastCapValue.setCurrentIndex(1)#默认33uF
+        self.ui.blastCapVender.setCurrentIndex(2)#默认Vishay
+        self.ui.chipVer_1.setCurrentIndex(1)
+        self.ui.chipVer_2.setCurrentIndex(4)
+        self.ui.bridgeType.setCurrentIndex(4)
+        self.ui.lineType.setCurrentIndex(0)
+        self.ui.productDate.setDate(QDate.currentDate())
+
+    def paramStr2Value(self, content, paramList):
+        for item in paramList:
+            if content == item[0]:
+                return item[1]
+        return None
+    def paramValue2Str(self, value, paramList):
+        for item in paramList:
+            if value == item[1]:
+                return item[0]
+        return None
+
+    # 版本号
+    def getCurrentParam(self):
+        paramDict = self.getParamDict(True)
+
+        chipVer_1 = self.paramStr2Value(self.ui.chipVer_1.currentText(), paramDict['芯片主版本'])
+
+        chipVer_2 = self.paramStr2Value(self.ui.chipVer_2.currentText(), paramDict['芯片次版本'])
+
+        workCapVender = self.paramStr2Value(self.ui.workCapVender.currentText(), paramDict['数字电容品牌'])
+
+        workCapValue = self.paramStr2Value(self.ui.workCapValue.currentText(), paramDict['数字电容容值'])
+
+        blastCapVender = self.paramStr2Value(self.ui.blastCapVender.currentText(), paramDict['起爆电容品牌'])
+
+        blastCapValue = self.paramStr2Value(self.ui.blastCapValue.currentText(), paramDict['起爆电容容值'])
+
+        capVoltage = self.paramStr2Value(self.ui.capVoltage.currentText(), paramDict['电容耐压'])
+
+        bridgeType = self.paramStr2Value(self.ui.bridgeType.currentText(), paramDict['引火件形式'])
+
+        bridgeValue = self.paramStr2Value(self.ui.bridgeValue.currentText(), paramDict['桥丝规格'])
+
+        pcbVender = self.paramStr2Value(self.ui.pcbVender.currentText(), paramDict['PCB供应商'])
+
+
+        pcbVer = int(self.ui.pcbVer.currentText())
+
+        lineType = self.paramStr2Value(self.ui.lineType.currentText(), paramDict['脚线焊接方式'])
+
+        productDate = self.ui.productDate.date()#发料日期
+
+        U64Value = chipVer_1 & 0x0F #芯片主版本号共4位,bit0-3
+
+
+        U64Value |= (chipVer_2 & 0x0F) << 4#芯片次版本号共4位,bit4-7
+
+
+        U64Value |= (workCapVender & 0x1F) << 8 #数字电容品牌共5位 ,bit8-12
+
+
+        U64Value |= (workCapValue & 0x0F) << 13 #数字电容容量共4位 ,bit13-16
+
+
+        U64Value |= (blastCapVender & 0x07) << 17 #起爆电容品牌共3位 ,bit17-19
+
+        U64Value |= (blastCapValue & 0x07) << 20 #起爆电容容量共3位 ,bit20-22
+
+
+        U64Value |= (capVoltage & 0x07) << 23    #电容耐压共3位 ,bit23-25
+
+
+        U64Value |= (bridgeType & 0x07) << 26 #引火件形式共3位 ,bit26-28
+
+
+        U64Value |= (bridgeValue & 0x1F) << 29 #桥丝规格共5位 ,bit29-33
+
+
+        U64Value |= (pcbVer & 0x1F) << 34     #PCB版本流水号共5位 ,bit34-38
+
+
+        U64Value |= (pcbVender & 0x03) << 39  #PCB供应商共2位 ,bit39-40
+
+
+        U64Value |= (lineType & 0x07) << 41   #脚线焊接方式共3位 ,bit41-43
+
+
+
+        U64Value |= (((productDate.year()-2020)*12 + (productDate.month()-1)) & 0x7F) << 44  # 发料日期中的年月共7位 ,bit44-50
+
+
+        U64Value |= (productDate.day() & 0x1F) << 51  # 发料日期中的日共5位 ,bit51-55
+
+        # print(hex(U64Value))
+
+
+        Bytes_0 = U64Value & 0xFF
+        Bytes_1 = (U64Value >> 8) & 0xFF
+        Bytes_2 = (U64Value >> 16) & 0xFF
+        Bytes_3 = (U64Value >> 24) & 0xFF
+        Bytes_4 = (U64Value >> 32) & 0xFF
+        Bytes_5 = (U64Value >> 40) & 0xFF
+        Bytes_6 = (U64Value >> 48) & 0xFF
+
+        hexStr = '%02X%02X%02X%02X%02X%02X%02X' % (Bytes_0, Bytes_1, Bytes_2, Bytes_3, Bytes_4, Bytes_5, Bytes_6)
+        hexStr += '%02X' % ((~CRC8.getCrc8(bytearray.fromhex(hexStr))) & 0xFF)
+
+        return hexStr
+
+    def updateStatus(self, param= None):
+        status = True
+        if self.ui.workCapValue.currentText() == "无电容":
+            status = False
+        self.ui.workCapVender.setEnabled(status)
+
+        status = True
+        if self.ui.blastCapValue.currentText() == "无电容":
+            status = False
+        self.ui.blastCapVender.setEnabled(status)
+
+        self.ui.versionCode.setText(self.getCurrentParam())
+
+
+    def showVersion(self, hexStr):
+        if len(hexStr) == 16 and hexStr[12:14] == "00":
+            self.showVersionForOldRule(hexStr)
+        else:
+            self.showVersionForNewRule(hexStr)
+
+    def showVersionForOldRule(self, hexStr):
+        result, infos = self.getVersionInfosForOldRule(hexStr)
+        if not result:
+            QMessageBox.critical(self, '错误', '{0}'.format(infos))
+            return
+
+        contents = []
+        key = '延期模块版本代码'
+        contents.append("{0}:{1}".format(key, infos[key]))
+
+        key = '芯片主版本'
+        contents.append("\n{0}:{1}".format(key, infos[key]))
+        key = '芯片次版本'
+        contents.append("{0}:{1}".format(key, infos[key]))
+
+
+        key = '数字电容品牌'
+        contents.append("\n{0}:{1}".format(key, infos[key]))
+
+        key = '数字电容容值'
+        contents.append("{0}:{1}".format(key, infos[key]))
+
+        key = '数字电容耐压'
+        contents.append("{0}:{1}".format(key, infos[key]))
+
+        key = '起爆电容品牌'
+        contents.append("\n{0}:{1}".format(key, infos[key]))
+
+        key = '起爆电容容值'
+        contents.append("{0}:{1}".format(key, infos[key]))
+
+        key = '起爆电容耐压'
+        contents.append("{0}:{1}".format(key, infos[key]))
+
+        key = '引火件形式'
+        contents.append("\n{0}:{1}".format(key, infos[key]))
+
+        key = '桥丝规格'
+        contents.append("{0}:{1}".format(key, infos[key]))
+
+        key = 'PCB版本流水号'
+        contents.append("\n{0}:{1}".format(key, infos[key]))
+
+        key = '脚线焊接方式'
+        contents.append("{0}:{1}".format(key, infos[key]))
+
+        QMessageBox.information(self, '信息(旧规则)', '\n'.join(contents))
+
+    def getVersionInfosForOldRule(self, versionHexStr):
+        if not versionHexStr or len(versionHexStr) != 16:
+            return False, '{0}\n请输入16位16进制数'.format(versionHexStr)
+        try:
+            verBytes = bytearray.fromhex(versionHexStr)
+        except Exception as e:
+            return False, '{0}\n请输入16位16进制数'.format(versionHexStr)
+
+        crc8 = (~CRC8.getCrc8(verBytes[:-1])) & 0xFF
+        if crc8 != verBytes[-1]:
+            return False, '{0}\n校验值错误'.format(versionHexStr)
+
+        U64Value = 0
+        U64Value |= verBytes[6]&0xFF
+        U64Value <<= 8
+        U64Value |= verBytes[5]&0xFF
+        U64Value <<= 8
+        U64Value |= verBytes[4]&0xFF
+        U64Value <<= 8
+        U64Value |= verBytes[3]&0xFF
+        U64Value <<= 8
+        U64Value |= verBytes[2]&0xFF
+        U64Value <<= 8
+        U64Value |= verBytes[1]&0xFF
+        U64Value <<= 8
+        U64Value |= verBytes[0]&0xFF
+
+        paramDict = self.getParamDict(False)
+
+        infos = {}
+        infos['延期模块版本代码'] = versionHexStr
+
+        key = '芯片主版本'
+        value = U64Value & 0x0F
+        chipVer_1 = self.paramValue2Str(value, paramDict[key])
+        if chipVer_1 == None:
+            chipVer_1 = '未知({0})'.format(value)
+        infos[key] = chipVer_1
+
+        key = '芯片次版本'
+        value = (U64Value >> 4) & 0x0F
+        chipVer_2 = self.paramValue2Str(value, paramDict[key])
+        if chipVer_2 == None:
+            chipVer_2 = '未知({0})'.format(value)
+        infos[key] = chipVer_2
+
+        key = '数字电容品牌'
+        value = (((U64Value >> 46) & 0x03)<<3) + ((U64Value >> 8) & 0x07)#2022年9月28日由3位扩展到5位
+
+        workCapVender = self.paramValue2Str(value, paramDict[key])
+        if workCapVender == None:
+            workCapVender = '未知({0})'.format(value)
+        infos[key] = workCapVender
+
+        key = '数字电容容值'
+        value = (U64Value >> 11) & 0x0F
+        workCapValue = self.paramValue2Str(value, paramDict[key])
+        if workCapValue == None:
+            workCapValue = '未知({0})'.format(value)
+        infos[key] = workCapValue
+
+        key = '数字电容耐压'
+        value = (U64Value >> 15) & 0x07
+        workCapVoltage = self.paramValue2Str(value, paramDict[key])
+        if workCapVoltage == None:
+            workCapVoltage = '未知({0})'.format(value)
+        infos[key] = workCapVoltage
+
+        key = '起爆电容品牌'
+        value = (U64Value >> 18) & 0x07
+        blastVender = self.paramValue2Str(value, paramDict[key])
+        if blastVender == None:
+            blastVender = '未知({0})'.format(value)
+        infos[key] = blastVender
+
+        key = '起爆电容容值'
+        value = (U64Value >> 21) & 0x07
+        blastCapValue = self.paramValue2Str(value, paramDict[key])
+        if blastCapValue == None:
+            blastCapValue = '未知({0})'.format(value)
+        infos[key] = blastCapValue
+
+        key = '起爆电容耐压'
+        value = (U64Value >> 24) & 0x07
+        blastCapVoltage = self.paramValue2Str(value, paramDict[key])
+        if blastCapVoltage == None:
+            blastCapVoltage = '未知({0})'.format(value)
+        infos[key] = blastCapVoltage
+
+        key = '引火件形式'
+        value = (U64Value >> 27) & 0x07
+        bridgeType = self.paramValue2Str(value, paramDict[key])
+        if bridgeType == None:
+            bridgeType = '未知({0})'.format(value)
+        infos[key] = bridgeType
+
+        key = '桥丝规格'
+        value = (U64Value >> 30) & 0x1F
+        bridgeValue = self.paramValue2Str(value, paramDict[key])
+        if bridgeValue == None:
+            bridgeValue = '未知({0})'.format(value)
+        infos[key] = bridgeValue
+
+        infos['PCB版本流水号'] = str((U64Value >> 35) & 0x7F).zfill(2)
+
+        key = '脚线焊接方式'
+        value = (U64Value >> 42) & 0x0F
+        lineType = self.paramValue2Str(value, paramDict[key])
+        if lineType == None:
+            lineType = '未知({0})'.format(value)
+        infos[key] = lineType
+
+        return True, infos
+
+
+    def showVersionForNewRule(self, hexStr):
+        result, infos = self.getVersionInfosForNewRule(hexStr)
+        if not result:
+            QMessageBox.critical(self, '错误', '{0}'.format(infos))
+            return
+
+        contents = []
+        key = '延期模块版本代码'
+        contents.append("{0}:{1}".format(key, infos[key]))
+
+        key = '芯片主版本'
+        contents.append("\n{0}:{1}".format(key, infos[key]))
+        key = '芯片次版本'
+        contents.append("{0}:{1}".format(key, infos[key]))
+
+
+        key = '数字电容品牌'
+        contents.append("\n{0}:{1}".format(key, infos[key]))
+
+        key = '数字电容容值'
+        contents.append("{0}:{1}".format(key, infos[key]))
+
+        key = '起爆电容品牌'
+        contents.append("\n{0}:{1}".format(key, infos[key]))
+
+        key = '起爆电容容值'
+        contents.append("{0}:{1}".format(key, infos[key]))
+
+        key = '电容耐压'
+        contents.append("\n{0}:{1}".format(key, infos[key]))
+
+        key = '引火件形式'
+        contents.append("\n{0}:{1}".format(key, infos[key]))
+
+        key = '桥丝规格'
+        contents.append("{0}:{1}".format(key, infos[key]))
+
+        key = 'PCB供应商'
+        contents.append("\n{0}:{1}".format(key, infos[key]))
+
+        key = 'PCB版本流水号'
+        contents.append("{0}:{1}".format(key, infos[key]))
+
+        key = '脚线焊接方式'
+        contents.append("{0}:{1}".format(key, infos[key]))
+
+        key = '发料日期'
+        contents.append("\n{0}:{1}".format(key, infos[key]))
+
+        QMessageBox.information(self, '信息', '\n'.join(contents))
+
+    def getVersionInfosForNewRule(self, versionHexStr):
+        if not versionHexStr or len(versionHexStr) != 16:
+            return False, '{0}\n请输入16位16进制数'.format(versionHexStr)
+        try:
+            verBytes = bytearray.fromhex(versionHexStr)
+        except Exception as e:
+            return False, '{0}\n请输入16位16进制数'.format(versionHexStr)
+
+        crc8 = (~CRC8.getCrc8(verBytes[:-1])) & 0xFF
+        if crc8 != verBytes[-1]:
+            return False, '{0}\n校验值错误'.format(versionHexStr)
+
+        U64Value = 0
+        U64Value |= verBytes[6]&0xFF
+        U64Value <<= 8
+        U64Value |= verBytes[5]&0xFF
+        U64Value <<= 8
+        U64Value |= verBytes[4]&0xFF
+        U64Value <<= 8
+        U64Value |= verBytes[3]&0xFF
+        U64Value <<= 8
+        U64Value |= verBytes[2]&0xFF
+        U64Value <<= 8
+        U64Value |= verBytes[1]&0xFF
+        U64Value <<= 8
+        U64Value |= verBytes[0]&0xFF
+
+        infos = {}
+        infos['延期模块版本代码'] = versionHexStr
+
+        paramDict = self.getParamDict(True)
+
+        key = '芯片主版本'#芯片主版本号共4位,bit0-3
+        value = U64Value & 0x0F
+        chipVer_1 = self.paramValue2Str(value, paramDict[key])
+        if chipVer_1 == None:
+            chipVer_1 = '未知({0})'.format(value)
+        infos[key] = chipVer_1
+
+        key = '芯片次版本'#芯片次版本号共4位,bit4-7
+        value = (U64Value >> 4) & 0x0F
+        chipVer_2 = self.paramValue2Str(value, paramDict[key])
+        if chipVer_2 == None:
+            chipVer_2 = '未知({0})'.format(value)
+        infos[key] = chipVer_2
+
+        key = '数字电容品牌'#数字电容品牌共5位 ,bit8-12
+        value = (U64Value >> 8) & 0x1F
+
+        workCapVender = self.paramValue2Str(value, paramDict[key])
+        if workCapVender == None:
+            workCapVender = '未知({0})'.format(value)
+        infos[key] = workCapVender
+
+        key = '数字电容容值'#数字电容容量共4位 ,bit13-16
+        value = (U64Value >> 13) & 0x0F
+        workCapValue = self.paramValue2Str(value, paramDict[key])
+        if workCapValue == None:
+            workCapValue = '未知({0})'.format(value)
+        infos[key] = workCapValue
+
+        key = '起爆电容品牌'#起爆电容品牌共3位 ,bit17-19
+        value = (U64Value >> 17) & 0x07
+        blastVender = self.paramValue2Str(value, paramDict[key])
+        if blastVender == None:
+            blastVender = '未知({0})'.format(value)
+        infos[key] = blastVender
+
+        key = '起爆电容容值'#起爆电容容量共3位 ,bit20-22
+        value = (U64Value >> 20) & 0x07
+        blastCapValue = self.paramValue2Str(value, paramDict[key])
+        if blastCapValue == None:
+            blastCapValue = '未知({0})'.format(value)
+        infos[key] = blastCapValue
+
+        key = '电容耐压'#电容耐压共3位 ,bit23-25
+        value = (U64Value >> 23) & 0x07
+        blastCapVoltage = self.paramValue2Str(value, paramDict[key])
+        if blastCapVoltage == None:
+            blastCapVoltage = '未知({0})'.format(value)
+        infos[key] = blastCapVoltage
+
+        key = '引火件形式'#引火件形式共3位 ,bit26-28
+        value = (U64Value >> 26) & 0x07
+        bridgeType = self.paramValue2Str(value, paramDict[key])
+        if bridgeType == None:
+            bridgeType = '未知({0})'.format(value)
+        infos[key] = bridgeType
+
+        key = '桥丝规格'#桥丝规格共5位 ,bit29-33
+        value = (U64Value >> 29) & 0x1F
+        bridgeValue = self.paramValue2Str(value, paramDict[key])
+        if bridgeValue == None:
+            bridgeValue = '未知({0})'.format(value)
+        infos[key] = bridgeValue
+
+        infos['PCB版本流水号'] = str((U64Value >> 34) & 0x1F).zfill(2)#PCB版本流水号共5位 ,bit34-38
+
+        key = 'PCB供应商'# PCB供应商共2位 ,bit39-40
+        value = (U64Value >> 39) & 0x03
+        bridgeValue = self.paramValue2Str(value, paramDict[key])
+        if bridgeValue == None:
+            bridgeValue = '未知({0})'.format(value)
+        infos[key] = bridgeValue
+
+        key = '脚线焊接方式'#脚线焊接方式共3位 ,bit41-43
+        value = (U64Value >> 41) & 0x07
+        lineType = self.paramValue2Str(value, paramDict[key])
+        if lineType == None:
+            lineType = '未知({0})'.format(value)
+        infos[key] = lineType
+
+        # 发料日期中的年月共7位 ,bit44-50
+        # 发料日期中的日共5位 ,bit51-55
+        yearAndMonth = (U64Value >> 44) & 0x7F
+        yaer = yearAndMonth//12
+        month = 1+ (yearAndMonth%12)
+        day = (U64Value >> 51) & 0x1F
+        infos['发料日期'] = "%04d年%d月%d日"%(2020+yaer, month, day)
+
+        return True, infos
+
+    def closeEvent(self, QCloseEvent):
+        if self.closeToDlg != None:
+            self.closeToDlg.show()
+
+
+
+if __name__ == '__main__':
+    import sys
+    app = QApplication(sys.argv)
+    ui = VersionSet()
+    ui.show()
+    sys.exit(app.exec_())

+ 7 - 0
ScanUtils/__init__.py

@@ -0,0 +1,7 @@
+# coding:utf8
+'''
+@Project :Scan 
+@File :__init__.py.py
+@Author :Leslie
+@Date :2023/5/5 17:05 
+'''

+ 17 - 0
ScanUtils/main.py

@@ -0,0 +1,17 @@
+# coding:utf8
+'''
+@Project :Scan 
+@File :main.py
+@Author :Leslie
+@Date :2023/5/6 16:45 
+'''
+from PyQt5.QtWidgets import QApplication
+
+from VersionSet import VersionSet
+
+if __name__ == '__main__':
+    import sys
+    app = QApplication(sys.argv)
+    ui = VersionSet()
+    ui.show()
+    sys.exit(app.exec_())

BIN
ScanUtils/pic/Scan.ico


BIN
ScanUtils/pic/scan.png


+ 5 - 0
ScanUtils/setting.yml

@@ -0,0 +1,5 @@
+materials:
+  - 无
+  - 电 容
+  - 电 阻
+  - 芯 片

+ 118 - 0
ScanUtils/ui/Scan.py

@@ -0,0 +1,118 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'Scan.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_Form(object):
+    def setupUi(self, Form):
+        Form.setObjectName("Form")
+        Form.resize(998, 811)
+        self.gridLayout_3 = QtWidgets.QGridLayout(Form)
+        self.gridLayout_3.setObjectName("gridLayout_3")
+        self.formLayout = QtWidgets.QFormLayout()
+        self.formLayout.setObjectName("formLayout")
+        self.material = QtWidgets.QLabel(Form)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.material.setFont(font)
+        self.material.setObjectName("material")
+        self.formLayout.setWidget(0, QtWidgets.QFormLayout.LabelRole, self.material)
+        self.materialType = QtWidgets.QComboBox(Form)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setUnderline(False)
+        font.setWeight(75)
+        self.materialType.setFont(font)
+        self.materialType.setMaxVisibleItems(11)
+        self.materialType.setObjectName("materialType")
+        self.formLayout.setWidget(0, QtWidgets.QFormLayout.FieldRole, self.materialType)
+        self.gridLayout_3.addLayout(self.formLayout, 0, 0, 1, 1)
+        self.plainTextEdit = QtWidgets.QPlainTextEdit(Form)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        self.plainTextEdit.setFont(font)
+        self.plainTextEdit.setPlainText("")
+        self.plainTextEdit.setObjectName("plainTextEdit")
+        self.gridLayout_3.addWidget(self.plainTextEdit, 2, 0, 1, 1)
+        self.splitter_2 = QtWidgets.QSplitter(Form)
+        self.splitter_2.setOrientation(QtCore.Qt.Horizontal)
+        self.splitter_2.setObjectName("splitter_2")
+        self.open = QtWidgets.QPushButton(self.splitter_2)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.open.setFont(font)
+        self.open.setObjectName("open")
+        self.save = QtWidgets.QPushButton(self.splitter_2)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.save.setFont(font)
+        self.save.setObjectName("save")
+        self.gridLayout_3.addWidget(self.splitter_2, 1, 0, 1, 1)
+        self.horizontalLayout = QtWidgets.QHBoxLayout()
+        self.horizontalLayout.setObjectName("horizontalLayout")
+        self.gridLayout = QtWidgets.QGridLayout()
+        self.gridLayout.setObjectName("gridLayout")
+        self.label = QtWidgets.QLabel(Form)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.label.setFont(font)
+        self.label.setObjectName("label")
+        self.gridLayout.addWidget(self.label, 0, 0, 1, 1)
+        self.versionCode = QtWidgets.QLabel(Form)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        self.versionCode.setFont(font)
+        self.versionCode.setObjectName("versionCode")
+        self.gridLayout.addWidget(self.versionCode, 0, 1, 1, 1)
+        self.horizontalLayout.addLayout(self.gridLayout)
+        spacerItem = QtWidgets.QSpacerItem(40, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
+        self.horizontalLayout.addItem(spacerItem)
+        self.gridLayout_2 = QtWidgets.QGridLayout()
+        self.gridLayout_2.setObjectName("gridLayout_2")
+        self.Deliverydate = QtWidgets.QLabel(Form)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        self.Deliverydate.setFont(font)
+        self.Deliverydate.setObjectName("Deliverydate")
+        self.gridLayout_2.addWidget(self.Deliverydate, 0, 1, 1, 1)
+        self.label_5 = QtWidgets.QLabel(Form)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.label_5.setFont(font)
+        self.label_5.setObjectName("label_5")
+        self.gridLayout_2.addWidget(self.label_5, 0, 0, 1, 1)
+        self.horizontalLayout.addLayout(self.gridLayout_2)
+        self.gridLayout_3.addLayout(self.horizontalLayout, 3, 0, 1, 1)
+
+        self.retranslateUi(Form)
+        QtCore.QMetaObject.connectSlotsByName(Form)
+
+    def retranslateUi(self, Form):
+        _translate = QtCore.QCoreApplication.translate
+        Form.setWindowTitle(_translate("Form", "Form"))
+        self.material.setText(_translate("Form", "物料类型"))
+        self.open.setText(_translate("Form", "打开文件"))
+        self.save.setText(_translate("Form", "另保存"))
+        self.label.setText(_translate("Form", "版本代码:"))
+        self.versionCode.setText(_translate("Form", "1111"))
+        self.Deliverydate.setText(_translate("Form", "1111"))
+        self.label_5.setText(_translate("Form", "发料日期:"))

+ 174 - 0
ScanUtils/ui/Scan.ui

@@ -0,0 +1,174 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>998</width>
+    <height>811</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout_3">
+   <item row="0" column="0">
+    <layout class="QFormLayout" name="formLayout">
+     <item row="0" column="0">
+      <widget class="QLabel" name="material">
+       <property name="font">
+        <font>
+         <pointsize>14</pointsize>
+         <weight>75</weight>
+         <bold>true</bold>
+        </font>
+       </property>
+       <property name="text">
+        <string>物料类型</string>
+       </property>
+      </widget>
+     </item>
+     <item row="0" column="1">
+      <widget class="QComboBox" name="materialType">
+       <property name="font">
+        <font>
+         <pointsize>14</pointsize>
+         <weight>75</weight>
+         <bold>true</bold>
+         <underline>false</underline>
+        </font>
+       </property>
+       <property name="maxVisibleItems">
+        <number>11</number>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="2" column="0">
+    <widget class="QPlainTextEdit" name="plainTextEdit">
+     <property name="font">
+      <font>
+       <pointsize>14</pointsize>
+      </font>
+     </property>
+     <property name="plainText">
+      <string/>
+     </property>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="QSplitter" name="splitter_2">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
+     </property>
+     <widget class="QPushButton" name="open">
+      <property name="font">
+       <font>
+        <pointsize>14</pointsize>
+        <weight>75</weight>
+        <bold>true</bold>
+       </font>
+      </property>
+      <property name="text">
+       <string>打开文件</string>
+      </property>
+     </widget>
+     <widget class="QPushButton" name="save">
+      <property name="font">
+       <font>
+        <pointsize>14</pointsize>
+        <weight>75</weight>
+        <bold>true</bold>
+       </font>
+      </property>
+      <property name="text">
+       <string>另存为</string>
+      </property>
+     </widget>
+    </widget>
+   </item>
+   <item row="3" column="0">
+    <layout class="QHBoxLayout" name="horizontalLayout">
+     <item>
+      <layout class="QGridLayout" name="gridLayout">
+       <item row="0" column="0">
+        <widget class="QLabel" name="label">
+         <property name="font">
+          <font>
+           <pointsize>14</pointsize>
+           <weight>75</weight>
+           <bold>true</bold>
+          </font>
+         </property>
+         <property name="text">
+          <string>版本代码:</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="1">
+        <widget class="QLabel" name="versionCode">
+         <property name="font">
+          <font>
+           <pointsize>14</pointsize>
+          </font>
+         </property>
+         <property name="text">
+          <string>1111</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+     <item>
+      <spacer name="horizontalSpacer">
+       <property name="orientation">
+        <enum>Qt::Horizontal</enum>
+       </property>
+       <property name="sizeHint" stdset="0">
+        <size>
+         <width>40</width>
+         <height>20</height>
+        </size>
+       </property>
+      </spacer>
+     </item>
+     <item>
+      <layout class="QGridLayout" name="gridLayout_2">
+       <item row="0" column="1">
+        <widget class="QLabel" name="Deliverydate">
+         <property name="font">
+          <font>
+           <pointsize>14</pointsize>
+          </font>
+         </property>
+         <property name="text">
+          <string>1111</string>
+         </property>
+        </widget>
+       </item>
+       <item row="0" column="0">
+        <widget class="QLabel" name="label_5">
+         <property name="font">
+          <font>
+           <pointsize>14</pointsize>
+           <weight>75</weight>
+           <bold>true</bold>
+          </font>
+         </property>
+         <property name="text">
+          <string>发料日期:</string>
+         </property>
+        </widget>
+       </item>
+      </layout>
+     </item>
+    </layout>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 281 - 0
ScanUtils/ui/VersionSet.py

@@ -0,0 +1,281 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'VersionSet.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_Form(object):
+    def setupUi(self, Form):
+        Form.setObjectName("Form")
+        Form.resize(555, 637)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        Form.setFont(font)
+        self.gridLayout = QtWidgets.QGridLayout(Form)
+        self.gridLayout.setObjectName("gridLayout")
+        self.groupBox_6 = QtWidgets.QGroupBox(Form)
+        self.groupBox_6.setObjectName("groupBox_6")
+        self.horizontalLayout_9 = QtWidgets.QHBoxLayout(self.groupBox_6)
+        self.horizontalLayout_9.setObjectName("horizontalLayout_9")
+        self.label_8 = QtWidgets.QLabel(self.groupBox_6)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.label_8.setFont(font)
+        self.label_8.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
+        self.label_8.setObjectName("label_8")
+        self.horizontalLayout_9.addWidget(self.label_8)
+        self.capVoltage = QtWidgets.QComboBox(self.groupBox_6)
+        self.capVoltage.setObjectName("capVoltage")
+        self.horizontalLayout_9.addWidget(self.capVoltage)
+        self.horizontalLayout_9.setStretch(1, 1)
+        self.gridLayout.addWidget(self.groupBox_6, 2, 0, 1, 1)
+        self.groupBox_3 = QtWidgets.QGroupBox(Form)
+        self.groupBox_3.setObjectName("groupBox_3")
+        self.horizontalLayout_3 = QtWidgets.QHBoxLayout(self.groupBox_3)
+        self.horizontalLayout_3.setObjectName("horizontalLayout_3")
+        self.label_6 = QtWidgets.QLabel(self.groupBox_3)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.label_6.setFont(font)
+        self.label_6.setObjectName("label_6")
+        self.horizontalLayout_3.addWidget(self.label_6)
+        self.bridgeType = QtWidgets.QComboBox(self.groupBox_3)
+        self.bridgeType.setObjectName("bridgeType")
+        self.horizontalLayout_3.addWidget(self.bridgeType)
+        self.label_7 = QtWidgets.QLabel(self.groupBox_3)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.label_7.setFont(font)
+        self.label_7.setObjectName("label_7")
+        self.horizontalLayout_3.addWidget(self.label_7)
+        self.bridgeValue = QtWidgets.QComboBox(self.groupBox_3)
+        self.bridgeValue.setObjectName("bridgeValue")
+        self.horizontalLayout_3.addWidget(self.bridgeValue)
+        self.horizontalLayout_3.setStretch(1, 1)
+        self.horizontalLayout_3.setStretch(3, 1)
+        self.gridLayout.addWidget(self.groupBox_3, 4, 0, 1, 1)
+        self.groupBox_5 = QtWidgets.QGroupBox(Form)
+        self.groupBox_5.setObjectName("groupBox_5")
+        self.gridLayout_2 = QtWidgets.QGridLayout(self.groupBox_5)
+        self.gridLayout_2.setObjectName("gridLayout_2")
+        self.horizontalLayout_5 = QtWidgets.QHBoxLayout()
+        self.horizontalLayout_5.setObjectName("horizontalLayout_5")
+        self.label_15 = QtWidgets.QLabel(self.groupBox_5)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.label_15.setFont(font)
+        self.label_15.setObjectName("label_15")
+        self.horizontalLayout_5.addWidget(self.label_15)
+        self.pcbVender = QtWidgets.QComboBox(self.groupBox_5)
+        self.pcbVender.setObjectName("pcbVender")
+        self.horizontalLayout_5.addWidget(self.pcbVender)
+        self.label_12 = QtWidgets.QLabel(self.groupBox_5)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.label_12.setFont(font)
+        self.label_12.setObjectName("label_12")
+        self.horizontalLayout_5.addWidget(self.label_12)
+        self.pcbVer = QtWidgets.QComboBox(self.groupBox_5)
+        self.pcbVer.setObjectName("pcbVer")
+        self.horizontalLayout_5.addWidget(self.pcbVer)
+        self.horizontalLayout_5.setStretch(1, 1)
+        self.horizontalLayout_5.setStretch(3, 1)
+        self.gridLayout_2.addLayout(self.horizontalLayout_5, 0, 0, 1, 1)
+        self.horizontalLayout_10 = QtWidgets.QHBoxLayout()
+        self.horizontalLayout_10.setObjectName("horizontalLayout_10")
+        self.label_13 = QtWidgets.QLabel(self.groupBox_5)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.label_13.setFont(font)
+        self.label_13.setObjectName("label_13")
+        self.horizontalLayout_10.addWidget(self.label_13)
+        self.lineType = QtWidgets.QComboBox(self.groupBox_5)
+        self.lineType.setObjectName("lineType")
+        self.horizontalLayout_10.addWidget(self.lineType)
+        self.horizontalLayout_10.setStretch(1, 1)
+        self.gridLayout_2.addLayout(self.horizontalLayout_10, 1, 0, 1, 1)
+        self.gridLayout.addWidget(self.groupBox_5, 5, 0, 1, 1)
+        self.horizontalLayout_7 = QtWidgets.QHBoxLayout()
+        self.horizontalLayout_7.setObjectName("horizontalLayout_7")
+        self.label = QtWidgets.QLabel(Form)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.label.setFont(font)
+        self.label.setObjectName("label")
+        self.horizontalLayout_7.addWidget(self.label)
+        self.versionCode = QtWidgets.QLabel(Form)
+        self.versionCode.setObjectName("versionCode")
+        self.horizontalLayout_7.addWidget(self.versionCode)
+        self.commit = QtWidgets.QPushButton(Form)
+        self.commit.setMinimumSize(QtCore.QSize(120, 35))
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.commit.setFont(font)
+        self.commit.setObjectName("commit")
+        self.horizontalLayout_7.addWidget(self.commit)
+        self.horizontalLayout_7.setStretch(1, 1)
+        self.gridLayout.addLayout(self.horizontalLayout_7, 7, 0, 1, 1)
+        self.groupBox = QtWidgets.QGroupBox(Form)
+        self.groupBox.setObjectName("groupBox")
+        self.horizontalLayout = QtWidgets.QHBoxLayout(self.groupBox)
+        self.horizontalLayout.setObjectName("horizontalLayout")
+        self.label_2 = QtWidgets.QLabel(self.groupBox)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.label_2.setFont(font)
+        self.label_2.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
+        self.label_2.setObjectName("label_2")
+        self.horizontalLayout.addWidget(self.label_2)
+        self.workCapValue = QtWidgets.QComboBox(self.groupBox)
+        self.workCapValue.setObjectName("workCapValue")
+        self.horizontalLayout.addWidget(self.workCapValue)
+        self.label_14 = QtWidgets.QLabel(self.groupBox)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.label_14.setFont(font)
+        self.label_14.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
+        self.label_14.setObjectName("label_14")
+        self.horizontalLayout.addWidget(self.label_14)
+        self.workCapVender = QtWidgets.QComboBox(self.groupBox)
+        self.workCapVender.setObjectName("workCapVender")
+        self.horizontalLayout.addWidget(self.workCapVender)
+        self.horizontalLayout.setStretch(1, 1)
+        self.horizontalLayout.setStretch(3, 1)
+        self.gridLayout.addWidget(self.groupBox, 0, 0, 1, 1)
+        self.groupBox_4 = QtWidgets.QGroupBox(Form)
+        self.groupBox_4.setObjectName("groupBox_4")
+        self.horizontalLayout_4 = QtWidgets.QHBoxLayout(self.groupBox_4)
+        self.horizontalLayout_4.setObjectName("horizontalLayout_4")
+        self.label_9 = QtWidgets.QLabel(self.groupBox_4)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.label_9.setFont(font)
+        self.label_9.setObjectName("label_9")
+        self.horizontalLayout_4.addWidget(self.label_9)
+        self.chipVer_1 = QtWidgets.QComboBox(self.groupBox_4)
+        self.chipVer_1.setObjectName("chipVer_1")
+        self.horizontalLayout_4.addWidget(self.chipVer_1)
+        self.label_10 = QtWidgets.QLabel(self.groupBox_4)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.label_10.setFont(font)
+        self.label_10.setObjectName("label_10")
+        self.horizontalLayout_4.addWidget(self.label_10)
+        self.chipVer_2 = QtWidgets.QComboBox(self.groupBox_4)
+        self.chipVer_2.setObjectName("chipVer_2")
+        self.horizontalLayout_4.addWidget(self.chipVer_2)
+        self.horizontalLayout_4.setStretch(1, 1)
+        self.horizontalLayout_4.setStretch(3, 1)
+        self.gridLayout.addWidget(self.groupBox_4, 3, 0, 1, 1)
+        self.groupBox_7 = QtWidgets.QGroupBox(Form)
+        self.groupBox_7.setObjectName("groupBox_7")
+        self.horizontalLayout_8 = QtWidgets.QHBoxLayout(self.groupBox_7)
+        self.horizontalLayout_8.setObjectName("horizontalLayout_8")
+        self.label_16 = QtWidgets.QLabel(self.groupBox_7)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.label_16.setFont(font)
+        self.label_16.setObjectName("label_16")
+        self.horizontalLayout_8.addWidget(self.label_16)
+        self.productDate = QtWidgets.QDateEdit(self.groupBox_7)
+        self.productDate.setMaximumDateTime(QtCore.QDateTime(QtCore.QDate(2029, 12, 31), QtCore.QTime(23, 59, 59)))
+        self.productDate.setMinimumDate(QtCore.QDate(2023, 1, 1))
+        self.productDate.setObjectName("productDate")
+        self.horizontalLayout_8.addWidget(self.productDate)
+        self.horizontalLayout_8.setStretch(1, 1)
+        self.gridLayout.addWidget(self.groupBox_7, 6, 0, 1, 1)
+        self.groupBox_2 = QtWidgets.QGroupBox(Form)
+        self.groupBox_2.setObjectName("groupBox_2")
+        self.horizontalLayout_2 = QtWidgets.QHBoxLayout(self.groupBox_2)
+        self.horizontalLayout_2.setObjectName("horizontalLayout_2")
+        self.label_3 = QtWidgets.QLabel(self.groupBox_2)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.label_3.setFont(font)
+        self.label_3.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
+        self.label_3.setObjectName("label_3")
+        self.horizontalLayout_2.addWidget(self.label_3)
+        self.blastCapValue = QtWidgets.QComboBox(self.groupBox_2)
+        self.blastCapValue.setObjectName("blastCapValue")
+        self.horizontalLayout_2.addWidget(self.blastCapValue)
+        self.label_5 = QtWidgets.QLabel(self.groupBox_2)
+        font = QtGui.QFont()
+        font.setPointSize(14)
+        font.setBold(True)
+        font.setWeight(75)
+        self.label_5.setFont(font)
+        self.label_5.setAlignment(QtCore.Qt.AlignRight|QtCore.Qt.AlignTrailing|QtCore.Qt.AlignVCenter)
+        self.label_5.setObjectName("label_5")
+        self.horizontalLayout_2.addWidget(self.label_5)
+        self.blastCapVender = QtWidgets.QComboBox(self.groupBox_2)
+        self.blastCapVender.setObjectName("blastCapVender")
+        self.horizontalLayout_2.addWidget(self.blastCapVender)
+        self.horizontalLayout_2.setStretch(1, 1)
+        self.horizontalLayout_2.setStretch(3, 1)
+        self.gridLayout.addWidget(self.groupBox_2, 1, 0, 1, 1)
+
+        self.retranslateUi(Form)
+        QtCore.QMetaObject.connectSlotsByName(Form)
+
+    def retranslateUi(self, Form):
+        _translate = QtCore.QCoreApplication.translate
+        Form.setWindowTitle(_translate("Form", "Form"))
+        self.groupBox_6.setTitle(_translate("Form", "数字电容和起爆电容"))
+        self.label_8.setText(_translate("Form", "耐压"))
+        self.groupBox_3.setTitle(_translate("Form", "桥丝"))
+        self.label_6.setText(_translate("Form", "引火件形式"))
+        self.label_7.setText(_translate("Form", "桥丝规格"))
+        self.groupBox_5.setTitle(_translate("Form", "PCB"))
+        self.label_15.setText(_translate("Form", "PCB供应商"))
+        self.label_12.setText(_translate("Form", "PCB版本流水号"))
+        self.label_13.setText(_translate("Form", "脚线连接方式"))
+        self.label.setText(_translate("Form", "版本代码:"))
+        self.versionCode.setText(_translate("Form", "001122"))
+        self.commit.setText(_translate("Form", "确定"))
+        self.groupBox.setTitle(_translate("Form", "数字电容"))
+        self.label_2.setText(_translate("Form", "容值"))
+        self.label_14.setText(_translate("Form", "品牌"))
+        self.groupBox_4.setTitle(_translate("Form", "芯片"))
+        self.label_9.setText(_translate("Form", "芯片主版本"))
+        self.label_10.setText(_translate("Form", "芯片次版本"))
+        self.groupBox_7.setTitle(_translate("Form", "发料日期"))
+        self.label_16.setText(_translate("Form", "发料日期"))
+        self.productDate.setDisplayFormat(_translate("Form", "yyyy年M月d日"))
+        self.groupBox_2.setTitle(_translate("Form", "起爆电容"))
+        self.label_3.setText(_translate("Form", "容值"))
+        self.label_5.setText(_translate("Form", "品牌"))

+ 399 - 0
ScanUtils/ui/VersionSet.ui

@@ -0,0 +1,399 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Form</class>
+ <widget class="QWidget" name="Form">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>555</width>
+    <height>637</height>
+   </rect>
+  </property>
+  <property name="font">
+   <font>
+    <pointsize>14</pointsize>
+   </font>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <layout class="QGridLayout" name="gridLayout">
+   <item row="2" column="0">
+    <widget class="QGroupBox" name="groupBox_6">
+     <property name="title">
+      <string>数字电容和起爆电容</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_9" stretch="0,1">
+      <item>
+       <widget class="QLabel" name="label_8">
+        <property name="font">
+         <font>
+          <pointsize>14</pointsize>
+          <weight>75</weight>
+          <bold>true</bold>
+         </font>
+        </property>
+        <property name="text">
+         <string>耐压</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QComboBox" name="capVoltage"/>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="4" column="0">
+    <widget class="QGroupBox" name="groupBox_3">
+     <property name="title">
+      <string>桥丝</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_3" stretch="0,1,0,1">
+      <item>
+       <widget class="QLabel" name="label_6">
+        <property name="font">
+         <font>
+          <pointsize>14</pointsize>
+          <weight>75</weight>
+          <bold>true</bold>
+         </font>
+        </property>
+        <property name="text">
+         <string>引火件形式</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QComboBox" name="bridgeType"/>
+      </item>
+      <item>
+       <widget class="QLabel" name="label_7">
+        <property name="font">
+         <font>
+          <pointsize>14</pointsize>
+          <weight>75</weight>
+          <bold>true</bold>
+         </font>
+        </property>
+        <property name="text">
+         <string>桥丝规格</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QComboBox" name="bridgeValue"/>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="5" column="0">
+    <widget class="QGroupBox" name="groupBox_5">
+     <property name="title">
+      <string>PCB</string>
+     </property>
+     <layout class="QGridLayout" name="gridLayout_2">
+      <item row="0" column="0">
+       <layout class="QHBoxLayout" name="horizontalLayout_5" stretch="0,1,0,1">
+        <item>
+         <widget class="QLabel" name="label_15">
+          <property name="font">
+           <font>
+            <pointsize>14</pointsize>
+            <weight>75</weight>
+            <bold>true</bold>
+           </font>
+          </property>
+          <property name="text">
+           <string>PCB供应商</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="pcbVender"/>
+        </item>
+        <item>
+         <widget class="QLabel" name="label_12">
+          <property name="font">
+           <font>
+            <pointsize>14</pointsize>
+            <weight>75</weight>
+            <bold>true</bold>
+           </font>
+          </property>
+          <property name="text">
+           <string>PCB版本流水号</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="pcbVer"/>
+        </item>
+       </layout>
+      </item>
+      <item row="1" column="0">
+       <layout class="QHBoxLayout" name="horizontalLayout_10" stretch="0,1">
+        <item>
+         <widget class="QLabel" name="label_13">
+          <property name="font">
+           <font>
+            <pointsize>14</pointsize>
+            <weight>75</weight>
+            <bold>true</bold>
+           </font>
+          </property>
+          <property name="text">
+           <string>脚线连接方式</string>
+          </property>
+         </widget>
+        </item>
+        <item>
+         <widget class="QComboBox" name="lineType"/>
+        </item>
+       </layout>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="7" column="0">
+    <layout class="QHBoxLayout" name="horizontalLayout_7" stretch="0,1,0">
+     <item>
+      <widget class="QLabel" name="label">
+       <property name="font">
+        <font>
+         <pointsize>14</pointsize>
+         <weight>75</weight>
+         <bold>true</bold>
+        </font>
+       </property>
+       <property name="text">
+        <string>版本代码:</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLabel" name="versionCode">
+       <property name="text">
+        <string>001122</string>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QPushButton" name="commit">
+       <property name="minimumSize">
+        <size>
+         <width>120</width>
+         <height>35</height>
+        </size>
+       </property>
+       <property name="font">
+        <font>
+         <pointsize>14</pointsize>
+         <weight>75</weight>
+         <bold>true</bold>
+        </font>
+       </property>
+       <property name="text">
+        <string>确定</string>
+       </property>
+      </widget>
+     </item>
+    </layout>
+   </item>
+   <item row="0" column="0">
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string>数字电容</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout" stretch="0,1,0,1">
+      <item>
+       <widget class="QLabel" name="label_2">
+        <property name="font">
+         <font>
+          <pointsize>14</pointsize>
+          <weight>75</weight>
+          <bold>true</bold>
+         </font>
+        </property>
+        <property name="text">
+         <string>容值</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QComboBox" name="workCapValue"/>
+      </item>
+      <item>
+       <widget class="QLabel" name="label_14">
+        <property name="font">
+         <font>
+          <pointsize>14</pointsize>
+          <weight>75</weight>
+          <bold>true</bold>
+         </font>
+        </property>
+        <property name="text">
+         <string>品牌</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QComboBox" name="workCapVender"/>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="3" column="0">
+    <widget class="QGroupBox" name="groupBox_4">
+     <property name="title">
+      <string>芯片</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_4" stretch="0,1,0,1">
+      <item>
+       <widget class="QLabel" name="label_9">
+        <property name="font">
+         <font>
+          <pointsize>14</pointsize>
+          <weight>75</weight>
+          <bold>true</bold>
+         </font>
+        </property>
+        <property name="text">
+         <string>芯片主版本</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QComboBox" name="chipVer_1"/>
+      </item>
+      <item>
+       <widget class="QLabel" name="label_10">
+        <property name="font">
+         <font>
+          <pointsize>14</pointsize>
+          <weight>75</weight>
+          <bold>true</bold>
+         </font>
+        </property>
+        <property name="text">
+         <string>芯片次版本</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QComboBox" name="chipVer_2"/>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="6" column="0">
+    <widget class="QGroupBox" name="groupBox_7">
+     <property name="title">
+      <string>发料日期</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_8" stretch="0,1">
+      <item>
+       <widget class="QLabel" name="label_16">
+        <property name="font">
+         <font>
+          <pointsize>14</pointsize>
+          <weight>75</weight>
+          <bold>true</bold>
+         </font>
+        </property>
+        <property name="text">
+         <string>发料日期</string>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QDateEdit" name="productDate">
+        <property name="maximumDateTime">
+         <datetime>
+          <hour>23</hour>
+          <minute>59</minute>
+          <second>59</second>
+          <year>2029</year>
+          <month>12</month>
+          <day>31</day>
+         </datetime>
+        </property>
+        <property name="minimumDate">
+         <date>
+          <year>2023</year>
+          <month>1</month>
+          <day>1</day>
+         </date>
+        </property>
+        <property name="displayFormat">
+         <string>yyyy年M月d日</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
+    </widget>
+   </item>
+   <item row="1" column="0">
+    <widget class="QGroupBox" name="groupBox_2">
+     <property name="title">
+      <string>起爆电容</string>
+     </property>
+     <layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,1,0,1">
+      <item>
+       <widget class="QLabel" name="label_3">
+        <property name="font">
+         <font>
+          <pointsize>14</pointsize>
+          <weight>75</weight>
+          <bold>true</bold>
+         </font>
+        </property>
+        <property name="text">
+         <string>容值</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QComboBox" name="blastCapValue"/>
+      </item>
+      <item>
+       <widget class="QLabel" name="label_5">
+        <property name="font">
+         <font>
+          <pointsize>14</pointsize>
+          <weight>75</weight>
+          <bold>true</bold>
+         </font>
+        </property>
+        <property name="text">
+         <string>品牌</string>
+        </property>
+        <property name="alignment">
+         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
+        </property>
+       </widget>
+      </item>
+      <item>
+       <widget class="QComboBox" name="blastCapVender"/>
+      </item>
+     </layout>
+    </widget>
+   </item>
+  </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>

+ 7 - 0
ScanUtils/ui/__init__.py

@@ -0,0 +1,7 @@
+# coding:utf8
+'''
+@Project :Scan 
+@File :__init__.py.py
+@Author :Leslie
+@Date :2023/5/5 17:06 
+'''