|
|
|
@ -189,7 +189,16 @@ namespace Rs.MotionPlat.Flow
|
|
|
|
|
GlobalTray.NgTray.ChangeStatus(ESlotStatus.NotHave);
|
|
|
|
|
GlobalTray.RetestTray.ChangeStatus(ESlotStatus.NotHave);
|
|
|
|
|
GlobalTray.OkTary.ChangeStatus(ESlotStatus.NotHave);
|
|
|
|
|
flowStep = EDischargeFlowStep.工作前准备;
|
|
|
|
|
if(GlobalVar.RunSpace&&!GlobalVar.EnableStock)
|
|
|
|
|
{
|
|
|
|
|
GlobalTray.InputTray.ChangeStatus(ESlotStatus.Have);
|
|
|
|
|
flowStep = EDischargeFlowStep.判断是否需要从料仓取料;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
flowStep = EDischargeFlowStep.工作前准备;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if(button== EButtonType.Cancel)
|
|
|
|
|
{
|
|
|
|
@ -274,106 +283,55 @@ namespace Rs.MotionPlat.Flow
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//换料盘
|
|
|
|
|
//GlobalTray.InputTray.ChangeStatus(ESlotStatus.Have);
|
|
|
|
|
//先判断是否时最后一盘料,如果时最后一盘料,则提示客户换料
|
|
|
|
|
//if(Stock2Flow.Instance.GetCurrentLayer()==1)
|
|
|
|
|
if(StockManager.GetCurrentLayer(2)==1)
|
|
|
|
|
if(GlobalVar.RunSpace&&!GlobalVar.EnableStock)
|
|
|
|
|
{
|
|
|
|
|
EButtonType btn = Msgbox.ShowTipDialog( EButtonType.Retry| EButtonType.EndInput,"Please change tray","tip",true);
|
|
|
|
|
if(btn== EButtonType.Retry)
|
|
|
|
|
GlobalTray.InputTray.ChangeStatus(ESlotStatus.Have);
|
|
|
|
|
takeSlotIndex = 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//换料盘
|
|
|
|
|
//GlobalTray.InputTray.ChangeStatus(ESlotStatus.Have);
|
|
|
|
|
//先判断是否时最后一盘料,如果时最后一盘料,则提示客户换料
|
|
|
|
|
//if(Stock2Flow.Instance.GetCurrentLayer()==1)
|
|
|
|
|
if (StockManager.GetCurrentLayer(2) == 1)
|
|
|
|
|
{
|
|
|
|
|
EButtonType btn = Msgbox.ShowTipDialog(EButtonType.Retry | EButtonType.EndInput, "Please change tray", "tip", true);
|
|
|
|
|
if (btn == EButtonType.Retry)
|
|
|
|
|
{
|
|
|
|
|
//先把轴移动到安全位
|
|
|
|
|
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
|
|
|
|
|
//TakeTrayFlow.Instance.Take(ETrayType.Input, ETrayType.Empty);
|
|
|
|
|
//Stock2Flow.Instance.PrepareTray();
|
|
|
|
|
StockManager.PrepareTray(2);
|
|
|
|
|
TakeTrayFlow.Instance.Take(ETrayType.Input, ETrayType.Empty);
|
|
|
|
|
}
|
|
|
|
|
else if (btn == EButtonType.EndInput)
|
|
|
|
|
{
|
|
|
|
|
GlobalVar.Clear = true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//先把轴移动到安全位
|
|
|
|
|
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
|
|
|
|
|
//TakeTrayFlow.Instance.Take(ETrayType.Input, ETrayType.Empty);
|
|
|
|
|
//Stock2Flow.Instance.PrepareTray();
|
|
|
|
|
StockManager.PrepareTray(2);
|
|
|
|
|
TakeTrayFlow.Instance.Take(ETrayType.Input, ETrayType.Empty);
|
|
|
|
|
}
|
|
|
|
|
else if(btn== EButtonType.EndInput)
|
|
|
|
|
{
|
|
|
|
|
GlobalVar.Clear = true;
|
|
|
|
|
GlobalTray.InputTray.ChangeStatus(ESlotStatus.Have);
|
|
|
|
|
takeSlotIndex = 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//先把轴移动到安全位
|
|
|
|
|
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
|
|
|
|
|
TakeTrayFlow.Instance.Take(ETrayType.Input, ETrayType.Empty);
|
|
|
|
|
GlobalTray.InputTray.ChangeStatus(ESlotStatus.Have);
|
|
|
|
|
takeSlotIndex = 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case EDischargeFlowStep.进料盘产品定位:
|
|
|
|
|
if(GlobalVar.RunSpace)
|
|
|
|
|
ProductLocationFlow.Instance.Grab(ETrayType.Input, takeSlotIndex);
|
|
|
|
|
productLocationResult = OneGrabSixteenManager.Instance.GetResults();
|
|
|
|
|
if (productLocationResult != null || GlobalVar.RunSpace)
|
|
|
|
|
{
|
|
|
|
|
//对结果进行处理
|
|
|
|
|
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).FirstOrDefault();
|
|
|
|
@ -720,10 +678,19 @@ namespace Rs.MotionPlat.Flow
|
|
|
|
|
//{
|
|
|
|
|
// DischargeModuleGoSafePosFlow.Instance.GoSafePostion(ESafePosSide.PlaceToStock);
|
|
|
|
|
//}
|
|
|
|
|
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
|
|
|
|
|
TakeTrayFlow.Instance.Take(ETrayType.Empty, ETrayType.Ok, true, true);
|
|
|
|
|
GlobalTray.OkTary.ChangeStatus(ESlotStatus.NotHave);
|
|
|
|
|
ThreePointLocationFlow.Instance.Location(ETrayType.Ok);
|
|
|
|
|
if(GlobalVar.RunSpace&& !GlobalVar.EnableStock)
|
|
|
|
|
{
|
|
|
|
|
GlobalTray.OkTary.ChangeStatus(ESlotStatus.NotHave);
|
|
|
|
|
ThreePointLocationFlow.Instance.Location(ETrayType.Ok);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
DischargeModuleGoSafePosFlow.Instance.GoSafePostion();
|
|
|
|
|
TakeTrayFlow.Instance.Take(ETrayType.Empty, ETrayType.Ok, true, true);
|
|
|
|
|
GlobalTray.OkTary.ChangeStatus(ESlotStatus.NotHave);
|
|
|
|
|
ThreePointLocationFlow.Instance.Location(ETrayType.Ok);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//料盘已满
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -768,10 +735,18 @@ namespace Rs.MotionPlat.Flow
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//提示更换料盘
|
|
|
|
|
Msgbox.ShowTipDialog(EButtonType.Ok, "NG tray full,please change tray and click ok button", "tip", true);
|
|
|
|
|
ThreePointLocationFlow.Instance.Location(ETrayType.Ng);
|
|
|
|
|
GlobalTray.NgTray.ChangeStatus(ESlotStatus.NotHave);
|
|
|
|
|
if (GlobalVar.RunSpace && !GlobalVar.EnableStock)
|
|
|
|
|
{
|
|
|
|
|
GlobalTray.NgTray.ChangeStatus(ESlotStatus.NotHave);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//提示更换料盘
|
|
|
|
|
Msgbox.ShowTipDialog(EButtonType.Ok, "NG tray full,please change tray and click ok button", "tip", true);
|
|
|
|
|
ThreePointLocationFlow.Instance.Location(ETrayType.Ng);
|
|
|
|
|
GlobalTray.NgTray.ChangeStatus(ESlotStatus.NotHave);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|