Commit 7c540127 张东亮

最近出库记录分别记录

1 个父辈 b1494594
using System; using OnlineStore.Common;
using System;
using System.Collections; using System.Collections;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
...@@ -81,6 +82,26 @@ namespace OnlineStore.DeviceLibrary.deviceLibrary ...@@ -81,6 +82,26 @@ namespace OnlineStore.DeviceLibrary.deviceLibrary
return _internalList[_internalList.Count - 1]; return _internalList[_internalList.Count - 1];
} }
public void Remove(string posid)
{
try
{
if (!string.IsNullOrEmpty(posid))
{
var idx = _internalList.FindIndex(s => posid.Equals(s));
if (idx > -1)
{
_internalList.RemoveAt(idx);
}
}
}
catch(Exception ex)
{
LogUtil.error($"移除{posid}失败", ex);
}
}
/// <summary> /// <summary>
/// 从堆栈中移除所有元素。 /// 从堆栈中移除所有元素。
/// </summary> /// </summary>
......
...@@ -382,7 +382,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -382,7 +382,7 @@ namespace OnlineStore.DeviceLibrary
{ {
sb.AppendLine("B下暂存区检测到有料盘,但无缓存信息"); sb.AppendLine("B下暂存区检测到有料盘,但无缓存信息");
} }
else if(IOValue(IO_Type.FeedingB_Outstore_UnderArea_ReelCheck).Equals(IO_VALUE.LOW) && BufferDataManager.BOutStoreInfo != null) else if (IOValue(IO_Type.FeedingB_Outstore_UnderArea_ReelCheck).Equals(IO_VALUE.LOW) && BufferDataManager.BOutStoreInfo != null)
{ {
sb.AppendLine("B下暂存区有缓存信息,但无料"); sb.AppendLine("B下暂存区有缓存信息,但无料");
} }
...@@ -1133,7 +1133,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -1133,7 +1133,8 @@ namespace OnlineStore.DeviceLibrary
} }
internal override void StopMove() internal override void StopMove()
{ {
recentAOutstores.Clear();
recentBOutstores.Clear();
MoveInfo.EndMove(); MoveInfo.EndMove();
......
...@@ -469,6 +469,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -469,6 +469,10 @@ namespace OnlineStore.DeviceLibrary
//SetBoxStatus(DeviceStatus.InStoreEnd, RunStatus.Busy, MoveInfo.MoveParam.PosInfo.PosId, MoveInfo.MoveParam.PosInfo.barcode); //SetBoxStatus(DeviceStatus.InStoreEnd, RunStatus.Busy, MoveInfo.MoveParam.PosInfo.PosId, MoveInfo.MoveParam.PosInfo.barcode);
executeTime = (DateTime.Now - startTime).TotalSeconds.ToString("f2"); executeTime = (DateTime.Now - startTime).TotalSeconds.ToString("f2");
UpdownAxisTo_P6_P12(); UpdownAxisTo_P6_P12();
recentAOutstores.Remove(MoveInfo.MoveParam.PosInfo.PosId);
recentBOutstores.Remove(MoveInfo.MoveParam.PosInfo.PosId);
LogInfo($"{recentAOutstores}");
LogInfo($"{recentBOutstores}");
break; break;
case StepEnum.SI_15_UpDownBack: case StepEnum.SI_15_UpDownBack:
MoveInfo.NextMoveStep(StepEnum.SI_16_LiftTray); MoveInfo.NextMoveStep(StepEnum.SI_16_LiftTray);
......
...@@ -306,8 +306,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -306,8 +306,16 @@ namespace OnlineStore.DeviceLibrary
LogInfo($"出库 {MoveInfo.SLog}:[{MoveInfo.MoveParam.PosInfo.ToStr()}]出库完成[耗时:{(DateTime.Now - startTime).TotalSeconds.ToString("f2")}秒],移栽X轴到待机点P1,行走机构到待机点P1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]"); LogInfo($"出库 {MoveInfo.SLog}:[{MoveInfo.MoveParam.PosInfo.ToStr()}]出库完成[耗时:{(DateTime.Now - startTime).TotalSeconds.ToString("f2")}秒],移栽X轴到待机点P1,行走机构到待机点P1[{MoveInfo.MoveParam.PosInfo.GetPosSide()}面]");
XAxis_To_P1(); XAxis_To_P1();
MoveAxisToP1(); MoveAxisToP1();
recentOutstores.Push(MoveInfo.MoveParam.PosInfo.PosId); if (CheckASide())
LogInfo($"{recentOutstores}"); {
recentAOutstores.Push(MoveInfo.MoveParam.PosInfo.PosId);
LogInfo($"{recentAOutstores}");
}
else
{
recentBOutstores.Push(MoveInfo.MoveParam.PosInfo.PosId);
LogInfo($"{recentBOutstores}");
}
break; break;
case StepEnum.SO_19_InOutBackFromBuff: case StepEnum.SO_19_InOutBackFromBuff:
//出库料盘放置成功,将料盘信息写入对应出料口 //出库料盘放置成功,将料盘信息写入对应出料口
......
...@@ -118,14 +118,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -118,14 +118,15 @@ namespace OnlineStore.DeviceLibrary
BufferDataManager.BOutStoreInfo = MoveInfo.MoveParam.PosInfo.ToCopy(); BufferDataManager.BOutStoreInfo = MoveInfo.MoveParam.PosInfo.ToCopy();
BufferDataManager.AOutStoreInfo = MoveInfo.MoveParam.PosInfoBack.ToCopy(); BufferDataManager.AOutStoreInfo = MoveInfo.MoveParam.PosInfoBack.ToCopy();
} }
recentAOutstores.Push(BufferDataManager.AOutStoreInfo.PosId);
recentBOutstores.Push(BufferDataManager.BOutStoreInfo.PosId);
LogInfo($"{recentAOutstores}");
LogInfo($"{recentBOutstores}");
MoveInfo.NextMoveStep(StepEnum.SOB_20_Finish); MoveInfo.NextMoveStep(StepEnum.SOB_20_Finish);
BuffAreaOutstoreDoor(false); BuffAreaOutstoreDoor(false);
checkForkCnt = 0; checkForkCnt = 0;
ignoreCurFork = false; ignoreCurFork = false;
LogInfo($"出库 {MoveInfo.SLog}:关闭出料防护门,出库结束"); LogInfo($"出库 {MoveInfo.SLog}:关闭出料防护门,出库结束");
recentOutstores.Push(MoveInfo.MoveParam.PosInfo.PosId);
recentOutstores.Push(MoveInfo.MoveParam.PosInfoBack.PosId);
LogInfo($"{recentOutstores}");
break; break;
case StepEnum.SOB_20_Finish: case StepEnum.SOB_20_Finish:
SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing); SetBoxStatus(DeviceStatus.StoreOnline, RunStatus.Runing);
......
...@@ -1367,7 +1367,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -1367,7 +1367,8 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
private static object outStoreObject = new object(); private static object outStoreObject = new object();
FixedSizeStack<string> recentOutstores = new FixedSizeStack<string>(40); FixedSizeStack<string> recentAOutstores = new FixedSizeStack<string>(5);
FixedSizeStack<string> recentBOutstores = new FixedSizeStack<string>(5);
public bool StartExecuctOut(InOutParam param) public bool StartExecuctOut(InOutParam param)
{ {
bool result = false; bool result = false;
...@@ -1383,7 +1384,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1383,7 +1384,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + " 出库命令【" + param.PosInfo.ToStr() + "】重复,【" + MoveInfo.MoveParam.PosInfo.PosId + "】出库执行中"); LogUtil.error(Name + " 出库命令【" + param.PosInfo.ToStr() + "】重复,【" + MoveInfo.MoveParam.PosInfo.PosId + "】出库执行中");
return false; return false;
} }
if (recentOutstores.Contains(param.PosInfo.PosId)) if (recentAOutstores.Contains(param.PosInfo.PosId) || recentBOutstores.Contains(param.PosInfo.PosId))
{ {
LogUtil.error(Name + " 出库命令【" + param.PosInfo.ToStr() + "】重复,在最近的出库列表"); LogUtil.error(Name + " 出库命令【" + param.PosInfo.ToStr() + "】重复,在最近的出库列表");
return false; return false;
...@@ -1439,7 +1440,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1439,7 +1440,7 @@ namespace OnlineStore.DeviceLibrary
SetWarnMsg(Name + " 启动出库【" + param.PosInfo.ToStr() + "】出错,找不到库位信息"); SetWarnMsg(Name + " 启动出库【" + param.PosInfo.ToStr() + "】出错,找不到库位信息");
return false; return false;
} }
if (recentOutstores.Contains(param.PosInfo.PosId)) if (recentAOutstores.Contains(param.PosInfo.PosId) || recentBOutstores.Contains(param.PosInfo.PosId))
{ {
LogUtil.error(Name + " 出库命令【" + param.PosInfo.ToStr() + "】重复,在最近的出库列表"); LogUtil.error(Name + " 出库命令【" + param.PosInfo.ToStr() + "】重复,在最近的出库列表");
return false; return false;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!