清理文档,只保留 README.md
This commit is contained in:
parent
9bcdc61c5a
commit
c83b7143da
197
MIGRATION.md
197
MIGRATION.md
@ -1,197 +0,0 @@
|
|||||||
# Utils 模块重构总结
|
|
||||||
|
|
||||||
## 修改概述
|
|
||||||
|
|
||||||
已成功将 Utils 目录设置为独立的 git 仓库,并更新了主项目中所有对 VrCommon、VrUtils 和 CloudUtils 的引用。
|
|
||||||
|
|
||||||
## 主要修改内容
|
|
||||||
|
|
||||||
### 1. Utils 目录结构
|
|
||||||
|
|
||||||
创建了独立的 Utils 模块,包含以下子模块:
|
|
||||||
|
|
||||||
```
|
|
||||||
Utils/
|
|
||||||
├── VrCommon/ # 核心接口和数据结构
|
|
||||||
├── VrUtils/ # 工具类库(JSON、log4cpp、tinyxml2、INI、MD5、CRC)
|
|
||||||
├── CloudUtils/ # 点云工具
|
|
||||||
├── DataUtils/ # 数据处理工具
|
|
||||||
│ ├── CloudMathClac/ # 点云数学计算
|
|
||||||
│ └── CoordinateTransform/ # 坐标转换
|
|
||||||
└── CloudView/ # 点云查看工具
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. 创建的新文件
|
|
||||||
|
|
||||||
- `Utils/Utils.pro` - Utils 模块主项目文件
|
|
||||||
- `Utils/README.md` - Utils 模块说明文档
|
|
||||||
- `Utils/.gitignore` - Git 忽略文件配置
|
|
||||||
|
|
||||||
### 3. 修改的 .pro 文件
|
|
||||||
|
|
||||||
#### 主项目
|
|
||||||
- `GrabBagPrj/GrabBagPrj.pro` - 将 VrCommon 和 VrUtils 的引用改为 Utils 模块
|
|
||||||
|
|
||||||
#### Utils 内部模块
|
|
||||||
- `Utils/VrCommon/VrCommon.pro` - 添加 VrConfigCmd.h 头文件
|
|
||||||
- `Utils/VrUtils/VrUtils.pro` - 保持不变
|
|
||||||
- `Utils/CloudUtils/CloudUtils.pro` - 更新 INCLUDEPATH 为相对路径
|
|
||||||
- `Utils/CloudView/CloudView.pro` - 更新 INCLUDEPATH 和 LIBS 路径
|
|
||||||
- `Utils/DataUtils/CloudMathClac/CloudMathClac.pro` - 更新 SDK 路径
|
|
||||||
- `Utils/DataUtils/CoordinateTransform/CoordinateTransform.pro` - 更新 SDK 路径
|
|
||||||
|
|
||||||
#### VrNets 模块
|
|
||||||
- `VrNets/VrTcpClient.pro` - 更新 INCLUDEPATH 和 LIBS 路径
|
|
||||||
- `VrNets/VrTcpServer.pro` - 更新 INCLUDEPATH 和 LIBS 路径
|
|
||||||
|
|
||||||
#### Module 模块
|
|
||||||
- `Module/ShareMem/ShareMem.pro` - 更新 INCLUDEPATH
|
|
||||||
- `Module/ThreadPool/ThreadPool.pro` - 更新 INCLUDEPATH(修正错误路径)
|
|
||||||
- `Module/ModbusTCPServer/ModbusTCPServer.pro` - 更新 INCLUDEPATH 和 LIBS
|
|
||||||
- `Module/BinocularMarkReceiver/BinocularMarkReceiver.pro` - 更新 INCLUDEPATH 和 LIBS
|
|
||||||
- `Module/HandEyeCalib/HandEyeCalib.pro` - 更新 INCLUDEPATH
|
|
||||||
- `Module/ChessboardDetector/ChessboardDetector.pro` - 更新 INCLUDEPATH
|
|
||||||
- `Module/AuthModule/AuthModule.pro` - 更新 INCLUDEPATH
|
|
||||||
|
|
||||||
#### Device 模块
|
|
||||||
- `Device/VrEyeDevice/VrEyeDevice.pro` - 更新 INCLUDEPATH 和 LIBS
|
|
||||||
- `Device/HikDevice/HikDevice.pro` - 更新 INCLUDEPATH 和 LIBS
|
|
||||||
- `Device/GalaxyDevice/GalaxyDevice.pro` - 更新 INCLUDEPATH 和 LIBS
|
|
||||||
- `Device/GlLineLaserDevice/GlLineLaserDevice.pro` - 更新 INCLUDEPATH 和 LIBS
|
|
||||||
- `Device/EpicEyeDevice/EpicEyeDevice.pro` - 更新 INCLUDEPATH
|
|
||||||
|
|
||||||
#### AppUtils 模块
|
|
||||||
- `AppUtils/AppCommon/AppCommon.pro` - 更新 INCLUDEPATH 和 LIBS
|
|
||||||
- `AppUtils/UICommon/UICommon.pro` - 更新 INCLUDEPATH
|
|
||||||
|
|
||||||
#### Tools 模块
|
|
||||||
- `Tools/AuthRegister/AuthRegister.pro` - 更新 LIBS
|
|
||||||
- `Tools/ConfigDecryptor/ConfigDecryptor.pro` - 更新 INCLUDEPATH 和 LIBS
|
|
||||||
- `Tools/CalibView/CalibView.pro` - 更新 INCLUDEPATH 和 LIBS
|
|
||||||
- `Tools/VrEyeView/VrEyeView.pro` - 更新 INCLUDEPATH 和 LIBS
|
|
||||||
|
|
||||||
#### App 模块(批量更新)
|
|
||||||
批量更新了 App 目录下所有应用程序的 .pro 文件(约 27 个文件),包括:
|
|
||||||
- GrabBag
|
|
||||||
- BeltTearing
|
|
||||||
- LapWeld
|
|
||||||
- Workpiece
|
|
||||||
- WorkpieceProject
|
|
||||||
- BinocularMark
|
|
||||||
- BagThreadPosition
|
|
||||||
- ParticleSize
|
|
||||||
- ScrewPosition
|
|
||||||
- TunnelChannel
|
|
||||||
- WheelMeasure
|
|
||||||
- WorkpieceHole
|
|
||||||
|
|
||||||
#### Test 模块
|
|
||||||
- `Test/tcpclient/tcpclient_test.pro` - 更新路径
|
|
||||||
- `Test/tcpserver/tcpserver_test.pro` - 更新路径
|
|
||||||
|
|
||||||
### 4. 路径替换规则
|
|
||||||
|
|
||||||
所有 .pro 文件中的路径按以下规则进行了替换:
|
|
||||||
|
|
||||||
```
|
|
||||||
旧路径 新路径
|
|
||||||
../../VrCommon/Inc -> ../../Utils/VrCommon/Inc
|
|
||||||
../../VrUtils/Inc -> ../../Utils/VrUtils/Inc
|
|
||||||
../../VrCommon/release -> ../../Utils/VrCommon/release
|
|
||||||
../../VrCommon/debug -> ../../Utils/VrCommon/debug
|
|
||||||
../../VrUtils/release -> ../../Utils/VrUtils/release
|
|
||||||
../../VrUtils/debug -> ../../Utils/VrUtils/debug
|
|
||||||
../../AppUtils/CloudUtils -> ../../Utils/CloudUtils
|
|
||||||
|
|
||||||
../../../VrCommon/Inc -> ../../../Utils/VrCommon/Inc
|
|
||||||
../../../VrUtils/Inc -> ../../../Utils/VrUtils/Inc
|
|
||||||
../../../VrCommon/release -> ../../../Utils/VrCommon/release
|
|
||||||
../../../VrCommon/debug -> ../../../Utils/VrCommon/debug
|
|
||||||
../../../VrUtils/release -> ../../../Utils/VrUtils/release
|
|
||||||
../../../VrUtils/debug -> ../../../Utils/VrUtils/debug
|
|
||||||
../../../AppUtils/CloudUtils -> ../../../Utils/CloudUtils
|
|
||||||
```
|
|
||||||
|
|
||||||
### 5. Git 仓库初始化
|
|
||||||
|
|
||||||
已在 Utils 目录下初始化 git 仓库:
|
|
||||||
```bash
|
|
||||||
cd Utils
|
|
||||||
git init
|
|
||||||
git add .
|
|
||||||
```
|
|
||||||
|
|
||||||
所有文件已添加到暂存区,等待提交。
|
|
||||||
|
|
||||||
## 依赖关系
|
|
||||||
|
|
||||||
更新后的依赖关系:
|
|
||||||
|
|
||||||
```
|
|
||||||
主项目 (GrabBagPrj)
|
|
||||||
└── Utils
|
|
||||||
├── VrCommon
|
|
||||||
├── VrUtils (依赖 VrCommon)
|
|
||||||
├── CloudUtils (依赖 VrCommon, VrUtils)
|
|
||||||
├── DataUtils (依赖 VrCommon)
|
|
||||||
└── CloudView (依赖 VrCommon, VrUtils, CloudUtils)
|
|
||||||
└── VrNets (依赖 Utils)
|
|
||||||
└── Module (依赖 Utils)
|
|
||||||
└── Device (依赖 Utils)
|
|
||||||
└── AppUtils (依赖 Utils)
|
|
||||||
└── App (依赖 Utils, VrNets, Module, Device, AppUtils)
|
|
||||||
└── Tools (依赖 Utils, Module, Robot)
|
|
||||||
```
|
|
||||||
|
|
||||||
## 下一步操作
|
|
||||||
|
|
||||||
1. 在 Utils 目录下提交初始版本:
|
|
||||||
```bash
|
|
||||||
cd Utils
|
|
||||||
git commit -m "初始提交:Utils 工具库模块"
|
|
||||||
```
|
|
||||||
|
|
||||||
2. 如果需要推送到远程仓库:
|
|
||||||
```bash
|
|
||||||
git remote add origin <远程仓库地址>
|
|
||||||
git push -u origin master
|
|
||||||
```
|
|
||||||
|
|
||||||
3. 在主项目中,可以将 Utils 作为 git submodule 引用:
|
|
||||||
```bash
|
|
||||||
cd ..
|
|
||||||
git submodule add <Utils仓库地址> Utils
|
|
||||||
```
|
|
||||||
|
|
||||||
## 验证构建
|
|
||||||
|
|
||||||
建议执行以下步骤验证构建:
|
|
||||||
|
|
||||||
1. 清理旧的构建产物:
|
|
||||||
```bash
|
|
||||||
cd GrabBagPrj
|
|
||||||
make clean
|
|
||||||
```
|
|
||||||
|
|
||||||
2. 重新生成 Makefile:
|
|
||||||
```bash
|
|
||||||
qmake GrabBagPrj.pro
|
|
||||||
```
|
|
||||||
|
|
||||||
3. 编译项目:
|
|
||||||
```bash
|
|
||||||
make
|
|
||||||
```
|
|
||||||
|
|
||||||
## 注意事项
|
|
||||||
|
|
||||||
1. 所有路径更新已完成,但建议在实际编译前进行测试
|
|
||||||
2. Utils 模块现在是独立的,可以被其他项目引用
|
|
||||||
3. 如果需要修改 Utils 模块,应该在 Utils 目录下进行 git 操作
|
|
||||||
4. 主项目的 .gitignore 应该排除 Utils 目录(如果使用 submodule)
|
|
||||||
|
|
||||||
## 文件统计
|
|
||||||
|
|
||||||
- 修改的 .pro 文件:约 60+ 个
|
|
||||||
- 新建的文件:3 个(Utils.pro, README.md, .gitignore)
|
|
||||||
- Utils 模块包含的文件:约 230+ 个
|
|
||||||
201
QUICKSTART.md
201
QUICKSTART.md
@ -1,201 +0,0 @@
|
|||||||
# Utils 模块快速参考指南
|
|
||||||
|
|
||||||
## 快速开始
|
|
||||||
|
|
||||||
### 1. 提交 Utils 仓库
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd Utils
|
|
||||||
git commit -m "初始提交:Utils 工具库模块
|
|
||||||
|
|
||||||
包含以下子模块:
|
|
||||||
- VrCommon: 核心接口和数据结构
|
|
||||||
- VrUtils: 工具类库(JSON、log4cpp、tinyxml2、INI、MD5、CRC)
|
|
||||||
- CloudUtils: 点云工具
|
|
||||||
- DataUtils: 数据处理工具(CloudMathClac、CoordinateTransform)
|
|
||||||
- CloudView: 点云查看工具
|
|
||||||
"
|
|
||||||
```
|
|
||||||
|
|
||||||
### 2. 添加远程仓库(可选)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 添加远程仓库
|
|
||||||
git remote add origin <你的远程仓库地址>
|
|
||||||
|
|
||||||
# 推送到远程
|
|
||||||
git push -u origin master
|
|
||||||
```
|
|
||||||
|
|
||||||
### 3. 在主项目中使用 submodule(可选)
|
|
||||||
|
|
||||||
如果你想将 Utils 作为 git submodule 使用:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 在主项目根目录
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
# 删除当前的 Utils 目录(确保已备份)
|
|
||||||
# rm -rf Utils
|
|
||||||
|
|
||||||
# 添加为 submodule
|
|
||||||
git submodule add <Utils仓库地址> Utils
|
|
||||||
|
|
||||||
# 提交 submodule 配置
|
|
||||||
git add .gitmodules Utils
|
|
||||||
git commit -m "将 Utils 添加为 git submodule"
|
|
||||||
```
|
|
||||||
|
|
||||||
## 在其他项目中使用 Utils
|
|
||||||
|
|
||||||
### 方法 1: 作为 git submodule
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 在你的项目根目录
|
|
||||||
git submodule add <Utils仓库地址> Utils
|
|
||||||
git submodule update --init --recursive
|
|
||||||
```
|
|
||||||
|
|
||||||
### 方法 2: 直接克隆
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 在你的项目根目录
|
|
||||||
git clone <Utils仓库地址> Utils
|
|
||||||
```
|
|
||||||
|
|
||||||
### 方法 3: 复制文件
|
|
||||||
|
|
||||||
直接将 Utils 目录复制到你的项目中。
|
|
||||||
|
|
||||||
## 在项目中引用 Utils
|
|
||||||
|
|
||||||
### 在 .pro 文件中添加
|
|
||||||
|
|
||||||
```qmake
|
|
||||||
# 包含路径
|
|
||||||
INCLUDEPATH += $$PWD/../Utils/VrCommon/Inc
|
|
||||||
INCLUDEPATH += $$PWD/../Utils/VrUtils/Inc
|
|
||||||
|
|
||||||
# 链接库(Windows)
|
|
||||||
win32:CONFIG(release, debug|release): {
|
|
||||||
LIBS += -L$$PWD/../Utils/VrCommon/release -lVrCommon
|
|
||||||
LIBS += -L$$PWD/../Utils/VrUtils/release -lVrUtils
|
|
||||||
}
|
|
||||||
else:win32:CONFIG(debug, debug|release): {
|
|
||||||
LIBS += -L$$PWD/../Utils/VrCommon/debug -lVrCommon
|
|
||||||
LIBS += -L$$PWD/../Utils/VrUtils/debug -lVrUtils
|
|
||||||
}
|
|
||||||
|
|
||||||
# 链接库(Unix/Linux)
|
|
||||||
else:unix:!macx {
|
|
||||||
LIBS += -L$$PWD/../Utils/VrCommon -lVrCommon
|
|
||||||
LIBS += -L$$PWD/../Utils/VrUtils -lVrUtils
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
### 在主项目中添加 Utils 子项目
|
|
||||||
|
|
||||||
```qmake
|
|
||||||
# 在主项目的 .pro 文件中
|
|
||||||
TEMPLATE = subdirs
|
|
||||||
|
|
||||||
Utils.file = ../Utils/Utils.pro
|
|
||||||
SUBDIRS += Utils
|
|
||||||
|
|
||||||
# 设置依赖关系
|
|
||||||
YourModule.depends = Utils
|
|
||||||
```
|
|
||||||
|
|
||||||
## 常用命令
|
|
||||||
|
|
||||||
### 构建 Utils 模块
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd Utils
|
|
||||||
qmake Utils.pro
|
|
||||||
make
|
|
||||||
```
|
|
||||||
|
|
||||||
### 清理构建产物
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cd Utils
|
|
||||||
make clean
|
|
||||||
```
|
|
||||||
|
|
||||||
### 更新 Utils 模块(如果使用 submodule)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 在主项目根目录
|
|
||||||
git submodule update --remote Utils
|
|
||||||
```
|
|
||||||
|
|
||||||
## 模块说明
|
|
||||||
|
|
||||||
### VrCommon
|
|
||||||
- **用途**: 核心接口和数据结构定义
|
|
||||||
- **主要文件**: VrCommon.h, VrConfigCmd.h, VrError.h
|
|
||||||
- **依赖**: 无
|
|
||||||
|
|
||||||
### VrUtils
|
|
||||||
- **用途**: 通用工具类库
|
|
||||||
- **主要功能**: 日志、JSON、XML、INI、MD5、CRC、时间、网络、文件、字符串
|
|
||||||
- **依赖**: VrCommon
|
|
||||||
|
|
||||||
### CloudUtils
|
|
||||||
- **用途**: 点云数据处理工具
|
|
||||||
- **主要功能**: 激光数据加载、点云图像转换
|
|
||||||
- **依赖**: VrCommon, VrUtils
|
|
||||||
|
|
||||||
### DataUtils
|
|
||||||
- **用途**: 数据处理工具集
|
|
||||||
- **子模块**: CloudMathClac(曲线拟合)、CoordinateTransform(坐标转换)
|
|
||||||
- **依赖**: VrCommon
|
|
||||||
|
|
||||||
### CloudView
|
|
||||||
- **用途**: 点云可视化查看工具(独立应用)
|
|
||||||
- **依赖**: VrCommon, VrUtils, CloudUtils
|
|
||||||
|
|
||||||
## 故障排查
|
|
||||||
|
|
||||||
### 问题 1: 找不到头文件
|
|
||||||
|
|
||||||
**症状**: 编译时提示找不到 VrCommon.h 或 VrUtils 相关头文件
|
|
||||||
|
|
||||||
**解决方案**:
|
|
||||||
1. 检查 INCLUDEPATH 是否正确设置
|
|
||||||
2. 确保相对路径正确(根据你的项目结构调整 `../` 的数量)
|
|
||||||
3. 确保 Utils 目录存在且包含所有必要文件
|
|
||||||
|
|
||||||
### 问题 2: 链接错误
|
|
||||||
|
|
||||||
**症状**: 编译通过但链接时提示找不到库文件
|
|
||||||
|
|
||||||
**解决方案**:
|
|
||||||
1. 确保先编译 Utils 模块
|
|
||||||
2. 检查 LIBS 路径是否正确
|
|
||||||
3. 确认 debug/release 配置匹配
|
|
||||||
|
|
||||||
### 问题 3: submodule 未初始化
|
|
||||||
|
|
||||||
**症状**: Utils 目录为空
|
|
||||||
|
|
||||||
**解决方案**:
|
|
||||||
```bash
|
|
||||||
git submodule update --init --recursive
|
|
||||||
```
|
|
||||||
|
|
||||||
## 版本管理建议
|
|
||||||
|
|
||||||
### Utils 仓库
|
|
||||||
- 使用语义化版本号(如 v1.0.0)
|
|
||||||
- 为重要版本打 tag
|
|
||||||
- 维护 CHANGELOG.md
|
|
||||||
|
|
||||||
### 主项目
|
|
||||||
- 如果使用 submodule,锁定 Utils 到特定版本
|
|
||||||
- 定期更新 Utils 到最新稳定版本
|
|
||||||
|
|
||||||
## 联系方式
|
|
||||||
|
|
||||||
如有问题或建议,请联系项目维护者。
|
|
||||||
Loading…
x
Reference in New Issue
Block a user