Commit 34a0a4fb LN

1

1 个父辈 189c6b6c
...@@ -87,26 +87,84 @@ namespace OnlineStore.DeviceLibrary ...@@ -87,26 +87,84 @@ namespace OnlineStore.DeviceLibrary
{ {
return null; return null;
} }
TimeSpan span = DateTime.Now - trayInfo.LastUpdateTime;
int youxianS = 180;
InOutParam inoup = trayInfo.InoutPar; InOutParam inoup = trayInfo.InoutPar;
//入料失败料 //入料失败料
if (trayInfo.IsFull&&trayInfo.InoutPar.InStoreNg && this.Config.SidesWayNum.Equals(4)) if (trayInfo.IsFull && trayInfo.InoutPar.InStoreNg && this.Config.SidesWayNum.Equals(4))
{ {
return inoup; return inoup;
} }
else if (trayInfo.InOrOutStore.Equals(ReelType.OutStore) && inoup.urgentReel.Equals(false) && inoup.cutReel.Equals(false)) else if (trayInfo.InOrOutStore.Equals(ReelType.OutStore) && inoup.urgentReel.Equals(false) && inoup.cutReel.Equals(false))
{ {
//urgentReel: true 表示紧急料,需要出到料串上
//cutReel: true 表示分盘料,需要出到料串上
//smallReel: true 小料(7x8),放置到小料架上
//rfid: 分配的料架RFID
//rfidLoc:
//是否是小盘 //是否是小盘
if (inoup.smallReel && inoup.rfidLoc >= 70 && inoup.rfidLoc <= 72) if (inoup.smallReel)
{ {
if (DeviceID.Equals(203) || DeviceID.Equals(204))
if (inoup.rfidLoc >= 70 && inoup.rfidLoc <= 72)
{
// 70,71,72时只能分配到3 / 4号皮带线;
if (DeviceID.Equals(203) || DeviceID.Equals(204))
{
return inoup;
}
}
else if (span.TotalSeconds > youxianS || inoup.rfidLoc.Equals(-1))
{
//,值为 - 1时,可以自由分配皮带线,,超过指定时间后随机分配
if (MoveInfo.MoveType.Equals(LineMoveType.None))
{
return inoup;
}
}
else if (inoup.rfidLoc <= 46)
{
// 小料时,架位为1 - 46优先走1 / 2号皮带线
if (DeviceID.Equals(201) || DeviceID.Equals(202))
{
return inoup;
}
}
else if (inoup.rfidLoc >= 47)
{ {
return inoup; // ,47 - 92优先走3 / 4号皮带线,
if (DeviceID.Equals(203) || DeviceID.Equals(204))
{
return inoup;
}
} }
} }
else else
{ {
return inoup; // 料架的架位大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3 / 4号皮带线
} if (span.TotalSeconds > youxianS || inoup.rfidLoc.Equals(-1))
{
//,值为 - 1时,可以自由分配皮带线,
if (MoveInfo.MoveType.Equals(LineMoveType.None))
{
return inoup;
}
}
else if (inoup.rfidLoc <= 6)
{
if (DeviceID.Equals(201) || DeviceID.Equals(202))
{
return inoup;
}
}
else if (inoup.rfidLoc >= 7)
{
if (DeviceID.Equals(203) || DeviceID.Equals(204))
{
return inoup;
}
}
}
} }
//TODO 判断是否是需要移栽出料的料盘 //TODO 判断是否是需要移栽出料的料盘
...@@ -179,7 +237,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -179,7 +237,7 @@ namespace OnlineStore.DeviceLibrary
{ {
SecondMoveInfo.MoveParam = param; SecondMoveInfo.MoveParam = param;
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_05_WaitTime); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_05_WaitTime);
CheckLog("托盘阻挡需要出库" + SecondMoveInfo.SLog + ":" + param.ToStr() + " 等待1秒后顶升上升 )"); CheckLog("托盘 【" + currTrayNum + "】需要出库" + SecondMoveInfo.SLog + ":" + param.ToStr() + " 等待1秒后顶升上升 )");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitProvidingEquipCanOut());//等待 SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitProvidingEquipCanOut());//等待
......
...@@ -67,7 +67,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -67,7 +67,7 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
public static TrayInfo GetTrayInfo(int trayNum) public static TrayInfo GetTrayInfo(int trayNum)
{ {
if (TrayInfoMap.ContainsKey(trayNum)) if (TrayInfoMap.ContainsKey(trayNum))
{ {
...@@ -79,17 +79,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -79,17 +79,13 @@ namespace OnlineStore.DeviceLibrary
} }
public static void UpdateTrayInfo(int trayNum, bool isFull = false, int inOrOut = 0, InOutParam param=null,string ngMsg="") public static void UpdateTrayInfo(int trayNum, bool isFull = false, int inOrOut = 0, InOutParam param = null, string ngMsg = "")
{ {
if (TrayInfoMap.ContainsKey(trayNum)) if (TrayInfoMap.ContainsKey(trayNum))
{ {
TrayInfoMap[trayNum].IsFull = isFull; TrayInfoMap[trayNum].IsFull = isFull;
TrayInfoMap[trayNum].InOrOutStore = inOrOut; TrayInfoMap[trayNum].InOrOutStore = inOrOut;
TrayInfoMap[trayNum].LastUpdateTime = DateTime.Now;
//TrayInfoMap[trayNum].WareCode = wareCode;
//TrayInfoMap[trayNum].PosId = posId;
//TrayInfoMap[trayNum].PlateH = plateH;
//TrayInfoMap[trayNum].PlateW = plateW;
if (param == null) if (param == null)
{ {
param = new InOutParam(); param = new InOutParam();
...@@ -111,17 +107,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -111,17 +107,9 @@ namespace OnlineStore.DeviceLibrary
{ {
TrayInfoMap[trayNum].InoutPar.InStoreNg = isNg; TrayInfoMap[trayNum].InoutPar.InStoreNg = isNg;
TrayInfoMap[trayNum].ShowMsg = msg; TrayInfoMap[trayNum].ShowMsg = msg;
TrayInfoMap[trayNum].LastUpdateTime = DateTime.Now;
} }
} }
//internal static void UpdateEmergencyOut(int trayNum, bool isEmp)
//{
// LogUtil.info("更新托盘【" + trayNum + "】EmergencyOut=【" + isEmp + "】 ");
// if (TrayInfoMap.ContainsKey(trayNum))
// {
// TrayInfoMap[trayNum].EmergencyOut = isEmp;
// }
//}
/// <summary> /// <summary>
/// 是否还有有料仓的盘 /// 是否还有有料仓的盘
...@@ -182,13 +170,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -182,13 +170,9 @@ namespace OnlineStore.DeviceLibrary
{ {
TrayInfoMap = new ConcurrentDictionary<int, TrayInfo>(); TrayInfoMap = new ConcurrentDictionary<int, TrayInfo>();
} }
#region 横移状态缓存
#region 横移状态缓存
internal static bool LineCanMoveSW(int swNum) internal static bool LineCanMoveSW(int swNum)
{ {
//若此横移对应的设备未启动,直接可处理 //若此横移对应的设备未启动,直接可处理
foreach (FeedingEquip equip in LineManager.Line.FeedingEquipMap.Values) foreach (FeedingEquip equip in LineManager.Line.FeedingEquipMap.Values)
{ {
...@@ -222,10 +206,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -222,10 +206,8 @@ namespace OnlineStore.DeviceLibrary
} }
return false; return false;
} }
#endregion #endregion
public static bool checkWatch(Stopwatch watch, int targetMs, bool isStop = true) public static bool checkWatch(Stopwatch watch, int targetMs, bool isStop = true)
{ {
if (!watch.IsRunning) if (!watch.IsRunning)
{ {
...@@ -239,10 +221,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -239,10 +221,6 @@ namespace OnlineStore.DeviceLibrary
} }
return false; return false;
} }
} }
} }
using System; using OnlineStore.Common;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
...@@ -10,35 +11,23 @@ namespace OnlineStore.DeviceLibrary ...@@ -10,35 +11,23 @@ namespace OnlineStore.DeviceLibrary
/// 托盘信息 /// 托盘信息
/// </summary> /// </summary>
public class TrayInfo public class TrayInfo
{ {
//public TrayInfo(int trayNum, bool isFull = false, int inOrOut = 0)
//{
// this.TrayCode = trayNum;
// this.IsFull = isFull;
// this.InOrOutStore = inOrOut;
//}
public TrayInfo(int trayNum, bool isFull, int inOrOut = 0, InOutParam inoutParam = null) public TrayInfo(int trayNum, bool isFull, int inOrOut = 0, InOutParam inoutParam = null)
{ {
this.TrayCode = trayNum; this.TrayCode = trayNum;
this.IsFull = isFull; this.IsFull = isFull;
this.InOrOutStore = inOrOut; this.InOrOutStore = inOrOut;
//this.WareCode = wareCode;
//this.PosId = posId;
//this.PlateH = plateH;
//this.PlateW = plateW;
if (inoutParam == null) if (inoutParam == null)
{ {
inoutParam = new InOutParam(); inoutParam = new InOutParam();
} }
this.inoutPar = inoutParam; this.inoutPar = inoutParam;
// InStoreNG = false;
ShowMsg = ""; ShowMsg = "";
} }
public string ToStr() public string ToStr()
{ {
string type = "无操作"; string type = "无操作";
if (InOrOutStore.Equals(1)) if (InOrOutStore.Equals(1))
{ {
type = inoutPar.InStoreNg ? "[入料失败:" + ShowMsg + "]" : "入料" + "[" + inoutPar.ToStr() + "]"; type = inoutPar.InStoreNg ? "[入料失败:" + ShowMsg + "]" : "入料" + "[" + inoutPar.ToStr() + "]";
...@@ -50,7 +39,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -50,7 +39,7 @@ namespace OnlineStore.DeviceLibrary
//return "托盘 [" + TrayCode + "] [" + (IsFull ? "有料" : "空") +"] ["+ type + //return "托盘 [" + TrayCode + "] [" + (IsFull ? "有料" : "空") +"] ["+ type +
// "]二维码[" + WareCode + "]库位号[" + PosId + "] [" + PlateW + "X" + PlateH+ "] " + err + " "+ jinji + "" ; // "]二维码[" + WareCode + "]库位号[" + PosId + "] [" + PlateW + "X" + PlateH+ "] " + err + " "+ jinji + "" ;
return "托盘 [" + TrayCode + "] [" + (IsFull ? "有料" : "空") + "] [" + type + "]"; return "托盘 [" + TrayCode + "] [" + FormUtil.GetSpanStr(DateTime.Now - LastUpdateTime) + "] [" + (IsFull ? "有料" : "空") + "] [" + type + "]";
} }
/// <summary> /// <summary>
/// 夹具编码值(1-32?) /// 夹具编码值(1-32?)
...@@ -64,30 +53,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -64,30 +53,10 @@ namespace OnlineStore.DeviceLibrary
/// 出库还是入库(有料盘时才有此操作)0=无操作,1=入库,2=出库 /// 出库还是入库(有料盘时才有此操作)0=无操作,1=入库,2=出库
/// </summary> /// </summary>
public int InOrOutStore = 0; public int InOrOutStore = 0;
///// <summary>
///// 物品二维码信息
///// </summary>
//public string WareCode = "";
///// <summary>
///// 位置名(对应配置表的位置)
///// </summary>
//public string PosId = "";
///// <summary>
///// 料盘高度
///// </summary>
//public int PlateH = 0;
///// <summary>
///// 料盘宽度
///// </summary>
//public int PlateW = 0;
/// <summary>
/// 入库失败料盘,未扫到码或获取库位号失败
/// </summary>
// public bool InStoreNG = false;
public string ShowMsg = ""; public string ShowMsg = "";
//public bool EmergencyOut = false; public DateTime LastUpdateTime = DateTime.Now;
private InOutParam inoutPar = null; private InOutParam inoutPar = null;
public InOutParam InoutPar public InOutParam InoutPar
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!