|
|
|
@ -283,70 +283,79 @@ namespace Rs.MotionPlat.Flow
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case EDischargeFlowStep.进料盘产品定位:
|
|
|
|
|
ProductLocationFlow.Instance.Grab( ETrayType.Input, takeSlotIndex);
|
|
|
|
|
productLocationResult = OneGrabSixteenManager.Instance.GetResults();
|
|
|
|
|
if(productLocationResult != null)
|
|
|
|
|
if(GlobalVar.RunSpace)
|
|
|
|
|
{
|
|
|
|
|
//foreach (ProductLocationResult item in results)
|
|
|
|
|
//{
|
|
|
|
|
// if(item.Result== EOneGrabSixteenResult.Slant || item.Result== EOneGrabSixteenResult.LocationOkScanBarcodeFail)
|
|
|
|
|
// {
|
|
|
|
|
// bool exit = false;
|
|
|
|
|
// while (!exit)
|
|
|
|
|
// {
|
|
|
|
|
// //凡是定位失败的,需要定位重拍
|
|
|
|
|
// ProductLocationResult vr = FixedGrabProductFlow.Instance.Grab(ETrayType.Input, item.SlotIndex);
|
|
|
|
|
// if (vr.Result == EOneGrabSixteenResult.Ok)//拍照OK
|
|
|
|
|
// {
|
|
|
|
|
// item.Change(vr.SN, vr.OffsetX, vr.OffsetY);
|
|
|
|
|
// exit = true;
|
|
|
|
|
// }
|
|
|
|
|
// else if (vr.Result == EOneGrabSixteenResult.Slant)//拍照失败
|
|
|
|
|
// {
|
|
|
|
|
// //报警弹框
|
|
|
|
|
// EButtonType buttonSelect = Msgbox.ShowDialog(EButtonType.Skip| EButtonType.Retry, $"穴位{item.SlotIndex}定位失败,请把产品手动取走后点击跳过");
|
|
|
|
|
// if (buttonSelect == EButtonType.Skip)
|
|
|
|
|
// {
|
|
|
|
|
// GlobalTray.InputTray.ChangeStatus(item.SlotIndex, ESlotStatus.NotHave);
|
|
|
|
|
// exit = true;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// else if (vr.Result == EOneGrabSixteenResult.LocationOkScanBarcodeFail)//定位成功,拍照失败
|
|
|
|
|
// {
|
|
|
|
|
// //这里需要把产品取到拍照NG料盘中
|
|
|
|
|
// //取料
|
|
|
|
|
// Nozzle idleNozzle = NozzleManager.GetIdelNozzle();
|
|
|
|
|
// StockTakeFlow.Instance.Take(item.SlotIndex, idleNozzle.NozzleIndex);
|
|
|
|
|
// //放料
|
|
|
|
|
// TraySlot noProductSlot = GlobalTray.RetestTray.GetSlot(ESlotStatus.NotHave);
|
|
|
|
|
// if (noProductSlot != null)
|
|
|
|
|
// {
|
|
|
|
|
// StockPlaceFlow.Instance.Place(ETrayType.ReTest, noProductSlot.Index, idleNozzle.NozzleIndex);
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// {
|
|
|
|
|
// Msgbox.ShowDialog(EButtonType.Ok, "Retest料盘已放满,请更换料盘,更换完成后点击确定");
|
|
|
|
|
// GlobalTray.RetestTray.ChangeStatus(ESlotStatus.NotHave);
|
|
|
|
|
// ThreePointLocationFlow.Instance.Location(ETrayType.ReTest);
|
|
|
|
|
// //放料
|
|
|
|
|
// noProductSlot = GlobalTray.RetestTray.GetSlot(ESlotStatus.NotHave);
|
|
|
|
|
// StockPlaceFlow.Instance.Place(ETrayType.ReTest, noProductSlot.Index, idleNozzle.NozzleIndex);
|
|
|
|
|
// }
|
|
|
|
|
// exit = true;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
//对结果进行处理
|
|
|
|
|
flowStep = EDischargeFlowStep.料仓取料;
|
|
|
|
|
productLocationResult = OneGrabSixteenManager.Instance.GetResults();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
ProductLocationFlow.Instance.Grab(ETrayType.Input, takeSlotIndex);
|
|
|
|
|
productLocationResult = OneGrabSixteenManager.Instance.GetResults();
|
|
|
|
|
if (productLocationResult != null)
|
|
|
|
|
{
|
|
|
|
|
//foreach (ProductLocationResult item in results)
|
|
|
|
|
//{
|
|
|
|
|
// if(item.Result== EOneGrabSixteenResult.Slant || item.Result== EOneGrabSixteenResult.LocationOkScanBarcodeFail)
|
|
|
|
|
// {
|
|
|
|
|
// bool exit = false;
|
|
|
|
|
// while (!exit)
|
|
|
|
|
// {
|
|
|
|
|
// //凡是定位失败的,需要定位重拍
|
|
|
|
|
// ProductLocationResult vr = FixedGrabProductFlow.Instance.Grab(ETrayType.Input, item.SlotIndex);
|
|
|
|
|
// if (vr.Result == EOneGrabSixteenResult.Ok)//拍照OK
|
|
|
|
|
// {
|
|
|
|
|
// item.Change(vr.SN, vr.OffsetX, vr.OffsetY);
|
|
|
|
|
// exit = true;
|
|
|
|
|
// }
|
|
|
|
|
// else if (vr.Result == EOneGrabSixteenResult.Slant)//拍照失败
|
|
|
|
|
// {
|
|
|
|
|
// //报警弹框
|
|
|
|
|
// EButtonType buttonSelect = Msgbox.ShowDialog(EButtonType.Skip| EButtonType.Retry, $"穴位{item.SlotIndex}定位失败,请把产品手动取走后点击跳过");
|
|
|
|
|
// if (buttonSelect == EButtonType.Skip)
|
|
|
|
|
// {
|
|
|
|
|
// GlobalTray.InputTray.ChangeStatus(item.SlotIndex, ESlotStatus.NotHave);
|
|
|
|
|
// exit = true;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// else if (vr.Result == EOneGrabSixteenResult.LocationOkScanBarcodeFail)//定位成功,拍照失败
|
|
|
|
|
// {
|
|
|
|
|
// //这里需要把产品取到拍照NG料盘中
|
|
|
|
|
// //取料
|
|
|
|
|
// Nozzle idleNozzle = NozzleManager.GetIdelNozzle();
|
|
|
|
|
// StockTakeFlow.Instance.Take(item.SlotIndex, idleNozzle.NozzleIndex);
|
|
|
|
|
// //放料
|
|
|
|
|
// TraySlot noProductSlot = GlobalTray.RetestTray.GetSlot(ESlotStatus.NotHave);
|
|
|
|
|
// if (noProductSlot != null)
|
|
|
|
|
// {
|
|
|
|
|
// StockPlaceFlow.Instance.Place(ETrayType.ReTest, noProductSlot.Index, idleNozzle.NozzleIndex);
|
|
|
|
|
// }
|
|
|
|
|
// else
|
|
|
|
|
// {
|
|
|
|
|
// Msgbox.ShowDialog(EButtonType.Ok, "Retest料盘已放满,请更换料盘,更换完成后点击确定");
|
|
|
|
|
// GlobalTray.RetestTray.ChangeStatus(ESlotStatus.NotHave);
|
|
|
|
|
// ThreePointLocationFlow.Instance.Location(ETrayType.ReTest);
|
|
|
|
|
// //放料
|
|
|
|
|
// noProductSlot = GlobalTray.RetestTray.GetSlot(ESlotStatus.NotHave);
|
|
|
|
|
// StockPlaceFlow.Instance.Place(ETrayType.ReTest, noProductSlot.Index, idleNozzle.NozzleIndex);
|
|
|
|
|
// }
|
|
|
|
|
// exit = true;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// }
|
|
|
|
|
//}
|
|
|
|
|
//对结果进行处理
|
|
|
|
|
flowStep = EDischargeFlowStep.料仓取料;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case EDischargeFlowStep.料仓取料:
|
|
|
|
|
ProductLocationResult ret = productLocationResult.Where(r => r.SlotIndex == takeSlotIndex).First();
|
|
|
|
|
ProductLocationResult ret = productLocationResult.Where(r => r.SlotIndex == takeSlotIndex).FirstOrDefault();
|
|
|
|
|
if(ret != null || GlobalVar.RunSpace)
|
|
|
|
|
{
|
|
|
|
|
if(ret.Result== EOneGrabSixteenResult.Ok || GlobalVar.RunSpace)
|
|
|
|
|
if((ret!= null && ret.Result== EOneGrabSixteenResult.Ok) || GlobalVar.RunSpace)
|
|
|
|
|
{
|
|
|
|
|
StockTakeFlow.Instance.Take( ETrayType.Input, takeSlotIndex, NozzleManager.GetIdelNozzle().NozzleIndex);
|
|
|
|
|
takeSlotIndex++;
|
|
|
|
|