撕裂增加实时上传功能

This commit is contained in:
yiyi 2026-02-21 13:53:33 +08:00
parent 51f519fa91
commit a88e30cb76
5 changed files with 2562 additions and 2512 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,29 +1,29 @@
#ifndef VERSION_H
#define VERSION_H
#define BELT_TEARING_SERVER_VERSION_STRING "2.0.6"
#define BELT_TEARING_SERVER_VERSION_BUILD "1"
#define BELT_TEARING_SERVER_PRODUCT_NAME "BeltTearingServer"
#define BELT_TEARING_SERVER_COMPANY_NAME "VisionRobot"
#define BELT_TEARING_SERVER_COPYRIGHT "Copyright (C) 2024-2025 VisionRobot. All rights reserved."
#define BELT_TEARING_SERVER_DESCRIPTION "Belt Tearing Detection Server with Camera Integration"
// 构建信息
#define BELT_TEARING_SERVER_BUILD_DATE __DATE__
#define BELT_TEARING_SERVER_BUILD_TIME __TIME__
#ifdef _WIN32
#define BELT_TEARING_SERVER_PLATFORM "Windows"
#elif __linux__
#define BELT_TEARING_SERVER_PLATFORM "Linux"
#else
#define BELT_TEARING_SERVER_PLATFORM "Unknown"
#endif
#ifdef _DEBUG
#define BELT_TEARING_SERVER_BUILD_TYPE "Debug"
#else
#define BELT_TEARING_SERVER_BUILD_TYPE "Release"
#endif
#endif // VERSION_H
#ifndef VERSION_H
#define VERSION_H
#define BELT_TEARING_SERVER_VERSION_STRING "2.0.7"
#define BELT_TEARING_SERVER_VERSION_BUILD "1"
#define BELT_TEARING_SERVER_PRODUCT_NAME "BeltTearingServer"
#define BELT_TEARING_SERVER_COMPANY_NAME "VisionRobot"
#define BELT_TEARING_SERVER_COPYRIGHT "Copyright (C) 2024-2025 VisionRobot. All rights reserved."
#define BELT_TEARING_SERVER_DESCRIPTION "Belt Tearing Detection Server with Camera Integration"
// 构建信息
#define BELT_TEARING_SERVER_BUILD_DATE __DATE__
#define BELT_TEARING_SERVER_BUILD_TIME __TIME__
#ifdef _WIN32
#define BELT_TEARING_SERVER_PLATFORM "Windows"
#elif __linux__
#define BELT_TEARING_SERVER_PLATFORM "Linux"
#else
#define BELT_TEARING_SERVER_PLATFORM "Unknown"
#endif
#ifdef _DEBUG
#define BELT_TEARING_SERVER_BUILD_TYPE "Debug"
#else
#define BELT_TEARING_SERVER_BUILD_TYPE "Release"
#endif
#endif // VERSION_H

View File

@ -1,3 +1,7 @@
# 2.0.7
## build_1 2026-02-21
1. 增加实时传输功能
# 2.0.6
## build_1 2026-02-03
1. 增加授权

View File

@ -1,14 +1,15 @@
# 皮带撕裂检测系统 TCP 通信协议
## 版本
版本: 1.3
日期: 2026-02-12
版本: 1.4
日期: 2026-02-21
---
### 版本历史
| 版本 | 日期 | 修改内容 | 作者 |
|------|------------|------------------|-------|
| 1.4 | 2026-02-21 | 开启实时上报时不再发送DETECT_RESULT避免重复输出增加CMD汇总表格 | |
| 1.3 | 2026-02-12 | 增加实时传输检测结果功能(SET_REALTIME/REALTIME_RESULT) | |
| 1.2 | 2025-11-30 | 增加最大撕裂ID字段(maxId) | |
| 1.1 | 2025-11-16 | 修改协议长度的格式 | |
@ -36,6 +37,19 @@
- 支持命令应答机制
- UTF-8编码
### 1.3 CMD 汇总表
| msgType | 方向 | 说明 | 详细章节 |
|---------|------|------|----------|
| `DETECT_RESULT` | 服务器 → 客户端 | 撕裂检测结果上报(历史最大值),仅发送给**未开启**实时传输的客户端 | 4.1 |
| `REALTIME_RESULT` | 服务器 → 客户端 | 实时检测结果上报(所有撕裂详细数据),仅发送给**已开启**实时传输的客户端 | 4.2 |
| `SET_SPEED` | 客户端 → 服务器 | 设置皮带速度mm/s | 5.1 |
| `SET_CONTROL` | 客户端 → 服务器 | 启动/停止检测 | 5.2 |
| `SET_REALTIME` | 客户端 → 服务器 | 开启/关闭实时传输 | 5.3 |
| `CMD_RESPONSE` | 服务器 → 客户端 | 控制命令的统一应答 | 6.1 |
| `HEARTBEAT` | 客户端 → 服务器 | 心跳消息 | 9.1 |
| `HEARTBEAT_ACK` | 服务器 → 客户端 | 心跳应答 | 9.1 |
---
## 2. 数据帧格式
@ -200,7 +214,7 @@
- 实时传输功能需要客户端通过 `SET_REALTIME` 命令开启
- 开启后,服务器每次完成一帧检测即上报一次结果
- 关闭实时传输后,服务器停止上报 `REALTIME_RESULT` 消息
- `REALTIME_RESULT``DETECT_RESULT` 独立,互不影响
- `REALTIME_RESULT``DETECT_RESULT` 互斥:开启实时传输的客户端只收到 `REALTIME_RESULT`,未开启的客户端只收到 `DETECT_RESULT`
- 当 count 为 0 时tears 为空数组 `[]`
**示例**(无撕裂时):