|
|
|
@ -790,7 +790,6 @@ int CameraCheckAnalysisy::CheckImgRun()
|
|
|
|
if (m_pCheck_Result->getImgPushComplate())
|
|
|
|
if (m_pCheck_Result->getImgPushComplate())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
curcheckStep = Check_Step_Complete; // 进入到预图片检测阶段
|
|
|
|
curcheckStep = Check_Step_Complete; // 进入到预图片检测阶段
|
|
|
|
m_pCheck_Result->SetCheckStep(curcheckStep);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
@ -807,7 +806,12 @@ int CameraCheckAnalysisy::CheckImgRun()
|
|
|
|
m_pdetlog->AddCheckstr(PrintLevel_0, "CheckImgRun", "========came %s Check ALL end time %ld ms %s",
|
|
|
|
m_pdetlog->AddCheckstr(PrintLevel_0, "CheckImgRun", "========came %s Check ALL end time %ld ms %s",
|
|
|
|
m_pCheck_Result->cameraBaseResult->strCameraName.c_str(), tend - m_pCheck_Result->time_start, strTimg.c_str());
|
|
|
|
m_pCheck_Result->cameraBaseResult->strCameraName.c_str(), tend - m_pCheck_Result->time_start, strTimg.c_str());
|
|
|
|
InsertCameraLog();
|
|
|
|
InsertCameraLog();
|
|
|
|
|
|
|
|
// 结果与日志(det_LogList)全部写完后,才置为 Check_Step_Complete,
|
|
|
|
|
|
|
|
// 通知 Det_Product 结果可以交付调用方;并且整个收尾过程保持在
|
|
|
|
|
|
|
|
// mtx_WaiteImg 锁内,与 StartCheck() 对 m_pCheck_Result 的赋值互斥,
|
|
|
|
|
|
|
|
// 避免同一 shared_ptr 被并发 reset/赋值(会造成控制块双重释放)。
|
|
|
|
std::lock_guard<std::mutex> lock(mtx_WaiteImg);
|
|
|
|
std::lock_guard<std::mutex> lock(mtx_WaiteImg);
|
|
|
|
|
|
|
|
m_pCheck_Result->SetCheckStep(Check_Step_Complete);
|
|
|
|
m_bHaveImgeDet = false;
|
|
|
|
m_bHaveImgeDet = false;
|
|
|
|
|
|
|
|
|
|
|
|
m_pCheck_Result.reset();
|
|
|
|
m_pCheck_Result.reset();
|
|
|
|
@ -851,8 +855,12 @@ int CameraCheckAnalysisy::InsertCameraLog()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 1、把图片的相关日志 写到 返回 日志中。
|
|
|
|
// 1、把图片的相关日志 写到 返回 日志中。
|
|
|
|
m_CheckResult_shareP->det_LogList.insert(m_CheckResult_shareP->det_LogList.end(),
|
|
|
|
// 注意:DetLog 可能仍被实例线程写入,使用 GetLogs() 做加锁快照,避免并发遍历。
|
|
|
|
pImageResult->detlog->logList.begin(), pImageResult->detlog->logList.end());
|
|
|
|
{
|
|
|
|
|
|
|
|
std::vector<std::string> imgLogs = pImageResult->detlog->GetLogs();
|
|
|
|
|
|
|
|
m_CheckResult_shareP->det_LogList.insert(m_CheckResult_shareP->det_LogList.end(),
|
|
|
|
|
|
|
|
imgLogs.begin(), imgLogs.end());
|
|
|
|
|
|
|
|
}
|
|
|
|
std::string str = "";
|
|
|
|
std::string str = "";
|
|
|
|
char buffer[256];
|
|
|
|
char buffer[256];
|
|
|
|
// 2、把缺陷信息 写的 返回日志中。
|
|
|
|
// 2、把缺陷信息 写的 返回日志中。
|
|
|
|
@ -883,8 +891,9 @@ int CameraCheckAnalysisy::InsertCameraLog()
|
|
|
|
if (QX_info->result == QX_RESULT_TYPE_NG)
|
|
|
|
if (QX_info->result == QX_RESULT_TYPE_NG)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::shared_ptr<DetLog> pQxLog = pDetResult->pQx_ErrorList->at(qxidx).detlog;
|
|
|
|
std::shared_ptr<DetLog> pQxLog = pDetResult->pQx_ErrorList->at(qxidx).detlog;
|
|
|
|
|
|
|
|
std::vector<std::string> qxLogs = pQxLog->GetLogs();
|
|
|
|
m_CheckResult_shareP->det_LogList.insert(m_CheckResult_shareP->det_LogList.end(),
|
|
|
|
m_CheckResult_shareP->det_LogList.insert(m_CheckResult_shareP->det_LogList.end(),
|
|
|
|
pQxLog->logList.begin(), pQxLog->logList.end());
|
|
|
|
qxLogs.begin(), qxLogs.end());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -900,8 +909,9 @@ int CameraCheckAnalysisy::InsertCameraLog()
|
|
|
|
if (QX_info->result == QX_RESULT_TYPE_YS)
|
|
|
|
if (QX_info->result == QX_RESULT_TYPE_YS)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::shared_ptr<DetLog> pQxLog = pDetResult->pQx_ErrorList->at(qxidx).detlog;
|
|
|
|
std::shared_ptr<DetLog> pQxLog = pDetResult->pQx_ErrorList->at(qxidx).detlog;
|
|
|
|
|
|
|
|
std::vector<std::string> qxLogs = pQxLog->GetLogs();
|
|
|
|
m_CheckResult_shareP->det_LogList.insert(m_CheckResult_shareP->det_LogList.end(),
|
|
|
|
m_CheckResult_shareP->det_LogList.insert(m_CheckResult_shareP->det_LogList.end(),
|
|
|
|
pQxLog->logList.begin(), pQxLog->logList.end());
|
|
|
|
qxLogs.begin(), qxLogs.end());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -917,8 +927,9 @@ int CameraCheckAnalysisy::InsertCameraLog()
|
|
|
|
if (QX_info->result == QX_RESULT_TYPE_OK)
|
|
|
|
if (QX_info->result == QX_RESULT_TYPE_OK)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::shared_ptr<DetLog> pQxLog = pDetResult->pQx_ErrorList->at(qxidx).detlog;
|
|
|
|
std::shared_ptr<DetLog> pQxLog = pDetResult->pQx_ErrorList->at(qxidx).detlog;
|
|
|
|
|
|
|
|
std::vector<std::string> qxLogs = pQxLog->GetLogs();
|
|
|
|
m_CheckResult_shareP->det_LogList.insert(m_CheckResult_shareP->det_LogList.end(),
|
|
|
|
m_CheckResult_shareP->det_LogList.insert(m_CheckResult_shareP->det_LogList.end(),
|
|
|
|
pQxLog->logList.begin(), pQxLog->logList.end());
|
|
|
|
qxLogs.begin(), qxLogs.end());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -934,8 +945,9 @@ int CameraCheckAnalysisy::InsertCameraLog()
|
|
|
|
if (QX_info->result == QX_RESULT_TYPE_NoJduge)
|
|
|
|
if (QX_info->result == QX_RESULT_TYPE_NoJduge)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
std::shared_ptr<DetLog> pQxLog = pDetResult->pQx_ErrorList->at(qxidx).detlog;
|
|
|
|
std::shared_ptr<DetLog> pQxLog = pDetResult->pQx_ErrorList->at(qxidx).detlog;
|
|
|
|
|
|
|
|
std::vector<std::string> qxLogs = pQxLog->GetLogs();
|
|
|
|
m_CheckResult_shareP->det_LogList.insert(m_CheckResult_shareP->det_LogList.end(),
|
|
|
|
m_CheckResult_shareP->det_LogList.insert(m_CheckResult_shareP->det_LogList.end(),
|
|
|
|
pQxLog->logList.begin(), pQxLog->logList.end());
|
|
|
|
qxLogs.begin(), qxLogs.end());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -947,8 +959,11 @@ int CameraCheckAnalysisy::InsertCameraLog()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 3、把相机的日志 写到 返回日志中。
|
|
|
|
// 3、把相机的日志 写到 返回日志中。
|
|
|
|
m_CheckResult_shareP->det_LogList.insert(m_CheckResult_shareP->det_LogList.end(),
|
|
|
|
{
|
|
|
|
m_pCheck_Result->detlog->logList.begin(), m_pCheck_Result->detlog->logList.end());
|
|
|
|
std::vector<std::string> camLogs = m_pCheck_Result->detlog->GetLogs();
|
|
|
|
|
|
|
|
m_CheckResult_shareP->det_LogList.insert(m_CheckResult_shareP->det_LogList.end(),
|
|
|
|
|
|
|
|
camLogs.begin(), camLogs.end());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
sprintf(buffer, " =====================Product Log =============================");
|
|
|
|
sprintf(buffer, " =====================Product Log =============================");
|
|
|
|
@ -956,8 +971,11 @@ int CameraCheckAnalysisy::InsertCameraLog()
|
|
|
|
m_CheckResult_shareP->det_LogList.push_back(str);
|
|
|
|
m_CheckResult_shareP->det_LogList.push_back(str);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 4、把产品相关日志 写到 返回日志中。
|
|
|
|
// 4、把产品相关日志 写到 返回日志中。
|
|
|
|
m_CheckResult_shareP->det_LogList.insert(m_CheckResult_shareP->det_LogList.end(),
|
|
|
|
{
|
|
|
|
m_pCheck_Result->productBaseResult->detlog->logList.begin(), m_pCheck_Result->productBaseResult->detlog->logList.end());
|
|
|
|
std::vector<std::string> productLogs = m_pCheck_Result->productBaseResult->detlog->GetLogs();
|
|
|
|
|
|
|
|
m_CheckResult_shareP->det_LogList.insert(m_CheckResult_shareP->det_LogList.end(),
|
|
|
|
|
|
|
|
productLogs.begin(), productLogs.end());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|