|
|
|
@ -545,9 +545,14 @@ int ALLImgCheckAnalysisy::PushInImg_New(std::shared_ptr<shareImage> p)
|
|
|
|
strlog += "isnot exist";
|
|
|
|
strlog += "isnot exist";
|
|
|
|
//设置其他m_ProductList送图状态设置为结束
|
|
|
|
//设置其他m_ProductList送图状态设置为结束
|
|
|
|
cout << "-------set m_ProductList other product to end-------" << endl ;
|
|
|
|
cout << "-------set m_ProductList other product to end-------" << endl ;
|
|
|
|
|
|
|
|
std::lock_guard<std::mutex> lock(mtx_ProductList);
|
|
|
|
for(auto &tem:m_ProductList){
|
|
|
|
for(auto &tem:m_ProductList){
|
|
|
|
tem->bIsImgComplete = true;
|
|
|
|
tem->bIsImgComplete = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if(-1 == p->Status)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return CHECK_ERROR_PushImg_ID_Error;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 产品不存在 新建一个
|
|
|
|
// 产品不存在 新建一个
|
|
|
|
@ -557,13 +562,19 @@ int ALLImgCheckAnalysisy::PushInImg_New(std::shared_ptr<shareImage> p)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (m_ProductList.size() > 50)
|
|
|
|
if (m_ProductList.size() > 50)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
Clear_m_ProductList();
|
|
|
|
return CHECK_ERROR_PushImg_ListSize;
|
|
|
|
return CHECK_ERROR_PushImg_ListSize;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
strlog += " | create new product";
|
|
|
|
strlog += " | create new product";
|
|
|
|
product = std::make_shared<Product>();
|
|
|
|
product = std::make_shared<Product>();
|
|
|
|
product->productBaseResult->strproductName = p->strImgProductID;
|
|
|
|
product->productBaseResult->strproductName = p->strImgProductID;
|
|
|
|
|
|
|
|
if (m_CurProductIdx > 999999)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
m_CurProductIdx = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
product->productUseCount = m_CurProductIdx;
|
|
|
|
|
|
|
|
m_CurProductIdx++;
|
|
|
|
m_ProductList.push_back(product);
|
|
|
|
m_ProductList.push_back(product);
|
|
|
|
std::string strTimg = CheckUtil::getCurTimeHMS();
|
|
|
|
std::string strTimg = CheckUtil::getCurTimeHMS();
|
|
|
|
product->productBaseResult->detlog->bPrintStr = true;
|
|
|
|
product->productBaseResult->detlog->bPrintStr = true;
|
|
|
|
@ -687,7 +698,26 @@ int ALLImgCheckAnalysisy::MergeShowImg(std::shared_ptr<Product> product)
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void ALLImgCheckAnalysisy::Clear_m_ProductList(){
|
|
|
|
|
|
|
|
int num = m_ProductList.size();
|
|
|
|
|
|
|
|
string strlog = "";
|
|
|
|
|
|
|
|
printf("******************\n\n m_ProductImgDetResultList %ld \n", m_ProductList.size());
|
|
|
|
|
|
|
|
std::lock_guard<std::mutex> lock(mtx_ProductList);
|
|
|
|
|
|
|
|
int idx = -1;
|
|
|
|
|
|
|
|
for (int i = 0; i < m_ProductList.size(); i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int sub = std::abs(m_CurProductIdx - m_ProductList.at(i)->productUseCount);
|
|
|
|
|
|
|
|
if (sub > 50)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
// 删除指定位置的元素
|
|
|
|
|
|
|
|
// m_ProductList.at(i)->productBaseResult->detlog->AddCheckstr(PrintLevel_0, "PushInImg", "%s Delete size > %d; m_CurProductIdx %d - nNotDetCount %d > 50",
|
|
|
|
|
|
|
|
// m_ProductList.at(i)->,
|
|
|
|
|
|
|
|
// m_ProductList.size(), m_CurProductIdx,
|
|
|
|
|
|
|
|
// m_ProductList.at(i)->productUseCount);
|
|
|
|
|
|
|
|
m_ProductList.erase(m_ProductList.begin() + i);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
int ALLImgCheckAnalysisy::Run()
|
|
|
|
int ALLImgCheckAnalysisy::Run()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|