插入流程更改

This commit is contained in:
820689062 2024-07-24 13:07:15 +08:00
parent 618c799818
commit 295d30b49f

View File

@ -1328,11 +1328,7 @@ namespace HisenceYoloDetection
xKNow = GetModeFromBar(OcrBar);//从数据库中查询到这个条码的四轴的值 xKNow = GetModeFromBar(OcrBar);//从数据库中查询到这个条码的四轴的值
if (xKNow == null)
{
myLog("数据库没有条码匹配" + m_sKEYENCEBar, DateTime.Now);
// break;
}
if (Regex.IsMatch(xKNow.MoveX.ToString(), @"^[0-9]+$") && Regex.IsMatch(xKNow.MoveY.ToString(), @"^[0-9]+$") && Regex.IsMatch(xKNow.MoveZ.ToString(), @"^[0-9]+$")) if (Regex.IsMatch(xKNow.MoveX.ToString(), @"^[0-9]+$") && Regex.IsMatch(xKNow.MoveY.ToString(), @"^[0-9]+$") && Regex.IsMatch(xKNow.MoveZ.ToString(), @"^[0-9]+$"))
{ {
@ -1394,7 +1390,10 @@ namespace HisenceYoloDetection
//Cam1.Snapshot(); //Cam1.Snapshot();
MoveToP(5815, YPos, ZPos); MoveToP(5815, YPos, ZPos);
melsecPLCTCPDriver.WriteInt("550", 0);//方行 melsecPLCTCPDriver.WriteInt("550", 0);//方行
//Thread.Sleep(300);//洗衣机可能过不去
Thread.Sleep(1000);//洗衣机可能过不去
//if (xKNow != null) //if (xKNow != null)
//{ //{
@ -1604,24 +1603,24 @@ namespace HisenceYoloDetection
//melsecPLCTCPDriver.WriteInt("550", 0);//方行 //melsecPLCTCPDriver.WriteInt("550", 0);//方行
//2第一次拍照 //2第一次拍照
//if (IfCam2Triger) //if (IfCam2Triger)
{ //{
//根据条码数据库比对 //根据条码数据库比对
_runHandleAfter.Reset(); _runHandleAfter.Reset();
if (xKNow == null) //if (xKNow == null)
{ //{
myLog("未匹配条码", DateTime.Now); // myLog("未匹配条码", DateTime.Now);
break; // break;
} //}
if (xKNow.OcrBar == null) //if (xKNow.OcrBar == null)
{ //{
myLog("未匹配成功" + xKNow.OcrBar, DateTime.Now); // myLog("未匹配成功" + xKNow.OcrBar, DateTime.Now);
myLog("开始插入模板", DateTime.Now); // myLog("开始插入模板", DateTime.Now);
Insert_auto(true, Cam1ImgOne, m_sKEYENCEBar, 8974, 0, 0); // Insert_auto(true, Cam1ImgOne, m_sKEYENCEBar, 8974, 0, 0);
break; // break;
} //}
string IOcrBAr = xKNow.OcrBar; string IOcrBAr = xKNow.OcrBar;
//xKNow = GetModeFromBar(IOcrBAr);//从数据库中查询到这个条码的四轴的值 //xKNow = GetModeFromBar(IOcrBAr);//从数据库中查询到这个条码的四轴的值
//这里改成和海信的对接需求 //这里改成和海信的对接需求
@ -1647,10 +1646,10 @@ namespace HisenceYoloDetection
} //}
//相机1第二次拍照 //相机1第二次拍照
// if (IfCam1TwoTriger && bBarTriger) // if (IfCam1TwoTriger && bBarTriger)
{ //{
//初始化板 //初始化板
Defet_OnDetectionDone(whiteMat, 1); Defet_OnDetectionDone(whiteMat, 1);
@ -1832,7 +1831,7 @@ namespace HisenceYoloDetection
} }
} //}
} }
@ -1915,7 +1914,7 @@ namespace HisenceYoloDetection
} }
return XK_hisence; return null;
} }
@ -2136,9 +2135,28 @@ namespace HisenceYoloDetection
meachineState = MeachineState.machine_opening; meachineState = MeachineState.machine_opening;
TriggerCameral2();//光电触发拍照 根据SN获取型号 从数据库中得到块值 TriggerCameral2();//光电触发拍照 根据SN获取型号 从数据库中得到块值
ReadyDetect();//相机拍照后检测线程 if (xKNow == null)
//ThreadPost();//相机拍照后获取当日的型号 {
myLog("开启流程成功", DateTime.Now); myLog("数据库没有条码匹配" + m_sKEYENCEBar, DateTime.Now);
myLog("开始插入模板", DateTime.Now);
Insert_auto(true, Cam1ImgOne, m_sKEYENCEBar, 8974, 0, 0);
Thread.Sleep(5000);
xKNow = GetModeFromBar(m_sKEYENCEBar); // 重新获取
if(xKNow!=null)
{
myLog("插入模板成功!", DateTime.Now);
ReadyDetect();//相机拍照后检测线程
}
}
else {
ReadyDetect();//相机拍照后检测线程
}
//ThreadPost();//相机拍照后获取当日的型号
myLog("开启流程成功", DateTime.Now);
} }
private void RefeshData_Click(object sender, EventArgs e) private void RefeshData_Click(object sender, EventArgs e)