优化GRR跑着跑着停下,之前收到RESULT时计数改为产品在治具取起来后计数

master
lhiven 1 year ago
parent 9a8c87e7e8
commit 0ab27289d7

@ -88,6 +88,14 @@ namespace Rs.MotionPlat.Entitys
}
}
public void AddTestRecordToProduct()
{
if (Product != null && !string.IsNullOrEmpty(Result))
{
Product.AddResult(this.Index, "", "");
}
}
public void Clear()
{
this.Product = null;
@ -545,13 +553,13 @@ namespace Rs.MotionPlat.Entitys
if(Status == ETestFixtureStatus.Testing ||(Status== ETestFixtureStatus.IDLE && Product!=null &&String.IsNullOrEmpty(Result)))
{
Send("Result$");
LogHelper.Debug($"<<< TC{Index} Result$");
if (CheckPrintLog())
{
//lock (this)
//{
// File.AppendAllText($"d:\\1\\{Index}.txt", $"<<< 治具{Index} Result$\r\n");
//}
LogHelper.Debug($"<<< TC{Index} Result$");
logs.Enqueue($"<<< TC{Index} Result$");
}
}
@ -567,7 +575,7 @@ namespace Rs.MotionPlat.Entitys
break;
case "3":
//侧相机测试失败
EButtonType sideCameraSelect = Msgbox.ShowTipDialog(EButtonType.Retry | EButtonType.Cancel, "请检查DUT是否放好如果已放好继续测试选择Retry终止测试选择Cancel");
EButtonType sideCameraSelect = Msgbox.ShowTipDialog(EButtonType.Retry | EButtonType.Cancel, $"请检查DUT{Index}是否放好如果已放好继续测试选择Retry终止测试选择Cancel","warn",true);
if(sideCameraSelect== EButtonType.Retry)
{
string msg = "ContinueTest#1$";
@ -593,44 +601,34 @@ namespace Rs.MotionPlat.Entitys
dataEvent.Set();
break;
case "Result":
//if (writeLogs.Contains(Index))
//{
// LogHelper.Info($">>> 治具{Index} Result");
//}
if(Product!=null)
//if(items!=null && items.Length>=6)
{
if (items[2] == "1")
{
Result = "PASS";
PassCount++;
}
else
if (Product != null)
{
Result = "NG";
if (items[2] == "1")
{
Result = "PASS";
PassCount++;
}
else
{
Result = "NG";
}
Product.Result = Result;
Product.Bin = items[6];
//this.Product.AddResult(this.Index, Result, items[6]);
}
this.Product.AddResult(this.Index, Result, items[6]);
string csvContent = string.Join(",", items[3], items[4], items[5]);
LogHelper.Debug($"Result:{items[3]}");
DevLog.Summary(CsvTitle, csvContent);
this.EndTestTime = DateTime.Now;
this.LastCT = (EndTestTime - StartTestTime).TotalSeconds;
TotalCount++;
Yield = (double)((double)PassCount / TotalCount);
Status = ETestFixtureStatus.IDLE;
dataEvent.Set();
}
//string summaryPath = $"D:\\Summary\\{DateTime.Now.ToString("yyyyMMdd")}\\summary.csv";
//if (!Directory.Exists(Path.GetDirectoryName(summaryPath)))
//{
// Directory.CreateDirectory(Path.GetDirectoryName(summaryPath));
//}
//if (!File.Exists(summaryPath))
//{
// File.AppendAllText(summaryPath, CsvTitle);
//}
//File.AppendAllText(summaryPath, items[3]);
string csvContent = string.Join(",", items[3], items[4], items[5]);
DevLog.Summary(CsvTitle, csvContent);
this.EndTestTime = DateTime.Now;
this.LastCT = (EndTestTime - StartTestTime).TotalSeconds;
TotalCount++;
Yield = (double)((double)PassCount / TotalCount);
Status = ETestFixtureStatus.IDLE;
dataEvent.Set();
break;
case "ErrorCode":
//if (writeLogs.Contains(Index))

@ -42,14 +42,15 @@ namespace Rs.MotionPlat.Entitys
public void AddResult(int fixtureIndex,string result,string binInfo)
{
LogHelper.Debug($"治具{fixtureIndex}产品已取出测试数量加1");
TestNum++;
if (TestedFixtures == null)
TestedFixtures = new List<int>();
if (TestResults == null)
TestResults = new List<string>();
Result = result;
Bin = binInfo;
TestResults.Add(result);
//Result = result;
//Bin = binInfo;
TestResults.Add(Result);
TestedFixtures.Add(fixtureIndex);
}

@ -385,7 +385,7 @@ namespace Rs.MotionPlat.Flow
bool exit = false;
while (!exit)
{
ProductLocationResult fixtureret = FixedGrabProductFlow.Instance.Grab(ETrayType.Input, ret.SlotIndex);
ProductLocationResult fixtureret = FixedGrabProductFlow.Instance.TakePicture(ETrayType.Input, ret.SlotIndex);
if (fixtureret.Result == EOneGrabSixteenResult.Ok)
{
ret.Change(fixtureret.SN, fixtureret.OffsetX, fixtureret.OffsetY);

@ -535,28 +535,12 @@ namespace Rs.MotionPlat.Flow
case EGrrFlowStep.:
if (Ops.IsOn($"吸料真空{curTakeNozzle.NozzleIndex}检测") || GlobalVar.RunSpace)
{
curFixture.AddTestRecordToProduct();
curTakeNozzle.Product = curFixture.Product;
string testFixtures = string.Join(",", curTakeNozzle.Product.TestedFixtures);
//try
//{
// LogHelper.Debug($"测试治具:{testFixtures}");
//}
//catch (Exception ex)
//{
//}
//try
//{
// LogHelper.Debug($"测试次数:{curTakeNozzle.Product.TestNum}");
//}
//catch (Exception ex)
//{
// LogHelper.Debug($"取测试");
//}
logInfo = $"{GetClassName()}取料完成真空检测OK吸嘴 {curTakeNozzle.NozzleIndex} 从治具 {curFixture.Index} 把产品SN {curFixture.Product.SN} 取出,测试治具:{testFixtures},测试次数:{curTakeNozzle.Product.TestNum}";
MessageQueue.Instance.Insert(logInfo);
curFixture.Clear();//.Product = null;
curFixture.Clear();
GlobalTray.NozzleTray.ChangeStatus(curTakeNozzle.NozzleIndex, ESlotStatus.Have);
if(GlobalVar.TestMode=="GRR")
{

@ -41,7 +41,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
bool finished = true;
EFixedGrabProductFlowStep step = EFixedGrabProductFlowStep.;
public ProductLocationResult Grab(ETrayType trayType,int slotInex,int grabNum=3)
public ProductLocationResult TakePicture(ETrayType trayType,int slotInex,int grabNum=3)
{
ProductLocationResult result = new ProductLocationResult()
{

@ -213,6 +213,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
}
else
{
curFixture.AddTestRecordToProduct();
logInfo = $"{GetClassName()}治具{curFixture.Index}中产品SN:{curFixture.Product.SN}被吸嘴{curNozzle.NozzleIndex}取出";
MessageQueue.Instance.Insert(logInfo);
curNozzle.Product = curFixture.Product;

@ -100,14 +100,14 @@ namespace Rs.MotionPlat.Flow.SubFlow
{
if(!GlobalVar.RunSpace)
{
MessageQueue.Instance.Insert($"拍照偏移量 x:{result.OffsetX},y:{result.OffsetY}");
//MessageQueue.Instance.Insert($"拍照偏移量 x:{result.OffsetX},y:{result.OffsetY}");
targetPosition.X += result.OffsetX;
targetPosition.Y2 += result.OffsetY;
}
}
if(locaResult!=null)
{
MessageQueue.Instance.Insert($"拍照偏移量 x:{locaResult.OffsetX},y:{locaResult.OffsetY}");
//MessageQueue.Instance.Insert($"拍照偏移量 x:{locaResult.OffsetX},y:{locaResult.OffsetY}");
targetPosition.X += locaResult.OffsetX;
targetPosition.Y2 += locaResult.OffsetY;
}

@ -525,12 +525,12 @@ namespace Rs.MotionPlat.Commom
curTakeSlotPoint = TrayRunPointManager.GetSlotPoint(trayType, slotIndex);
}
}
MessageQueue.Instance.Insert($"基础loadx:{curTakeSlotPoint.X},loady2:{curTakeSlotPoint.Y}");
//MessageQueue.Instance.Insert($"基础loadx:{curTakeSlotPoint.X},loady2:{curTakeSlotPoint.Y}");
if (curTakeSlotPoint != null)
{
double nozzleOffsetX = GlobalVar.Nozzle1ToCameraCenterOffsetX + NozzleManager.GetNozzleOffsetX(nozzleIndex);
double nozzleOffsetY = GlobalVar.Nozzle1ToCameraCenterOffsetY2 + NozzleManager.GetNozzleOffsetY2(nozzleIndex);
MessageQueue.Instance.Insert($"吸嘴偏移x:{nozzleOffsetX},吸嘴偏移x:{nozzleOffsetY}");
//MessageQueue.Instance.Insert($"吸嘴偏移x:{nozzleOffsetX},吸嘴偏移x:{nozzleOffsetY}");
targetPosition.X = curTakeSlotPoint.X + GlobalVar.Nozzle1ToCameraCenterOffsetX + NozzleManager.GetNozzleOffsetX(nozzleIndex);
targetPosition.Y1 = GlobalVar.StockSideY1;
targetPosition.Y2 = curTakeSlotPoint.Y + GlobalVar.Nozzle1ToCameraCenterOffsetY2 + NozzleManager.GetNozzleOffsetY2(nozzleIndex);

@ -71,7 +71,7 @@ namespace Rs.MotionPlat.SysConfig
bool exit = false;
while (!exit)
{
ProductLocationResult fixtureret = FixedGrabProductFlow.Instance.Grab(ETrayType.Grr, i+1,1);
ProductLocationResult fixtureret = FixedGrabProductFlow.Instance.TakePicture(ETrayType.Grr, i+1,1);
if (fixtureret != null)
{
if (fixtureret.Result == EOneGrabSixteenResult.Ok)

@ -264,7 +264,7 @@ namespace Rs.MotionPlat
}
else
{
ProductLocationResult fixtureret = FixedGrabProductFlow.Instance.Grab(ETrayType.Grr, slot.Index, 1);
ProductLocationResult fixtureret = FixedGrabProductFlow.Instance.TakePicture(ETrayType.Grr, slot.Index, 1);
if(fixtureret!=null && (fixtureret.Result== EOneGrabSixteenResult.Ok || fixtureret.Result== EOneGrabSixteenResult.LocationOkScanBarcodeFail))
{
StockTakeFlow.Instance.Take(ETrayType.Grr, slot.Index, 1,fixtureret,false);

Loading…
Cancel
Save