From 9a14079b61d6e0a04b7a3590c76690d65e090294 Mon Sep 17 00:00:00 2001 From: liusiyang Date: Sun, 11 Oct 2026 18:57:57 +0800 Subject: [PATCH] =?UTF-8?q?feat=20=E8=BF=94=E5=9B=9E=E7=BC=BA=E9=99=B7?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E6=96=B0=E5=A2=9E=E7=BC=BA=E9=99=B7=E7=AD=89?= =?UTF-8?q?=E7=BA=A7=E5=AD=97=E6=AE=B5=EF=BC=88=E5=BE=85=E5=AE=9E=E7=8E=B0?= =?UTF-8?q?=E7=BC=BA=E9=99=B7=E5=88=86=E7=BA=A7=E9=80=BB=E8=BE=91=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AlgorithmModule/include/ImageDetConfig.h | 3 +++ AlgorithmModule/include/ImgCheckConfig.h | 2 ++ AlgorithmModule/src/CheckResultJson.cpp | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/AlgorithmModule/include/ImageDetConfig.h b/AlgorithmModule/include/ImageDetConfig.h index b6f1146..24df4f1 100644 --- a/AlgorithmModule/include/ImageDetConfig.h +++ b/AlgorithmModule/include/ImageDetConfig.h @@ -27,6 +27,7 @@ struct QX_ERROR_INFO_ float fbreadth; int nconfig_qx_type; std::string qx_name; + std::string qx_level; // 缺陷等级 std::string strModelName; // 检出该残点(blob)的模型名称 int maxValue; int whiteOrBlack; @@ -54,6 +55,7 @@ struct QX_ERROR_INFO_ flen = 0; nconfig_qx_type = 0; qx_name = ""; + qx_level = ""; strModelName = ""; maxValue = 0; grayDis = 0; @@ -81,6 +83,7 @@ struct QX_ERROR_INFO_ << ", Flen: " << flen << ", nconfig_qx_type: " << nconfig_qx_type << ", QX Name: " << qx_name + << ", QX Level: " << qx_level << ", Model Name: " << strModelName << ", Max Value: " << maxValue << ", Gray Dis: " << grayDis diff --git a/AlgorithmModule/include/ImgCheckConfig.h b/AlgorithmModule/include/ImgCheckConfig.h index e9471a7..1b6d4cb 100644 --- a/AlgorithmModule/include/ImgCheckConfig.h +++ b/AlgorithmModule/include/ImgCheckConfig.h @@ -282,6 +282,7 @@ struct QXImageResult int type; // 缺陷类型 std::string qx_Code; // 缺陷code std::string strTypeName; // 缺陷名称 + std::string qx_level; // 缺陷等级 cv::Mat srcImg; // 缺陷原始图片 cv::Mat resizeImg; // 缺陷缩略图 @@ -346,6 +347,7 @@ struct QXImageResult max_v = 0; strTypeName = ""; qx_Code = ""; + qx_level = ""; len = 0; breadth = 0; idx = 0; diff --git a/AlgorithmModule/src/CheckResultJson.cpp b/AlgorithmModule/src/CheckResultJson.cpp index 3b86911..fd34292 100644 --- a/AlgorithmModule/src/CheckResultJson.cpp +++ b/AlgorithmModule/src/CheckResultJson.cpp @@ -38,6 +38,7 @@ Json::Value CheckResultJson::toJsonValue() value["flen"] = p->flen; value["nconfig_qx_type"] = p->nconfig_qx_type; value["qx_name"] = p->qx_name; + value["qx_level"] = p->qx_level; value["det_model_name"] = p->strModelName; value["maxValue"] = p->maxValue; value["grayDis"] = p->grayDis; @@ -118,6 +119,11 @@ void CheckResultJson::toObjectFromValue(Json::Value root) tem.flen = errorJson["flen"].asFloat(); tem.nconfig_qx_type = errorJson["nconfig_qx_type"].asInt(); tem.qx_name = errorJson["qx_name"].asString(); + // 旧版本 json 可能没有 qx_level 字段 + if (errorJson.isMember("qx_level")) + { + tem.qx_level = errorJson["qx_level"].asString(); + } // 旧版本 json 可能没有该字段 if (errorJson.isMember("det_model_name")) {