docs: DLD154Tool README 增加 Windows/Linux 打包说明
This commit is contained in:
@@ -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 接线
|
||||
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user