|
|
|
@ -6,15 +6,12 @@ using Aucma.Core.HwPLc;
|
|
|
|
|
using Aucma.Core.Scanner;
|
|
|
|
|
using log4net;
|
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
|
using NetTaste;
|
|
|
|
|
using Org.BouncyCastle.Asn1.Tsp;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
|
|
|
|
|
|
|
|
|
|
namespace Aucma.Core.Palletiz.Business
|
|
|
|
|
{
|
|
|
|
@ -48,7 +45,6 @@ namespace Aucma.Core.Palletiz.Business
|
|
|
|
|
private readonly IRecordInStoreServices? _recordInstoreServices = App.ServiceProvider.GetService<IRecordInStoreServices>();
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void test()
|
|
|
|
|
{
|
|
|
|
|
// B240101 8302501416 0001 SN:16160030000000910999
|
|
|
|
@ -87,6 +83,7 @@ namespace Aucma.Core.Palletiz.Business
|
|
|
|
|
{
|
|
|
|
|
logHelper.Error("未找到匹配货道,请手动入库!");
|
|
|
|
|
// 刷新页面提示信息
|
|
|
|
|
Console.WriteLine("未找到匹配货道,请手动入库!");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// 过滤货道,找到最终需要下发的货道
|
|
|
|
@ -100,11 +97,12 @@ namespace Aucma.Core.Palletiz.Business
|
|
|
|
|
plcResult = sendAndAnswerPlc(scannerIp, spaceList[0].RotationRange, spaceNumList);
|
|
|
|
|
recordInstore.SpaceCode = finalSpace.SpaceCode;
|
|
|
|
|
recordInstore.StoreCode = finalSpace.StoreCode;
|
|
|
|
|
// 更新货道信息,大产品last存objId大的,如货道7,8存8
|
|
|
|
|
// 更新货道信息,大产品last存objId大的,储存上一个货道的主键 如货道7,8存8
|
|
|
|
|
BaseSpaceInfo otherSpace = getOtherSpace(finalSpace, spaceList);
|
|
|
|
|
if (otherSpace != null)
|
|
|
|
|
{
|
|
|
|
|
updateSapceList(otherSpace.ObjId,spaceList);
|
|
|
|
|
Console.WriteLine("更新货道信息成功!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -115,14 +113,16 @@ namespace Aucma.Core.Palletiz.Business
|
|
|
|
|
spaceNumList.Add(int.Parse(finalSpace.SpaceCode.Substring(5, 3)));
|
|
|
|
|
spaceNumList.Add(0);
|
|
|
|
|
plcResult = sendAndAnswerPlc(scannerIp, finalSpace.RotationRange, spaceNumList);
|
|
|
|
|
updateSapceList(finalSpace.ObjId, spaceList);
|
|
|
|
|
updateSapceList(finalSpace.ObjId, spaceList);
|
|
|
|
|
Console.WriteLine("更新货道信息成功!");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
spaceNumList.Add(0);
|
|
|
|
|
spaceNumList.Add(int.Parse(finalSpace.SpaceCode.Substring(5, 3)));
|
|
|
|
|
plcResult = sendAndAnswerPlc(scannerIp, finalSpace.RotationRange, spaceNumList);
|
|
|
|
|
updateSapceList(finalSpace.ObjId, spaceList);
|
|
|
|
|
updateSapceList(finalSpace.ObjId, spaceList);
|
|
|
|
|
Console.WriteLine("更新货道信息成功!");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -359,12 +359,14 @@ namespace Aucma.Core.Palletiz.Business
|
|
|
|
|
if (DateTime.Now > targetTime) // plc超最大时限无反馈
|
|
|
|
|
{
|
|
|
|
|
logHelper.Error("等待plc放行反馈信号超时");
|
|
|
|
|
Console.WriteLine("等待plc放行反馈信号超时");
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
// 应答字允许下发
|
|
|
|
|
if (obj.plc.ReadInt32("D102") == 2)
|
|
|
|
|
{
|
|
|
|
|
result = true;
|
|
|
|
|
Console.WriteLine("下发成功!");
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
Thread.Sleep(500);
|
|
|
|
|