Commit e14fa838 LN

托盘纠正问题修改。

1 个父辈 5b068608
......@@ -345,47 +345,55 @@ namespace OnlineStore.DeviceLibrary
{
if (LineManager.useTrayCheck.Contains(DeviceID))
{
bool isfull = TrayManager.GetTrayInfo(currTrayNum).IsFull;
if (Config.SidesWayNum <= 0)
TrayInfo tray = TrayManager.GetTrayInfo(currTrayNum);
bool isfull = tray.IsFull;
if (tray!=null&& tray.InoutPar.Corrected)
{
LogInfo(SecondMoveInfo.MoveNum + SecondMoveInfo.SLog + " 入库中,需拦截空托盘【 " + currTrayNum + "】托盘已纠正,不再验证料盘检测信号");
}
else
{
if (CylinderIsOk(IO_Type.FL_TopCylinder_Down, IO_Type.FL_TopCylinder_Up))
if (Config.SidesWayNum <= 0)
{
if (CylinderIsOk(IO_Type.FL_TopCylinder_Down, IO_Type.FL_TopCylinder_Up))
{
if ((!isfull) && IOValue(IO_Type.ReelCheck).Equals(IO_VALUE.HIGH))
{
ConfigIO io = Config.getWaitIO(IO_Type.ReelCheck);
if (io != null)
{
LogInfo("当前托盘上的料盘检测信号[" + io.ConfigStr + "]的值:" + IOValue(IO_Type.ReelCheck));
}
LogInfo(SecondMoveInfo.MoveNum + SecondMoveInfo.SLog + " 入库中,需拦截空托盘【 " + currTrayNum + "】,空托盘料盘检测信号亮,禁用托盘,暂时放托盘离开");
TrayDisableManager.AddDisable(currTrayNum, Name, "空托盘料盘检测信号亮", 2);
TrayMoveOk();
return;
}
}
}
else if (CylinderIsOk(IO_Type.SW_TopCylinder_Down, IO_Type.SW_TopCylinder_Up) && IOValue(IO_Type.ReelCheck).Equals(IO_VALUE.HIGH))
{
if ((!isfull) && IOValue(IO_Type.ReelCheck).Equals(IO_VALUE.HIGH))
{
LogInfo(SecondMoveInfo.MoveNum + SecondMoveInfo.SLog + " 入库中,需拦截空托盘【 " + currTrayNum + "】,空托盘料盘检测信号亮,禁用托盘,暂时放托盘离开");
TrayDisableManager.AddDisable(currTrayNum, Name, "空托盘料盘检测信号亮", 2);
TrayMoveOk();
return;
}
else if (isfull && IOValue(IO_Type.ReelCheck).Equals(IO_VALUE.LOW))
{
ConfigIO io = Config.getWaitIO(IO_Type.ReelCheck);
if (io != null)
{
LogInfo("当前托盘上的料盘检测信号[" + io.ConfigStr + "]的值:" + IOValue(IO_Type.ReelCheck));
}
LogInfo(SecondMoveInfo.MoveNum + SecondMoveInfo.SLog + " 入库中,需拦截空托盘【 " + currTrayNum + "】,空托盘料盘检测信号亮,禁用托盘,暂时放托盘离开");
TrayDisableManager.AddDisable(currTrayNum, Name, "空托盘料盘检测信号亮",2);
LogInfo(SecondMoveInfo.MoveNum + SecondMoveInfo.SLog + " 需拦截有料托盘【 " + currTrayNum + "】,有料托盘料盘检测信号不亮,禁用托盘,暂时放托盘离开");
TrayDisableManager.AddDisable(currTrayNum, Name, "有料托盘料盘检测信号不亮", 1);
TrayMoveOk();
return;
}
}
}
else if (CylinderIsOk(IO_Type.SW_TopCylinder_Down, IO_Type.SW_TopCylinder_Up) && IOValue(IO_Type.ReelCheck).Equals(IO_VALUE.HIGH))
{
if ((!isfull) && IOValue(IO_Type.ReelCheck).Equals(IO_VALUE.HIGH))
{
LogInfo(SecondMoveInfo.MoveNum + SecondMoveInfo.SLog + " 入库中,需拦截空托盘【 " + currTrayNum + "】,空托盘料盘检测信号亮,禁用托盘,暂时放托盘离开");
TrayDisableManager.AddDisable(currTrayNum, Name, "空托盘料盘检测信号亮",2);
TrayMoveOk();
return;
}
else if (isfull && IOValue(IO_Type.ReelCheck).Equals(IO_VALUE.LOW))
{
ConfigIO io = Config.getWaitIO(IO_Type.ReelCheck);
if (io != null)
{
LogInfo("当前托盘上的料盘检测信号[" + io.ConfigStr + "]的值:" + IOValue(IO_Type.ReelCheck));
}
LogInfo(SecondMoveInfo.MoveNum + SecondMoveInfo.SLog + " 需拦截有料托盘【 " + currTrayNum + "】,有料托盘料盘检测信号不亮,禁用托盘,暂时放托盘离开");
TrayDisableManager.AddDisable(currTrayNum, Name, "有料托盘料盘检测信号不亮",1);
TrayMoveOk();
return;
}
}
}
SecondMoveInfo.NextMoveStep(LineMoveStep.MO_11_CodeRember);
LogInfo(SecondMoveInfo.MoveNum + SecondMoveInfo.SLog + "*************** 托盘号【" + currTrayNum + "】 ,需要入料,移栽料盘");
......
......@@ -378,21 +378,28 @@ namespace OnlineStore.DeviceLibrary
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.MI_02_TopUP))
{
{
TrayInfo tray = TrayManager.GetTrayInfo(currTrayNum);
bool needCheck = (tray == null || (!tray.InoutPar.Corrected));
if (!needCheck)
{
LogInfo("入库 [" + posId + "]" + MoveInfo.SLog + ": 托盘【 " + currTrayNum + "】托盘已纠正,不再验证料盘检测信号");
}
//判断料盘检测信号是否正确
if (CylinderIsOk(IO_Type.TopCylinder_Down, IO_Type.TopCylinder_UP) &&
if (needCheck&&
CylinderIsOk(IO_Type.TopCylinder_Down, IO_Type.TopCylinder_UP) &&
LineManager.useTrayCheck.Contains(DeviceID) &&
IOValue(IO_Type.TrayCheck).Equals(IO_VALUE.LOW))
{
ConfigIO io = Config.getWaitIO(IO_Type.TrayCheck);
if (io != null)
{
LogInfo("当前托盘上的料盘检测信号[" + io.ConfigStr + "]的值:" + IOValue(IO_Type.TrayCheck));
}
LogUtil.error(Name + "入库 [" + posId + "],托盘【 " + currTrayNum + "】,有料托盘料盘检测信号不亮,升降轴上升,禁用托盘,同时放行托盘");
LogInfo("入库 [" + posId + "]" + MoveInfo.SLog + ": 升降轴上升,禁用托盘,同时放行托盘,顶升气缸1下降");
TrayDisableManager.AddDisable(currTrayNum, Name, "有料托盘料盘检测信号不亮",1);
MI_18_UpdownUp();
{
ConfigIO io = Config.getWaitIO(IO_Type.TrayCheck);
if (io != null)
{
LogInfo("当前托盘上的料盘检测信号[" + io.ConfigStr + "]的值:" + IOValue(IO_Type.TrayCheck));
}
LogUtil.error(Name + "入库 [" + posId + "],托盘【 " + currTrayNum + "】,有料托盘料盘检测信号不亮,升降轴上升,禁用托盘,同时放行托盘");
LogInfo("入库 [" + posId + "]" + MoveInfo.SLog + ": 升降轴上升,禁用托盘,同时放行托盘,顶升气缸1下降");
TrayDisableManager.AddDisable(currTrayNum, Name, "有料托盘料盘检测信号不亮", 1);
MI_18_UpdownUp();
}
else
{
......@@ -641,8 +648,14 @@ namespace OnlineStore.DeviceLibrary
{
if (isFull.Equals(false))
{
TrayInfo tray = TrayManager.GetTrayInfo(currTrayNum);
bool needCheck = (tray == null || (!tray.InoutPar.Corrected));
if (!needCheck)
{
LogInfo("出库中,拦截空托盘【 " + currTrayNum + "】托盘已纠正,不再验证料盘检测信号");
}
//顶升上升时才判断
if (CylinderIsOk(IO_Type.TopCylinder_Down, IO_Type.TopCylinder_UP) &&
if (needCheck&& CylinderIsOk(IO_Type.TopCylinder_Down, IO_Type.TopCylinder_UP) &&
LineManager.useTrayCheck.Contains(DeviceID) &&
IOValue(IO_Type.TrayCheck).Equals(IO_VALUE.HIGH))
{
......@@ -725,7 +738,13 @@ namespace OnlineStore.DeviceLibrary
}
if (reIndex >= 0)
{
if (CylinderIsOk(IO_Type.TopCylinder_Down, IO_Type.TopCylinder_UP) &&
TrayInfo tray = TrayManager.GetTrayInfo(currTrayNum);
bool needCheck = (tray == null || (!tray.InoutPar.Corrected));
if (!needCheck)
{
LogInfo("入库需拦截有料托盘【 " + currTrayNum + "】托盘已纠正,不再验证料盘检测信号");
}
if (needCheck&& CylinderIsOk(IO_Type.TopCylinder_Down, IO_Type.TopCylinder_UP) &&
LineManager.useTrayCheck.Contains(DeviceID) &&
IOValue(IO_Type.TrayCheck).Equals(IO_VALUE.LOW))
{
......
......@@ -190,7 +190,8 @@ namespace OnlineStore.DeviceLibrary
tray.InoutPar.PlateH = task.plateH;
tray.InoutPar.PlateW = task.plateW;
TrayManager.UpdateTrayInfo(trayNum, true, tray.InOrOutStore, tray.InoutPar);
tray.InoutPar.Corrected = true;
TrayManager.UpdateTrayCorrected(trayNum, true);
//tray.InoutPar.Corrected = true;
LogUtil.info($"【屏蔽料盘二次判断】【100】【有尺寸信息,认为NG】【{tray.ToStr()}】");
}
else if (resCode == 0)
......@@ -214,7 +215,8 @@ namespace OnlineStore.DeviceLibrary
{
SServerManager.SendPosToStoreCheck(Name, tray.InoutPar);
}
tray.InoutPar.Corrected = true;
TrayManager.UpdateTrayCorrected(trayNum, true);
//tray.InoutPar.Corrected = true;
LogUtil.info($"【屏蔽料盘二次判断】【初次有料,第二次有料,认为有料】【{tray.ToStr()}】");
}
}
......@@ -228,7 +230,8 @@ namespace OnlineStore.DeviceLibrary
TrayManager.ClearInstore(tray, "【屏蔽料盘二次判断】【初次有料,第二次无料】【清空托盘】[" + trayNum + "]");
}
TrayManager.UpdateTrayInfo(trayNum);
tray.InoutPar.Corrected = true;
TrayManager.UpdateTrayCorrected(trayNum, true);
// tray.InoutPar.Corrected = true;
LogUtil.info($"【屏蔽料盘二次判断】【初次有料,第二次无料】【清空托盘】【{tray.ToStr()}】");
}
}
......@@ -248,7 +251,8 @@ namespace OnlineStore.DeviceLibrary
tray.InoutPar.PlateH = task.plateH;
tray.InoutPar.PlateW = task.plateW;
TrayManager.UpdateTrayInfo(trayNum, true, tray.InOrOutStore, tray.InoutPar);
tray.InoutPar.Corrected = true;
TrayManager.UpdateTrayCorrected(trayNum, true);
//tray.InoutPar.Corrected = true;
LogUtil.info($"【屏蔽料盘二次判断】【100】【有尺寸信息,认为NG】【{tray.ToStr()}】");
}
else if (resCode == 0)
......@@ -267,7 +271,8 @@ namespace OnlineStore.DeviceLibrary
tray.InoutPar.rfidLoc = task.rfidLoc;
tray.InoutPar.ManualJudgeNG = false;
TrayManager.UpdateTrayInfo(trayNum, true, tray.InOrOutStore, tray.InoutPar);
tray.InoutPar.Corrected = true;
TrayManager.UpdateTrayCorrected(trayNum, true);
//tray.InoutPar.Corrected = true;
LogUtil.info($"【屏蔽料盘二次判断】【初次无料,第二次有料】【纠正为有料】【{tray.ToStr()}】");
}
}
......@@ -279,7 +284,8 @@ namespace OnlineStore.DeviceLibrary
TrayManager.ClearInstore(tray, "【屏蔽料盘二次判断】【初次无料,第二次无料】【清空托盘】[" + trayNum + "]");
}
TrayManager.UpdateTrayInfo(trayNum);
tray.InoutPar.Corrected = true;
TrayManager.UpdateTrayCorrected(trayNum, true);
//tray.InoutPar.Corrected = true;
LogUtil.info($"【屏蔽料盘二次判断】【初次无料,第二次无料】【清空托盘】【{tray.ToStr()}】");
}
}
......
......@@ -120,6 +120,16 @@ namespace OnlineStore.DeviceLibrary
SaveMapToFile();
}
public static void UpdateTrayCorrected(int trayNum, bool Corrected)
{
LogUtil.info("更新托盘【" + trayNum + "】Corrected=【" + Corrected + "】 ");
if (TrayInfoMap.ContainsKey(trayNum))
{
TrayInfoMap[trayNum].InoutPar.Corrected = Corrected;
TrayInfoMap[trayNum].LastUpdateTime = DateTime.Now;
SaveMapToFile();
}
}
public static void UpdateInStoreNG(int trayNum, bool isNg, string msg)
{
LogUtil.info("更新托盘【" + trayNum + "】InStoreNG=【" + isNg + "】NgMsg=【" + msg + "】");
......
......@@ -32,6 +32,8 @@ namespace OnlineStore.DeviceLibrary
this.smallReel = smallReel;
this.rfid = rfid;
this.rfidLoc = rfidLoc;
this.Corrected = false;
this.ManualJudgeNG = false;
}
/// <summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!