# PyCom **Repository Path**: phoenix_pond_chant/PyCom ## Basic Information - **Project Name**: PyCom - **Description**: 异步串口通信库 - PySide6+MVVM架构 | 推荐新版: SerialForge | Async serial communication - **Primary Language**: Python - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 30 - **Created**: 2024-07-23 - **Last Updated**: 2026-06-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README
# 🔌 PyCom **高性能异步串口通信调试工具** 基于 PyQt5 + pyserial 构建 | 异步架构 | 多窗口 | 自定义指令 [![Python](https://img.shields.io/badge/Python-3.8+-blue.svg)](https://python.org) [![License](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE) [![Stars](https://gitee.com/phoenix_pond_chant/PyCom/badge/star.svg)](https://gitee.com/phoenix_pond_chant/PyCom) [![Forks](https://gitee.com/phoenix_pond_chant/PyCom/badge/fork.svg)](https://gitee.com/phoenix_pond_chant/PyCom) [![Pipeline](https://gitee.com/phoenix_pond_chant/PyCom/badges/master/build.svg)](https://gitee.com/phoenix_pond_chant/PyCom/pipelines) [![Contributing](https://img.shields.io/badge/contributing-welcome-green)](CONTRIBUTING.md) [![Changelog](https://img.shields.io/badge/changelog-keepachangelog-blue)](CHANGELOG.md)
--- ## ✨ 为什么选择 PyCom? 传统串口工具(如 SSCOM、串口调试助手)大多基于同步阻塞模型,在高频数据收发场景下容易出现卡顿、丢包。PyCom 采用 **异步 I/O 架构**,配合现代化 UI,为嵌入式开发者提供更流畅的调试体验。 --- ## 🚀 核心功能 | 功能 | 说明 | |:---|:---| | ⚡ **异步串口通信** | 基于 `asyncio` + `serial-asyncio`,非阻塞收发,高频场景不卡顿 | | 🪟 **多窗口支持** | 同时打开多个串口连接,并行调试不同设备 | | 📋 **自定义指令集** | 通过 CSV 配置文件批量定义指令,支持分类管理 | | 📌 **侧边栏快捷面板** | 指令分类展示,支持左右拉伸调整宽度 | | 🔄 **循环发送** | 对指定指令进行定时循环发送,适合压力测试 | | 📝 **多指令队列** | 自定义指令发送顺序和间隔时间,自动化测试利器 | | 🎛️ **灵活参数过滤** | HEX/ASCII 双模式接收,支持自定义字节数(2~256) | | 💾 **日志持久化** | 收发数据自动记录,支持导出分析 | | ⌨️ **快捷操作** | 回车快速发送,操作效率拉满 | --- ## 📸 界面预览
### 主界面 ![主界面](ui/images/index_img.png) ### 侧边栏指令面板 ![侧边栏](ui/images/side_img.png) ### 串口配置 ![串口设置](ui/images/serial_img.png) ### 参数过滤 ![参数过滤](ui/images/filter_img.png) ### 多指令发送 ![多指令](ui/images/instruction_img.png) ### 功能面板 ![功能使用](ui/images/use_img.png)
--- ## 📦 快速开始 ### 环境要求 - Python 3.8+ - 操作系统:Windows / macOS / Linux ### 安装 ```bash # 克隆项目 git clone https://gitee.com/phoenix_pond_chant/PyCom.git cd PyCom # 安装依赖 pip install -r requirements.txt ``` ### 启动 ```bash python main.py ``` ### 📺 演示视频 👉 [Bilibili 使用教程](https://www.bilibili.com/video/BV1yy411z7Eg/) --- ## 🧪 测试 项目包含完整的单元测试,覆盖串口通信核心逻辑: ```bash # 运行全部测试 pytest # 指定模块 pytest tests/test_serial.py -v pytest tests/test_thread.py -v # 生成覆盖率报告 pytest --cov=functions --cov-report=html ``` **测试覆盖范围:** - 串口配置参数验证 - 连接管理与异常处理 - HEX/ASCII 数据格式转换 - 异步通信协议帧解析 - 多线程安全性 --- ## 📂 项目结构 ``` PyCom/ ├── ui/ # UI 层 │ ├── index.py # 主窗口 │ ├── serial_config.py # 串口配置界面 │ ├── instruction.py # 指令管理界面 │ ├── parameter_filter.py # 参数过滤界面 │ ├── upgrade.py # 升级模块(开发中) │ ├── icon/ # 图标资源 │ └── images/ # UI 截图 ├── functions/ # 核心逻辑 │ ├── serial_work.py # 异步串口通信引擎 │ ├── serial_thread.py # 串口线程管理 │ ├── serial_config.py # 串口配置逻辑 │ ├── instruction_config.py # 指令配置解析 │ ├── log_func.py # 日志功能 │ ├── fast_btn_func.py # 快捷按钮逻辑 │ └── tool.py # 工具函数 ├── config/ # 配置文件 │ ├── instruction_config.csv # 指令配置(CSV) │ ├── fast_btn_config.ini # 快捷按钮配置 │ └── handel_config.py # 配置处理 ├── tests/ # 单元测试 ├── requirements.txt └── README.md ``` --- ## ⚔️ 竞品对比 | 特性 | **PyCom** | SSCOM | 串口调试助手 | CuteCom | |:---|:---:|:---:|:---:|:---:| | 异步通信 | ✅ | ❌ | ❌ | ❌ | | 多窗口 | ✅ | ❌ | ❌ | ✅ | | 自定义指令集 | ✅ CSV 配置 | ⚠️ 有限 | ❌ | ❌ | | 循环发送 | ✅ | ✅ | ✅ | ❌ | | 多指令队列 | ✅ | ❌ | ❌ | ❌ | | 参数过滤 | ✅ | ⚠️ 基础 | ⚠️ 基础 | ❌ | | 跨平台 | ✅ | ❌ Windows | ❌ Windows | ✅ | | 开源 | ✅ | ❌ | ❌ | ✅ | | UI 现代化 | ✅ Element 风格 | ⚠️ | ⚠️ | ⚠️ | --- ## 🗺️ 路线图 - [ ] PySide6 迁移(进行中,参见 [beautifulcom](https://gitee.com/qinganan_admin/beautifulcom)) - [ ] 升级模块完善 - [ ] 数据波形实时绘制 - [ ] Modbus 协议支持 - [ ] 插件系统 --- ## 🤝 参与贡献 欢迎提交 Issue 和 Pull Request! **开发者:** 清安 **微信:** `qing_an_an` **公众号:** 测个der --- ## 📄 开源协议 本项目基于 [MIT License](LICENSE) 开源。 ---
**如果觉得有帮助,请点个 ⭐ Star 支持一下!** [![Star](https://gitee.com/phoenix_pond_chant/PyCom/badge/star.svg)](https://gitee.com/phoenix_pond_chant/PyCom)
## 📄 License 本项目基于 [MIT License](LICENSE) 开源。