|
|
|
@ -1,4 +1,5 @@
|
|
|
|
|
using NPOI.SS.Formula.Eval;
|
|
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
using NPOI.SS.Formula.Eval;
|
|
|
|
|
using Rs.Camera;
|
|
|
|
|
using Rs.Controls;
|
|
|
|
|
using Rs.Framework;
|
|
|
|
@ -402,19 +403,32 @@ namespace Rs.MotionPlat.Flow
|
|
|
|
|
logInfo = GetClassName() + $"视觉检测到穴位{ret.SlotIndex}有料";
|
|
|
|
|
LogHelper.Debug(logInfo);
|
|
|
|
|
fixtureret = FixedGrabProductFlow.Instance.TakePicture(ETrayType.Input, ret.SlotIndex);
|
|
|
|
|
if (fixtureret.Result == EOneGrabSixteenResult.Ok)
|
|
|
|
|
if (fixtureret !=null && fixtureret.Result == EOneGrabSixteenResult.Ok)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.Debug(GetClassName() + $"{JsonConvert.SerializeObject(fixtureret)}");
|
|
|
|
|
if (fixtureret.SN.Length == GlobalVar.BarcodeLength)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
LogHelper.Debug(GetClassName() + "检测到二维码长度和设置的长度一致");
|
|
|
|
|
ret.Change(fixtureret.SN, fixtureret.OffsetX, fixtureret.OffsetY);
|
|
|
|
|
//takeSlotIndex++;
|
|
|
|
|
LogHelper.Debug(GetClassName() + $"产品二维码:{fixtureret.SN}准备取料");
|
|
|
|
|
StockTakeFlow.Instance.Take(ETrayType.Input, takeSlotIndex, NozzleManager.GetIdelNozzle().NozzleIndex);
|
|
|
|
|
takeSlotIndex++;
|
|
|
|
|
flowStep = EDischargeFlowStep.判断是否需要从料仓取料;
|
|
|
|
|
exit = true;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Msg.ShowError(ex.Message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
LogHelper.Debug(GetClassName() + "检测到二维码长度和设置的长度不一致,弹框报警");
|
|
|
|
|
//报警弹框
|
|
|
|
|
alarmEntity = AlarmCollection.Get(AlarmConstID.二维码长度异常报警).Transform(ret.SlotIndex);
|
|
|
|
|
EButtonType buttonSelect = Msgbox.ShowDialog(alarmEntity, EButtonType.Retry, true);
|
|
|
|
@ -424,8 +438,13 @@ namespace Rs.MotionPlat.Flow
|
|
|
|
|
MessageQueue.Instance.Insert(logInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
Msg.ShowError(ex.Message);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if (fixtureret.Result == EOneGrabSixteenResult.LocationOkScanBarcodeFail)
|
|
|
|
|
}
|
|
|
|
|
else if (fixtureret != null && fixtureret.Result == EOneGrabSixteenResult.LocationOkScanBarcodeFail)
|
|
|
|
|
{
|
|
|
|
|
Nozzle idleNozzle = NozzleManager.GetIdelNozzle();
|
|
|
|
|
if (!GlobalVar.ScanFailToTest)
|
|
|
|
@ -463,7 +482,7 @@ namespace Rs.MotionPlat.Flow
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (fixtureret.Result == EOneGrabSixteenResult.Slant)
|
|
|
|
|
else if (fixtureret != null && fixtureret.Result == EOneGrabSixteenResult.Slant)
|
|
|
|
|
{
|
|
|
|
|
//报警弹框
|
|
|
|
|
alarmEntity = AlarmCollection.Get(AlarmConstID.取料定位失败报警).Transform(ret.SlotIndex);
|
|
|
|
|