|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
using Rs.Controls;
|
|
|
|
|
using Rs.Framework;
|
|
|
|
|
using Rs.Motion.Base;
|
|
|
|
|
using Rs.MotionPlat.Commom;
|
|
|
|
|
using Rs.MotionPlat.Entitys;
|
|
|
|
|
using Rs.MotionPlat.Flow.Common;
|
|
|
|
@ -36,6 +37,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class StockTakeFlow
|
|
|
|
|
{
|
|
|
|
|
int takeNum = 1;
|
|
|
|
|
bool finished = true;
|
|
|
|
|
Nozzle curNozzle = null;
|
|
|
|
|
TraySlot waitTakeProductSlot = null;
|
|
|
|
@ -68,7 +70,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
|
/// <param name="className"></param>
|
|
|
|
|
public void Take(ETrayType trayType, int slotIndex,int nozzleIndex, EStockScanBarcodeMode scanBarCodeMode= EStockScanBarcodeMode.Multi, ProductLocationResult locaResult=null,bool needStop=true)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
takeNum = 1;
|
|
|
|
|
if (finished)
|
|
|
|
|
finished = false;
|
|
|
|
|
else
|
|
|
|
@ -252,56 +254,80 @@ namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if(GlobalVar.BinTakeFailSkip && trayType== ETrayType.Input)
|
|
|
|
|
if(takeNum<2)
|
|
|
|
|
{
|
|
|
|
|
logInfo = GetClassName() + $"{trayType} bin {waitTakeProductSlot.Index} take fail auto skip";
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
|
curNozzle.VacBreak(EIoOperate.Close, GetClassName());
|
|
|
|
|
curNozzle.VacSuction(EIoOperate.Close, GetClassName());
|
|
|
|
|
finished = true;
|
|
|
|
|
flowStep = EStockTakeFlowStep.待触发;
|
|
|
|
|
takeNum++;
|
|
|
|
|
IAxis homeAxis = AxisControl.GetAxis($"NozzleZ{curNozzle.NozzleIndex}");
|
|
|
|
|
if (homeAxis != null)
|
|
|
|
|
{
|
|
|
|
|
homeAxis.Home();
|
|
|
|
|
Thread.Sleep(500);
|
|
|
|
|
while (true)
|
|
|
|
|
{
|
|
|
|
|
if (homeAxis.HomeStatus == Motion.EHomeStatus.Finished)
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
Thread.Sleep(100);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
flowStep = EStockTakeFlowStep.到料仓取料位上方;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.排料吸嘴取料失败报警).Transform($"{curNozzle.NozzleIndex}", $"{waitTakeProductSlot.Row}", $"{waitTakeProductSlot.Column}", $"{waitTakeProductSlot.Index}");
|
|
|
|
|
EButtonType btnSelect = Msgbox.ShowDialog(alarmEntity, EButtonType.EndInput | EButtonType.Retry | EButtonType.Skip | EButtonType.Recheck, true);
|
|
|
|
|
switch (btnSelect)
|
|
|
|
|
|
|
|
|
|
if (GlobalVar.BinTakeFailSkip && trayType == ETrayType.Input)
|
|
|
|
|
{
|
|
|
|
|
case EButtonType.EndInput:
|
|
|
|
|
logInfo = GetClassName() + $"选择了结束上料";
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
|
GlobalVar.Clear = true;
|
|
|
|
|
finished = true;
|
|
|
|
|
flowStep = EStockTakeFlowStep.待触发;
|
|
|
|
|
break;
|
|
|
|
|
case EButtonType.Retry:
|
|
|
|
|
logInfo = GetClassName() + $"选择了重试";
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
|
curNozzle.VacBreak(EIoOperate.Close, GetClassName());
|
|
|
|
|
curNozzle.VacSuction(EIoOperate.Close, GetClassName());
|
|
|
|
|
//先把产品放下
|
|
|
|
|
//StockPlaceFlow.Instance.Place(ETrayType.Input, waitTakeProductSlot.Index, curNozzle.NozzleIndex);
|
|
|
|
|
flowStep = EStockTakeFlowStep.到料仓取料位下方;
|
|
|
|
|
break;
|
|
|
|
|
case EButtonType.Recheck:
|
|
|
|
|
logInfo = GetClassName() + $"选择了重新检查真空";
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
|
flowStep = EStockTakeFlowStep.料仓取料真空吸检测;
|
|
|
|
|
break;
|
|
|
|
|
case EButtonType.Skip:
|
|
|
|
|
logInfo = GetClassName() + $"选择了跳过";
|
|
|
|
|
curNozzle.VacBreak(EIoOperate.Close, GetClassName());
|
|
|
|
|
curNozzle.VacSuction(EIoOperate.Close, GetClassName());
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
|
finished = true;
|
|
|
|
|
flowStep = EStockTakeFlowStep.待触发;
|
|
|
|
|
break;
|
|
|
|
|
logInfo = GetClassName() + $"{trayType} bin {waitTakeProductSlot.Index} take fail auto skip";
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
|
curNozzle.VacBreak(EIoOperate.Close, GetClassName());
|
|
|
|
|
curNozzle.VacSuction(EIoOperate.Close, GetClassName());
|
|
|
|
|
finished = true;
|
|
|
|
|
flowStep = EStockTakeFlowStep.待触发;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
AlarmEntity alarmEntity = AlarmCollection.Get(AlarmConstID.排料吸嘴取料失败报警).Transform($"{curNozzle.NozzleIndex}", $"{waitTakeProductSlot.Row}", $"{waitTakeProductSlot.Column}", $"{waitTakeProductSlot.Index}");
|
|
|
|
|
EButtonType btnSelect = Msgbox.ShowDialog(alarmEntity, EButtonType.EndInput | EButtonType.Retry | EButtonType.Skip | EButtonType.Recheck, true);
|
|
|
|
|
switch (btnSelect)
|
|
|
|
|
{
|
|
|
|
|
case EButtonType.EndInput:
|
|
|
|
|
logInfo = GetClassName() + $"选择了结束上料";
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
|
GlobalVar.Clear = true;
|
|
|
|
|
finished = true;
|
|
|
|
|
flowStep = EStockTakeFlowStep.待触发;
|
|
|
|
|
break;
|
|
|
|
|
case EButtonType.Retry:
|
|
|
|
|
logInfo = GetClassName() + $"选择了重试";
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
|
curNozzle.VacBreak(EIoOperate.Close, GetClassName());
|
|
|
|
|
curNozzle.VacSuction(EIoOperate.Close, GetClassName());
|
|
|
|
|
//先把产品放下
|
|
|
|
|
//StockPlaceFlow.Instance.Place(ETrayType.Input, waitTakeProductSlot.Index, curNozzle.NozzleIndex);
|
|
|
|
|
flowStep = EStockTakeFlowStep.到料仓取料位下方;
|
|
|
|
|
break;
|
|
|
|
|
case EButtonType.Recheck:
|
|
|
|
|
logInfo = GetClassName() + $"选择了重新检查真空";
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
|
flowStep = EStockTakeFlowStep.料仓取料真空吸检测;
|
|
|
|
|
break;
|
|
|
|
|
case EButtonType.Skip:
|
|
|
|
|
logInfo = GetClassName() + $"选择了跳过";
|
|
|
|
|
curNozzle.VacBreak(EIoOperate.Close, GetClassName());
|
|
|
|
|
curNozzle.VacSuction(EIoOperate.Close, GetClassName());
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
|
finished = true;
|
|
|
|
|
flowStep = EStockTakeFlowStep.待触发;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|