Compare commits
5 Commits
07dd06c7ce
...
807df6c110
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
807df6c110 | ||
|
|
48962d7c1e | ||
|
|
0ce34e3937 | ||
|
|
eb1f09d6d4 | ||
|
|
5ba7e7a9a1 |
@ -205,13 +205,14 @@ int HoleDetectionPresenter::InitAlgoParams()
|
||||
|
||||
const VrAlgorithmParams& xmlParams = configResult.algorithmParams;
|
||||
|
||||
LOG_INFO("Loaded XML params - Ransac: distanceThreshold=%.2f, maxIterations=%d, minPlanePoints=%d, maxPlanes=%d, growthZThreshold=%.2f, minPlaneRatio=%.2f\n",
|
||||
LOG_INFO("Loaded XML params - Ransac: distanceThreshold=%.2f, maxIterations=%d, minPlanePoints=%d, maxPlanes=%d, growthZThreshold=%.2f, minPlaneRatio=%.2f, maxNormalAngleDeg=%.1f\n",
|
||||
xmlParams.ransacParam.distanceThreshold,
|
||||
xmlParams.ransacParam.maxIterations,
|
||||
xmlParams.ransacParam.minPlanePoints,
|
||||
xmlParams.ransacParam.maxPlanes,
|
||||
xmlParams.ransacParam.growthZThreshold,
|
||||
xmlParams.ransacParam.minPlaneRatio);
|
||||
xmlParams.ransacParam.minPlaneRatio,
|
||||
xmlParams.ransacParam.maxNormalAngleDeg);
|
||||
|
||||
LOG_INFO("Loaded XML params - Detection: angleThresholdPos=%.1f, angleThresholdNeg=%.1f, angleSearchDistance=%.2f, minPitDepth=%.2f\n",
|
||||
xmlParams.detectionParam.angleThresholdPos,
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
#define HOLEDETECTION_APP_NAME "孔洞检测"
|
||||
|
||||
// 版本字符串
|
||||
#define HOLEDETECTION_VERSION_STRING "1.1.2"
|
||||
#define HOLEDETECTION_VERSION_STRING "1.1.5"
|
||||
#define HOLEDETECTION_BUILD_STRING "1"
|
||||
#define HOLEDETECTION_FULL_VERSION_STRING "V" HOLEDETECTION_VERSION_STRING "_" HOLEDETECTION_BUILD_STRING
|
||||
|
||||
|
||||
@ -1,28 +1,40 @@
|
||||
# 1.1.2 2026-04-02
|
||||
## build_1
|
||||
## 1.1.5 2026-04-05
|
||||
* build_1
|
||||
1. 更新算法 1.0.2
|
||||
|
||||
## 1.1.4 2026-04-05
|
||||
* build_1
|
||||
1. 修复 释放点云内存的问题
|
||||
|
||||
## 1.1.3 2026-04-05
|
||||
* build_1
|
||||
1. 更新算法 1.0.1
|
||||
|
||||
## 1.1.2 2026-04-02
|
||||
* build_1
|
||||
1. 更新算法
|
||||
2. 完善算法参数页面参数配置
|
||||
|
||||
# 1.1.1 2026-04-02
|
||||
## build_1
|
||||
## 1.1.1 2026-04-02
|
||||
* build_1
|
||||
1. 更新算法
|
||||
|
||||
# 1.1.0 2026-03-25
|
||||
## build_1
|
||||
## 1.1.0 2026-03-25
|
||||
* build_1
|
||||
1. 算法优化
|
||||
2. 配置结构修改
|
||||
3. 手眼标定,网络配置公用
|
||||
|
||||
# 1.0.0 2026-03-11
|
||||
## build_4
|
||||
## 1.0.0 2026-03-11
|
||||
* build_4
|
||||
1. 修复矩阵配置
|
||||
|
||||
## build_3
|
||||
* build_3
|
||||
1. 更新算法库
|
||||
|
||||
## build_2
|
||||
* build_2
|
||||
1. 修复单相机检测结果不全的问题
|
||||
|
||||
## build_1
|
||||
* build_1
|
||||
1. 初始版本
|
||||
|
||||
|
||||
@ -300,6 +300,7 @@ void DialogAlgoarg::LoadRansacParamToUI(const VrRansacPlaneSegmentationParam& pa
|
||||
ui->lineEdit_maxPlanes->setText(QString::number(param.maxPlanes));
|
||||
ui->lineEdit_growthZThreshold->setText(QString::number(param.growthZThreshold));
|
||||
ui->lineEdit_minPlaneRatio->setText(QString::number(param.minPlaneRatio));
|
||||
ui->lineEdit_maxNormalAngleDeg->setText(QString::number(param.maxNormalAngleDeg));
|
||||
}
|
||||
|
||||
void DialogAlgoarg::LoadDetectionParamToUI(const VrHoleDetectionParam& param)
|
||||
@ -377,6 +378,9 @@ bool DialogAlgoarg::SaveRansacParamFromUI(VrRansacPlaneSegmentationParam& param)
|
||||
param.minPlaneRatio = ui->lineEdit_minPlaneRatio->text().toDouble(&ok);
|
||||
if (!ok) return false;
|
||||
|
||||
param.maxNormalAngleDeg = ui->lineEdit_maxNormalAngleDeg->text().toDouble(&ok);
|
||||
if (!ok) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -168,6 +168,16 @@ QScrollArea { border: none; }</string>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_minPlaneRatio"/>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_maxNormalAngleDeg">
|
||||
<property name="text">
|
||||
<string>法向量最大夹角 (度):</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="lineEdit_maxNormalAngleDeg"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@ -97,7 +97,7 @@ background-color: rgba(255, 255, 255, 0);</string>
|
||||
<widget class="QPushButton" name="btn_test">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>973</x>
|
||||
<x>1110</x>
|
||||
<y>21</y>
|
||||
<width>220</width>
|
||||
<height>80</height>
|
||||
@ -120,7 +120,7 @@ border: none;</string>
|
||||
<widget class="QPushButton" name="btn_algo_config">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>728</x>
|
||||
<x>845</x>
|
||||
<y>21</y>
|
||||
<width>220</width>
|
||||
<height>80</height>
|
||||
@ -143,7 +143,7 @@ border: none;</string>
|
||||
<widget class="QPushButton" name="btn_camera">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>483</x>
|
||||
<x>580</x>
|
||||
<y>21</y>
|
||||
<width>220</width>
|
||||
<height>80</height>
|
||||
@ -330,7 +330,7 @@ background-color: rgba(255, 255, 255, 0);</string>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1920</width>
|
||||
<height>21</height>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
|
||||
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@ -23,6 +23,7 @@ struct VrRansacPlaneSegmentationParam
|
||||
int maxPlanes = 5; // 最大提取平面数量
|
||||
double growthZThreshold = 1.0; // 区域生长时相邻点 Z 差阈值(mm)
|
||||
double minPlaneRatio = 0.1; // 平面最小点数占比
|
||||
double maxNormalAngleDeg = 30.0; // 平面法向量与Z轴最大夹角(度),<=0 表示不过滤
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
@ -13,6 +13,7 @@ RansacPlaneSegmentationParams ToAlgoParam(const VrRansacPlaneSegmentationParam&
|
||||
algo.maxPlanes = param.maxPlanes;
|
||||
algo.growthZThreshold = static_cast<float>(param.growthZThreshold);
|
||||
algo.minPlaneRatio = static_cast<float>(param.minPlaneRatio);
|
||||
algo.maxNormalAngleDeg = static_cast<float>(param.maxNormalAngleDeg);
|
||||
return algo;
|
||||
}
|
||||
|
||||
@ -65,14 +66,15 @@ void LogAlgoParams(const std::string& logTag,
|
||||
clibMatrix[8], clibMatrix[9], clibMatrix[10], clibMatrix[11],
|
||||
clibMatrix[12], clibMatrix[13], clibMatrix[14], clibMatrix[15]);
|
||||
|
||||
LOG_INFO("%s RansacParams: distanceThreshold=%.2f, maxIterations=%d, minPlanePoints=%d, maxPlanes=%d, growthZThreshold=%.2f, minPlaneRatio=%.2f\n",
|
||||
LOG_INFO("%s RansacParams: distanceThreshold=%.2f, maxIterations=%d, minPlanePoints=%d, maxPlanes=%d, growthZThreshold=%.2f, minPlaneRatio=%.2f, maxNormalAngleDeg=%.1f\n",
|
||||
logTag.c_str(),
|
||||
ransacParams.distanceThreshold,
|
||||
ransacParams.maxIterations,
|
||||
ransacParams.minPlanePoints,
|
||||
ransacParams.maxPlanes,
|
||||
ransacParams.growthZThreshold,
|
||||
ransacParams.minPlaneRatio);
|
||||
ransacParams.minPlaneRatio,
|
||||
ransacParams.maxNormalAngleDeg);
|
||||
|
||||
LOG_INFO("%s DetectionParams: angleThresholdPos=%.1f, angleThresholdNeg=%.1f, angleSearchDistance=%.2f, minPitDepth=%.2f\n",
|
||||
logTag.c_str(),
|
||||
|
||||
@ -76,6 +76,8 @@ int CVrConfig::LoadConfig(const std::string& filePath, ConfigResult& configResul
|
||||
configResult.algorithmParams.ransacParam.growthZThreshold = ransacParamElement->DoubleAttribute("growthZThreshold");
|
||||
if (ransacParamElement->Attribute("minPlaneRatio"))
|
||||
configResult.algorithmParams.ransacParam.minPlaneRatio = ransacParamElement->DoubleAttribute("minPlaneRatio");
|
||||
if (ransacParamElement->Attribute("maxNormalAngleDeg"))
|
||||
configResult.algorithmParams.ransacParam.maxNormalAngleDeg = ransacParamElement->DoubleAttribute("maxNormalAngleDeg");
|
||||
}
|
||||
|
||||
XMLElement* detectionParamElement = algoParamsElement->FirstChildElement("DetectionParam");
|
||||
@ -209,6 +211,7 @@ bool CVrConfig::SaveConfig(const std::string& filePath, ConfigResult& configResu
|
||||
ransacParamElement->SetAttribute("maxPlanes", configResult.algorithmParams.ransacParam.maxPlanes);
|
||||
ransacParamElement->SetAttribute("growthZThreshold", configResult.algorithmParams.ransacParam.growthZThreshold);
|
||||
ransacParamElement->SetAttribute("minPlaneRatio", configResult.algorithmParams.ransacParam.minPlaneRatio);
|
||||
ransacParamElement->SetAttribute("maxNormalAngleDeg", configResult.algorithmParams.ransacParam.maxNormalAngleDeg);
|
||||
algoParamsElement->InsertEndChild(ransacParamElement);
|
||||
|
||||
// 检测参数 DetectionParam 需要覆盖算法库当前全部检测字段。
|
||||
|
||||
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
@ -14,6 +14,7 @@ struct RansacPlaneSegmentationParams {
|
||||
int maxPlanes; // 最大提取平面数量, 建议 3-10
|
||||
float growthZThreshold; // 区域生长时相邻点Z差阈值 (mm), 建议 0.5-2.0
|
||||
float minPlaneRatio; // 平面最小点数占比 (相对最大平面), 建议 0.05-0.2
|
||||
float maxNormalAngleDeg; // 平面法向量与Z轴最大夹角 (度), 超过则直接丢弃; <=0 表示不过滤
|
||||
|
||||
RansacPlaneSegmentationParams()
|
||||
: distanceThreshold(0.5f)
|
||||
@ -22,6 +23,7 @@ struct RansacPlaneSegmentationParams {
|
||||
, maxPlanes(5)
|
||||
, growthZThreshold(1.0f)
|
||||
, minPlaneRatio(0.1f)
|
||||
, maxNormalAngleDeg(30.0f)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
@ -39,6 +39,9 @@ BasePresenter::~BasePresenter()
|
||||
// 停止检测线程
|
||||
StopAlgoDetectThread();
|
||||
|
||||
// 释放检测数据缓存中的动态内存
|
||||
ClearDetectionDataCache();
|
||||
|
||||
// 停止重连定时器
|
||||
StopCameraReconnectTimer();
|
||||
|
||||
@ -576,7 +579,8 @@ void BasePresenter::StopAlgoDetectThread()
|
||||
void BasePresenter::ClearDetectionDataCache()
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_detectionDataMutex);
|
||||
m_detectionDataCache.clear();
|
||||
// 释放加载的数据
|
||||
m_dataLoader.FreeLaserScanData(m_detectionDataCache);
|
||||
LOG_DEBUG("[BasePresenter] 检测数据缓存已清空\n");
|
||||
}
|
||||
|
||||
|
||||
22
GrabBagPrj/AppList.md
Normal file
@ -0,0 +1,22 @@
|
||||
# 应用列表及说明
|
||||
|
||||
## 软件对应关系表
|
||||
|
||||
| 序号 | 项目名称 | App名称 | 版本 |
|
||||
|:---:|:--------|:---------|:------------|
|
||||
| 1 | 自动拆包 | GrabBag | 1.3.6.2 |
|
||||
| 2 | 皮带撕裂 | BeltTearingServer | 2.0.8.1 |
|
||||
| 3 | 孔洞检测 | HoleDetection | 1.1.3.1 |
|
||||
| 4 | 棒材定位 | RodAndBarPosition | 1.0.2.1 |
|
||||
| 5 | 车轮拱高测量 | WheelMeasure | 1.0.2.1 |
|
||||
| 6 | 定子定位 | StatorPosition | 1.0.0.1 |
|
||||
| 7 | 焊接 | LapWeld | 1.0.0.1 |
|
||||
| 8 | 工件定位 | Workpiece | 1.0.3.0 |
|
||||
| 9 | 颗粒尺寸检测 | ParticleSize | 1.0.0.0 |
|
||||
| 10 | 双目标记检测 | BinocularMarkServer | 1.0.0.4 |
|
||||
| 11 | 铁路隧道槽道测量 | TunnelChannel | 1.0.0.3 |
|
||||
| 12 | 螺杆定位 | ScrewPosition | 1.0.0.1 |
|
||||
| 13 | 包裹拆线位置定位 | BagThreadPosition | 1.0.0.4 |
|
||||
| 14 | 工件孔定位 | WorkpieceHole | 1.0.3.0 |
|
||||
| 16 | 坑孔定位 | HolePitPosition | 无 |
|
||||
|
||||
195
GrabBagPrj/update_releaseVersion.sh
Normal file
@ -0,0 +1,195 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 更新应用列表及说明.md中的版本信息
|
||||
# 用法: ./updateVersion.sh <项目名称>
|
||||
# 示例: ./updateVersion.sh GrabBag
|
||||
|
||||
# 定义项目与Version.h文件的映射关系
|
||||
declare -A PROJECT_VERSION_FILES=(
|
||||
["GrabBag"]="App/GrabBag/GrabBagApp/Version.h"
|
||||
["BeltTearing"]="App/BeltTearing/BeltTearingApp/Version.h"
|
||||
["LapWeld"]="App/LapWeld/LapWeldApp/Version.h"
|
||||
["Workpiece"]="App/Workpiece/WorkpieceApp/Version.h"
|
||||
["ParticleSize"]="App/ParticleSize/ParticleSizeApp/Version.h"
|
||||
["BinocularMark"]="App/BinocularMark/BinocularMarkApp/Version.h"
|
||||
["WorkpieceProject"]="App/WorkpieceProject/WorkpiecePositionApp/Version.h"
|
||||
["TunnelChannel"]="App/TunnelChannel/TunnelChannelApp/Version.h"
|
||||
["WheelMeasure"]="App/WheelMeasure/WheelMeasureApp/Version.h"
|
||||
["ScrewPosition"]="App/ScrewPosition/ScrewPositionApp/Version.h"
|
||||
["BagThreadPosition"]="App/BagThreadPosition/BagThreadPositionApp/Version.h"
|
||||
["WorkpieceHole"]="App/WorkpieceHole/WorkpieceHoleApp/Version.h"
|
||||
["StatorPosition"]="App/StatorPosition/StatorPositionApp/Version.h"
|
||||
["HoleDetection"]="App/HoleDetection/HoleDetectionApp/Version.h"
|
||||
["HolePitPosition"]="App/HolePitPosition/HolePitPositionApp/Version.h"
|
||||
["RodAndBarPosition"]="App/RodAndBarPosition/RodAndBarPositionApp/Version.h"
|
||||
)
|
||||
|
||||
# 定义项目与版本宏的映射关系
|
||||
declare -A PROJECT_VERSION_MACROS=(
|
||||
["GrabBag"]="GRABBAG"
|
||||
["BeltTearing"]="BELT_TEARING_APP"
|
||||
["LapWeld"]="LAPWELD"
|
||||
["Workpiece"]="WORKPIECE"
|
||||
["ParticleSize"]="PARTICLESIZE"
|
||||
["BinocularMark"]="BINOCULARMARK"
|
||||
["WorkpieceProject"]="WORKPIECE_POSITION"
|
||||
["TunnelChannel"]="TUNNELCHANNEL"
|
||||
["WheelMeasure"]="WHEELMEASURE"
|
||||
["ScrewPosition"]="SCREWPOSITION"
|
||||
["BagThreadPosition"]="BAGTHREADPOSITION"
|
||||
["WorkpieceHole"]="WORKPIECEHOLE"
|
||||
["StatorPosition"]="STATORPOSITION"
|
||||
["HoleDetection"]="HOLEDETECTION"
|
||||
["HolePitPosition"]="HOLEPITPOSITION"
|
||||
["RodAndBarPosition"]="RODANDBARPOSITION"
|
||||
)
|
||||
|
||||
# 定义项目与Publish包名称的映射关系
|
||||
declare -A PROJECT_PUBLISH_NAMES=(
|
||||
["GrabBag"]="GrabBag"
|
||||
["BeltTearing"]="BeltTearingServer"
|
||||
["LapWeld"]="LapWeld"
|
||||
["Workpiece"]="Workpiece"
|
||||
["ParticleSize"]="ParticleSize"
|
||||
["BinocularMark"]="BinocularMarkServer"
|
||||
["WorkpieceProject"]="WorkpieceProject"
|
||||
["TunnelChannel"]="TunnelChannel"
|
||||
["WheelMeasure"]="WheelMeasure"
|
||||
["ScrewPosition"]="ScrewPosition"
|
||||
["BagThreadPosition"]="BagThreadPosition"
|
||||
["WorkpieceHole"]="WorkpieceHole"
|
||||
["StatorPosition"]="StatorPosition"
|
||||
["HoleDetection"]="HoleDetection"
|
||||
["HolePitPosition"]="HolePitPosition"
|
||||
["RodAndBarPosition"]="RodAndBarPosition"
|
||||
)
|
||||
|
||||
# 定义项目与中文名称的映射关系
|
||||
declare -A PROJECT_CHINESE_NAMES=(
|
||||
["GrabBag"]="自动拆包"
|
||||
["BeltTearing"]="皮带撕裂"
|
||||
["LapWeld"]="焊接"
|
||||
["Workpiece"]="工件定位"
|
||||
["ParticleSize"]="颗粒尺寸检测"
|
||||
["BinocularMark"]="双目标记检测"
|
||||
["WorkpieceProject"]="工件项目"
|
||||
["TunnelChannel"]="铁路隧道槽道测量"
|
||||
["WheelMeasure"]="车轮拱高测量"
|
||||
["ScrewPosition"]="螺杆定位"
|
||||
["BagThreadPosition"]="包裹拆线位置定位"
|
||||
["WorkpieceHole"]="工件孔定位"
|
||||
["StatorPosition"]="定子定位"
|
||||
["HoleDetection"]="孔洞检测"
|
||||
["HolePitPosition"]="坑孔定位"
|
||||
["RodAndBarPosition"]="棒材定位"
|
||||
)
|
||||
|
||||
# 应用列表文件路径
|
||||
APP_LIST_FILE="应用列表及说明.md"
|
||||
|
||||
# 获取脚本所在目录
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
# 检查参数
|
||||
if [ $# -eq 0 ]; then
|
||||
echo "用法: $0 <项目名称>"
|
||||
echo "示例: $0 GrabBag"
|
||||
echo ""
|
||||
echo "可用项目名称:"
|
||||
for project in "${!PROJECT_VERSION_FILES[@]}"; do
|
||||
echo " - $project (${PROJECT_CHINESE_NAMES[$project]})"
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PROJECT_NAME=$1
|
||||
|
||||
# 检查项目是否存在
|
||||
if [ -z "${PROJECT_VERSION_FILES[$PROJECT_NAME]}" ]; then
|
||||
echo "错误: 未知的项目名称 '$PROJECT_NAME'"
|
||||
echo "可用项目名称:"
|
||||
for project in "${!PROJECT_VERSION_FILES[@]}"; do
|
||||
echo " - $project (${PROJECT_CHINESE_NAMES[$project]})"
|
||||
done
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 获取Version.h文件路径
|
||||
VERSION_FILE="../${PROJECT_VERSION_FILES[$PROJECT_NAME]}"
|
||||
VERSION_MACRO="${PROJECT_VERSION_MACROS[$PROJECT_NAME]}"
|
||||
PUBLISH_NAME="${PROJECT_PUBLISH_NAMES[$PROJECT_NAME]}"
|
||||
CHINESE_NAME="${PROJECT_CHINESE_NAMES[$PROJECT_NAME]}"
|
||||
|
||||
echo "=========================================="
|
||||
echo "更新项目版本信息"
|
||||
echo "=========================================="
|
||||
echo "项目名称: $PROJECT_NAME ($CHINESE_NAME)"
|
||||
echo "发布名称: $PUBLISH_NAME"
|
||||
echo "Version.h: $VERSION_FILE"
|
||||
echo "=========================================="
|
||||
|
||||
# 检查Version.h文件是否存在
|
||||
if [ ! -f "$VERSION_FILE" ]; then
|
||||
echo "错误: Version.h 文件不存在: $VERSION_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 读取版本信息
|
||||
# 尝试多种可能的宏定义格式
|
||||
VERSION_STRING=""
|
||||
BUILD_STRING=""
|
||||
|
||||
# 尝试读取版本号
|
||||
VERSION_STRING=$(grep "#define ${VERSION_MACRO}_VERSION_STRING" "$VERSION_FILE" | sed 's/.*"\(.*\)".*/\1/' | head -1)
|
||||
if [ -z "$VERSION_STRING" ]; then
|
||||
# 尝试另一种格式
|
||||
VERSION_STRING=$(grep "#define ${VERSION_MACRO}_APP_VERSION_STRING" "$VERSION_FILE" | sed 's/.*"\(.*\)".*/\1/' | head -1)
|
||||
fi
|
||||
|
||||
# 尝试读取构建号
|
||||
BUILD_STRING=$(grep "#define ${VERSION_MACRO}_BUILD_STRING" "$VERSION_FILE" | sed 's/.*"\(.*\)".*/\1/' | head -1)
|
||||
if [ -z "$BUILD_STRING" ]; then
|
||||
# 尝试另一种格式
|
||||
BUILD_STRING=$(grep "#define ${VERSION_MACRO}_APP_VERSION_BUILD" "$VERSION_FILE" | sed 's/.*"\(.*\)".*/\1/' | head -1)
|
||||
fi
|
||||
|
||||
# 如果仍然无法读取,使用默认值
|
||||
if [ -z "$VERSION_STRING" ]; then
|
||||
VERSION_STRING="1.0.0"
|
||||
echo "警告: 无法读取版本号,使用默认值: $VERSION_STRING"
|
||||
else
|
||||
echo "版本号: $VERSION_STRING"
|
||||
fi
|
||||
|
||||
if [ -z "$BUILD_STRING" ]; then
|
||||
BUILD_STRING="1"
|
||||
echo "警告: 无法读取构建号,使用默认值: $BUILD_STRING"
|
||||
else
|
||||
echo "构建号: $BUILD_STRING"
|
||||
fi
|
||||
|
||||
# 组合完整版本号
|
||||
FULL_VERSION="${VERSION_STRING}.${BUILD_STRING}"
|
||||
echo "完整版本: $FULL_VERSION"
|
||||
echo "=========================================="
|
||||
|
||||
# 检查应用列表文件是否存在
|
||||
if [ ! -f "$APP_LIST_FILE" ]; then
|
||||
echo "错误: 应用列表文件不存在: $APP_LIST_FILE"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# 更新应用列表文件中的版本信息
|
||||
# 查找对应行并更新版本号
|
||||
if grep -q "| ${CHINESE_NAME} | ${PUBLISH_NAME} |" "$APP_LIST_FILE"; then
|
||||
# 使用sed更新版本号
|
||||
sed -i "s/| ${CHINESE_NAME} | ${PUBLISH_NAME} | .* |/| ${CHINESE_NAME} | ${PUBLISH_NAME} | ${FULL_VERSION} |/" "$APP_LIST_FILE"
|
||||
echo "已更新 $CHINESE_NAME 的版本信息为 $FULL_VERSION"
|
||||
else
|
||||
echo "警告: 在应用列表中未找到项目 '$CHINESE_NAME' ($PUBLISH_NAME)"
|
||||
fi
|
||||
|
||||
echo "=========================================="
|
||||
echo "版本信息更新完成!"
|
||||
echo "=========================================="
|
||||
2
Utils
@ -1 +1 @@
|
||||
Subproject commit 5e978eaea4f7891cc2f4a9ac871598cbb3178f50
|
||||
Subproject commit c98aa7b5d6729922879e95f6c1403ae7405136ba
|
||||