|
|
|
@ -129,6 +129,7 @@ namespace Aucma.Core.Palletiz.Business
|
|
|
|
|
/// <param name="asciiStr">20位是正常扫码传输的条码,手动入库传的是人工选择的成品型号</param>
|
|
|
|
|
private void InStore(string spaceArea, string asciiStr)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
#region 未登录禁止入库
|
|
|
|
|
if (string.IsNullOrEmpty(appConfig.TeamName))
|
|
|
|
|
{
|
|
|
|
@ -137,6 +138,7 @@ namespace Aucma.Core.Palletiz.Business
|
|
|
|
|
}
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Task.Run(() =>
|
|
|
|
|
{
|
|
|
|
|
RecordInStore recordInstore = new RecordInStore();
|
|
|
|
@ -176,7 +178,7 @@ namespace Aucma.Core.Palletiz.Business
|
|
|
|
|
|
|
|
|
|
bool result = false;
|
|
|
|
|
|
|
|
|
|
SendInStoreTask(asciiStr, spaceinfo, ref result, Convert.ToInt32(prodInfo.ProductMasterModel), ref msg, out int range);
|
|
|
|
|
SendInStoreTask(spaceArea,asciiStr, spaceinfo, ref result, Convert.ToInt32(prodInfo.ProductMasterModel), ref msg, out int range);
|
|
|
|
|
|
|
|
|
|
#region 添加入库记录
|
|
|
|
|
|
|
|
|
@ -399,7 +401,7 @@ namespace Aucma.Core.Palletiz.Business
|
|
|
|
|
/// <param name="spaceinfo"></param>
|
|
|
|
|
/// <param name="result"></param>
|
|
|
|
|
/// <exception cref="ArgumentException"></exception>
|
|
|
|
|
private void SendInStoreTask(string asciiStr, BaseSpaceInfo spaceinfo, ref bool result,int prodWeight,ref string msg,out int rangeResult)
|
|
|
|
|
private void SendInStoreTask(string spaceArea, string asciiStr, BaseSpaceInfo spaceinfo, ref bool result,int prodWeight,ref string msg,out int rangeResult)
|
|
|
|
|
{
|
|
|
|
|
int spinFlag = -1;
|
|
|
|
|
rangeResult = 0;
|
|
|
|
@ -413,7 +415,7 @@ namespace Aucma.Core.Palletiz.Business
|
|
|
|
|
bool isFlag = true;
|
|
|
|
|
|
|
|
|
|
int spaceCode = StringChange.ParseToInt(spaceinfo.SpaceCode);
|
|
|
|
|
spinFlag =JudgeRotation(spaceCode, prodWeight, out int ranges);
|
|
|
|
|
spinFlag =JudgeRotation(spaceArea,spaceCode, prodWeight, out int ranges);
|
|
|
|
|
rangeResult = ranges;
|
|
|
|
|
if (spinFlag == -1)
|
|
|
|
|
{
|
|
|
|
@ -431,7 +433,15 @@ namespace Aucma.Core.Palletiz.Business
|
|
|
|
|
result = false;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
bool answerFlag = _plc.ReadBool("B1000");
|
|
|
|
|
bool answerFlag = false;
|
|
|
|
|
if (spaceinfo.SpaceArea == "A")
|
|
|
|
|
{
|
|
|
|
|
answerFlag = _plc.ReadBool("B1000");
|
|
|
|
|
}
|
|
|
|
|
else if (spaceinfo.SpaceArea == "B")
|
|
|
|
|
{
|
|
|
|
|
answerFlag = _plc.ReadBool("B1010");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (answerFlag)
|
|
|
|
|
{
|
|
|
|
@ -460,20 +470,31 @@ namespace Aucma.Core.Palletiz.Business
|
|
|
|
|
else if (spaceinfo.SpaceArea == "B")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
result = false;
|
|
|
|
|
if (!_plc.WriteInt16("D0", spinFlag.ToString()))
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentException($"旋转角度下发至PLC失败");
|
|
|
|
|
}
|
|
|
|
|
if (!_plc.WriteInt16("D9", spaceCode.ToString()))
|
|
|
|
|
{
|
|
|
|
|
throw new ArgumentException($"货道号下发至PLC失败");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_plc.WriteInt16("B1002", "1");//发送完成信号
|
|
|
|
|
|
|
|
|
|
result = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// 根据货物容积确定旋转规则 转180度发1,不转发3
|
|
|
|
|
/// 根据货物容积确定旋转规则
|
|
|
|
|
/// </summary>
|
|
|
|
|
/// <param name="prodWeight"></param>
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
public int JudgeRotation(int spaceCode,int prodWeight, out int ranges)
|
|
|
|
|
public int JudgeRotation(string spaceArea,int spaceCode,int prodWeight, out int ranges)
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
List<JumpRange> list = appConfig.GetJumpRanges();
|
|
|
|
|
List<JumpRange> list = appConfig.GetJumpRanges(spaceArea);
|
|
|
|
|
foreach (JumpRange range in list)
|
|
|
|
|
{
|
|
|
|
|
if (range.MinModel <= prodWeight && range.MaxModel > prodWeight) // 找到该型号规则
|
|
|
|
|