From 0fbb2cb4611b0b0eb748426a1340bba6fe603b74 Mon Sep 17 00:00:00 2001 From: wangfq Date: Fri, 31 Jul 2026 09:59:12 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20DLD154Tool=20README=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20Windows/Linux=20=E6=89=93=E5=8C=85=E8=AF=B4?= =?UTF-8?q?=E6=98=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DLD154Tool/README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/DLD154Tool/README.md b/DLD154Tool/README.md index 259c102..c3214c9 100644 --- a/DLD154Tool/README.md +++ b/DLD154Tool/README.md @@ -57,11 +57,37 @@ DLD154Tool/ ├── serial_client.py # 串口抽象层 (扫描/连接/收发) ├── protocol_700bs.py # 700BS 协议编解码 ├── protocol_modbus.py # Modbus RTU 协议编解码 + CRC16 +├── DLD154Tool.spec # PyInstaller 打包配置 ├── requirements.txt # pyside6, pyserial ├── .gitignore +├── dist/ # 打包产物 (gitignored) └── README.md ``` +## 打包为可执行文件 + +PyInstaller **不支持跨平台交叉编译**,需要在目标系统上执行。 + +### Linux + +```bash +pip install pyinstaller +pyinstaller DLD154Tool.spec +# → dist/DLD154Tool (69MB, 单文件 ELF x86-64) +``` + +### Windows + +```cmd +python -m venv venv +venv\Scripts\activate +pip install -r requirements.txt pyinstaller +pyinstaller DLD154Tool.spec +:: → dist\DLD154Tool.exe (单文件,双击运行) +``` + +> spec 文件已预置,无需重新生成。产物 `dist/` 目录已加入 `.gitignore`。 + ## RS485 接线 ```