|
|
|
@ -31,6 +31,8 @@ namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
|
public class StockTakeFlow
|
|
|
|
|
{
|
|
|
|
|
bool finished = true;
|
|
|
|
|
Nozzle curNozzle = null;
|
|
|
|
|
TraySlot waitTakeProductSlot = null;
|
|
|
|
|
EStockTakeFlowStep flowStep = EStockTakeFlowStep.待触发;
|
|
|
|
|
private StockTakeFlow()
|
|
|
|
|
{
|
|
|
|
@ -67,8 +69,6 @@ namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
|
flowStep = EStockTakeFlowStep.待触发;
|
|
|
|
|
string logInfo = string.Empty;
|
|
|
|
|
TargetPosition targetPosition = new TargetPosition();
|
|
|
|
|
Nozzle curNozzle = null;
|
|
|
|
|
TraySlot waitTakeProductSlot = null;
|
|
|
|
|
while (!finished)
|
|
|
|
|
{
|
|
|
|
|
if (MachineManage.Instance.MachineStatus== EMachineStatus.Stop)
|
|
|
|
@ -118,7 +118,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
|
}
|
|
|
|
|
if (GroupAxisMove.XY1Y2MovePos(targetPosition, GlobalVar.WholeSpeed))
|
|
|
|
|
{
|
|
|
|
|
AxisPosPrint.PrintXY1Y2TargetPos($"到料仓{waitTakeProductSlot.Index}号穴位取料位上方,", targetPosition, GetClassName());
|
|
|
|
|
AxisPosPrint.PrintXY1Y2TargetPos($"{WhatNozzleIndex()}到料仓{WhatTraySlot()}取料位上方,", targetPosition, GetClassName());
|
|
|
|
|
flowStep = EStockTakeFlowStep.等待到料仓取料位上方;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -130,7 +130,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
|
AxisPosPrint.PrintXY1Y2CurrentPos("轴XY1Y2已停止运动,", GetClassName());
|
|
|
|
|
if (AxisArrived.LoadXY1Y2IsArrived(targetPosition.X, targetPosition.Y1, targetPosition.Y2))
|
|
|
|
|
{
|
|
|
|
|
AxisPosPrint.PrintXY1Y2CurrentPos("已运动到料仓取料位上方,", GetClassName());
|
|
|
|
|
AxisPosPrint.PrintXY1Y2CurrentPos($"{WhatNozzleIndex()}已运动到料仓{WhatTraySlot()}取料位上方,", GetClassName());
|
|
|
|
|
flowStep = EStockTakeFlowStep.到料仓取料位下方;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -143,7 +143,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
|
targetPosition.StockZ = NozzleManager.GetNozzleToTrayTakeProductPos(ETrayType.Input, curNozzle.NozzleIndex);
|
|
|
|
|
if (NozzleManager.Go(curNozzle, targetPosition.StockZ, GlobalVar.WholeSpeed))
|
|
|
|
|
{
|
|
|
|
|
logInfo = $"{GetClassName()}到料仓取料位下方,tz:{targetPosition.StockZ}";
|
|
|
|
|
logInfo = $"{GetClassName()}{WhatNozzleIndex()}到料仓{WhatTraySlot()}取料位下方,tz:{targetPosition.StockZ}";
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
|
flowStep = EStockTakeFlowStep.等待到料仓取料位下方;
|
|
|
|
|
}
|
|
|
|
@ -151,8 +151,8 @@ namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
|
case EStockTakeFlowStep.等待到料仓取料位下方:
|
|
|
|
|
if (Ops.IsStop($"NozzleZ{curNozzle.NozzleIndex}"))
|
|
|
|
|
{
|
|
|
|
|
Thread.Sleep(200);
|
|
|
|
|
logInfo = $"{GetClassName()} 已运动到料仓取料位下方";
|
|
|
|
|
Thread.Sleep(100);
|
|
|
|
|
logInfo = $"{GetClassName()}{WhatNozzleIndex()}已运动到料仓{WhatTraySlot()}取料位下方:{curNozzle.GetCurrentPos()}";
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
|
if (!GlobalVar.RunSpace)
|
|
|
|
|
{
|
|
|
|
@ -173,7 +173,7 @@ namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
|
case EStockTakeFlowStep.等待料仓取料完成抬起:
|
|
|
|
|
if (Ops.IsStop($"NozzleZ{curNozzle.NozzleIndex}"))
|
|
|
|
|
{
|
|
|
|
|
logInfo =$"{GetClassName()} 料仓取料完成已抬起";
|
|
|
|
|
logInfo =$"{GetClassName()} 料仓取料完成已抬起:{curNozzle.GetCurrentPos()}";
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
|
flowStep = EStockTakeFlowStep.料仓取料真空吸检测;
|
|
|
|
|
}
|
|
|
|
@ -195,11 +195,11 @@ namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
|
}
|
|
|
|
|
curNozzle.Status = ENozzleStatus.ToTest;
|
|
|
|
|
//curNozzle.Status = ENozzleStatus.ToUnload;
|
|
|
|
|
GlobalTray.NozzleTray.ChangeStatus(curNozzle.NozzleIndex, ESlotStatus.Have);
|
|
|
|
|
curNozzle.ChangeStatus(ESlotStatus.Have);
|
|
|
|
|
GlobalTray.InputTray.ChangeStatus(waitTakeProductSlot.Index, ESlotStatus.NotHave);
|
|
|
|
|
if(curNozzle.Product!=null)
|
|
|
|
|
{
|
|
|
|
|
logInfo = $"{GetClassName()} from r{waitTakeProductSlot.Row + 1}c{waitTakeProductSlot.Column + 1} 穴位索引:{waitTakeProductSlot.Index} 产品:{curNozzle.Product.SN}被吸嘴{curNozzle.NozzleIndex}取料完成,";
|
|
|
|
|
logInfo = $"{GetClassName()} from r{waitTakeProductSlot.Row + 1}c{waitTakeProductSlot.Column + 1} 穴位索引:{WhatTraySlot()} 产品:{curNozzle.Product.SN}被{WhatNozzleIndex()}取料完成,";
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -252,5 +252,23 @@ namespace Rs.MotionPlat.Flow.SubFlow
|
|
|
|
|
{
|
|
|
|
|
return $"{nameof(StockTakeFlow)}-";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取几号吸嘴
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private string WhatNozzleIndex()
|
|
|
|
|
{
|
|
|
|
|
return $"{curNozzle.NozzleIndex}号吸嘴";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 获取料仓的几号穴位
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private string WhatTraySlot()
|
|
|
|
|
{
|
|
|
|
|
return $"{waitTakeProductSlot.Index}号穴位";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|