Commit b8bc7b17 LN

出料料架修改,增加 realRfid ,表示真实的料架号

1 个父辈 e404a5c7
此文件类型无法预览
...@@ -273,7 +273,12 @@ ...@@ -273,7 +273,12 @@
</member> </member>
<member name="P:Asa.Client2.SendLog"> <member name="P:Asa.Client2.SendLog">
<summary> <summary>
仅发送命令的代码日志 发送命令的日志是否打印,不影响其他日志
</summary>
</member>
<member name="P:Asa.Client2.SendSleep">
<summary>
发送命令的时间间隔(单位:秒)
</summary> </summary>
</member> </member>
<member name="M:Asa.Client2.Connect"> <member name="M:Asa.Client2.Connect">
......
...@@ -353,12 +353,17 @@ namespace OnlineStore.ACPackingStore ...@@ -353,12 +353,17 @@ namespace OnlineStore.ACPackingStore
Process[] processes = Process.GetProcesses(); Process[] processes = Process.GetProcesses();
long totalMemery = 0; long totalMemery = 0;
StringBuilder sbResult = new StringBuilder(); StringBuilder sbResult = new StringBuilder();
int interval = 1000;
var prevCpuTime = TimeSpan.Zero;
foreach (Process process in processes) foreach (Process process in processes)
{ {
if (process.ProcessName.EndsWith("ACPackingStore")) if (process.ProcessName.EndsWith("ACPackingStore"))
{ {
sbResult.AppendFormat(DateTime.Now.ToLongTimeString() + ", 名称:{0} 内存大小:{1}M ", process.ProcessName, process.PrivateMemorySize64 / 1024 / 1024F); sbResult.AppendFormat(DateTime.Now.ToLongTimeString() + ", 名称:{0} 内存大小:{1}M ", process.ProcessName, process.PrivateMemorySize64 / 1024 / 1024F);
totalMemery += process.PrivateMemorySize64 / 1024; totalMemery += process.PrivateMemorySize64 / 1024;
double value = (process.TotalProcessorTime - prevCpuTime).TotalMilliseconds / interval / Environment.ProcessorCount ;
sbResult.AppendFormat(" CPU : " +Math.Round(value,2) + "%");
// string result = string.Format("进程总数 {0} 个,共占内存:{1}MB \n", processes.Length, totalMemery / 1024) + sbResult.ToString(); // string result = string.Format("进程总数 {0} 个,共占内存:{1}MB \n", processes.Length, totalMemery / 1024) + sbResult.ToString();
LogUtil.info(sbResult.ToString()); LogUtil.info(sbResult.ToString());
} }
......
...@@ -80,6 +80,8 @@ agv客户端启动时需要设置状态为none。 ...@@ -80,6 +80,8 @@ agv客户端启动时需要设置状态为none。
20200225 20200225
出库送料架逻辑修改,出库增加参数:taskCount 出库送料架逻辑修改,出库增加参数:taskCount
20200228
出料料架修改,增加 realRfid ,表示真实的料架号
......
...@@ -232,5 +232,9 @@ namespace OnlineStore.Common ...@@ -232,5 +232,9 @@ namespace OnlineStore.Common
///当前料放完,料架已满,也把料架放出去 ///当前料放完,料架已满,也把料架放出去
/// </summary> /// </summary>
public static string taskCount = "taskCount"; public static string taskCount = "taskCount";
/// <summary>
/// 真实料架号,可能为空
/// </summary>
public static string realRfid = "realRfid";
} }
} }
...@@ -811,7 +811,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -811,7 +811,7 @@ namespace OnlineStore.DeviceLibrary
if (MoveInfo.MoveStep == StoreMoveStep.SO_01_DeviceBack) if (MoveInfo.MoveStep == StoreMoveStep.SO_01_DeviceBack)
{ {
//判断是否需要送出料架,是否需要进入料架,是否可以直接开始 //判断是否需要送出料架,是否需要进入料架,是否可以直接开始
if (CurrShelfID.Equals("")) if (MoveInfo.MoveParam.rfid.Equals(""))
{ {
SO_03_ToBagPosition(); SO_03_ToBagPosition();
} }
...@@ -827,22 +827,25 @@ namespace OnlineStore.DeviceLibrary ...@@ -827,22 +827,25 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.HIGH))
{ {
if (IsRightShelfId(CurrShelfID, MoveInfo.MoveParam.rfid)) if (IsRightShelfId(CurrShelfID, MoveInfo.MoveParam.realRfid))
{ {
LogUtil.error("入库,当前料架【" + CurrShelfID + "】和目标料架【" + MoveInfo.MoveParam.rfid + "," + MoveInfo.MoveParam.realRfid + "】 是同一个料架,开始取料");
SO_03_ToBagPosition(); SO_03_ToBagPosition();
return;
} }
else else
{ {
LogUtil.error("入库,当前料架【" + CurrShelfID + "】和目标料架【" + MoveInfo.MoveParam.rfid + "】不是同一个料架,送出当前料架,稍后重新出库"); LogUtil.error("入库,当前料架【" + CurrShelfID + "】和目标料架【" + MoveInfo.MoveParam.rfid + "," + MoveInfo.MoveParam.realRfid + "】不是同一个料架,送出当前料架,稍后重新出库");
//送出料架,并且记录出库信息,等会重新出库 //送出料架,并且记录出库信息,等会重新出库
StartShelfOut(); StartShelfOut();
//重新记录 //重新记录
LogInfo(" 执行出库【" + MoveInfo.MoveParam.ToStr() + "】失败,料架号不一致,加入等待队列"); LogInfo(" 执行出库【" + MoveInfo.MoveParam.ToStr() + "】失败,料架号不一致,加入等待队列");
waitOutStoreList.Enqueue(MoveInfo.MoveParam); waitOutStoreList.Enqueue(MoveInfo.MoveParam);
return;
} }
} }
else if ((IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW) && MoveInfo.MoveParam.NeedEnterShelf) || (!MoveInfo.MoveParam.ShelfPosID.Equals(""))) else if (IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW) && (!MoveInfo.MoveParam.rfid.Equals("")))
{ {
string rfid = MoveInfo.MoveParam.rfid; string rfid = MoveInfo.MoveParam.rfid;
MoveInfo.NextMoveStep(StoreMoveStep.BI_00_ReadyShelf); MoveInfo.NextMoveStep(StoreMoveStep.BI_00_ReadyShelf);
...@@ -1028,25 +1031,33 @@ namespace OnlineStore.DeviceLibrary ...@@ -1028,25 +1031,33 @@ namespace OnlineStore.DeviceLibrary
} }
} }
private bool IsRightShelfId(string currShelfID, string rfid) private bool IsRightShelfId(string currShelfID, string realRfid)
{ {
if (String.IsNullOrEmpty(currShelfID) || String.IsNullOrEmpty(rfid)) if (String.IsNullOrEmpty(currShelfID) )
{ {
return true ; return false ;
} }
if ( String.IsNullOrEmpty(realRfid))
string theTarget = rfid.Trim().PadLeft(3, '0');
string num = theTarget.Substring(0, 2);
string type = theTarget.Substring(2, 1);
if (currShelfID.Equals(type + num))
{ {
return true; return true ;
} }
else if (num.Equals("00"))
if (currShelfID.Equals(realRfid))
{ {
return true; return true;
} }
//string theTarget = realRfid.Trim().PadLeft(3, '0');
//string num = theTarget.Substring(0, 2);
//string type = theTarget.Substring(2, 1);
//if (currShelfID.Equals(type + num))
//{
// return true;
//}
//else if (num.Equals("00"))
//{
// return true;
//}
return false; return false;
} }
......
...@@ -4,6 +4,7 @@ using OnlineStore.LoadCSVLibrary; ...@@ -4,6 +4,7 @@ using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading; using System.Threading;
...@@ -210,6 +211,35 @@ namespace OnlineStore.DeviceLibrary ...@@ -210,6 +211,35 @@ namespace OnlineStore.DeviceLibrary
} }
return mark; return mark;
} }
private void LogCPU()
{
try
{
Process[] processes = Process.GetProcesses();
long totalMemery = 0;
StringBuilder sbResult = new StringBuilder();
int interval = 1000;
var prevCpuTime = TimeSpan.Zero;
foreach (Process process in processes)
{
if (process.ProcessName.EndsWith("ACPackingStore"))
{
sbResult.AppendFormat(DateTime.Now.ToLongTimeString() + Name+ ", 名称:{0} 内存大小:{1}M ", process.ProcessName, process.PrivateMemorySize64 / 1024 / 1024F);
totalMemery += process.PrivateMemorySize64 / 1024;
double value = (process.TotalProcessorTime - prevCpuTime).TotalMilliseconds / interval / Environment.ProcessorCount;
sbResult.AppendFormat(" CPU : " + Math.Round(value, 2) + "%");
// string result = string.Format("进程总数 {0} 个,共占内存:{1}MB \n", processes.Length, totalMemery / 1024) + sbResult.ToString();
LogUtil.info(sbResult.ToString());
}
}
}
catch (Exception ex)
{
LogUtil.error("LogM Error: " + ex.ToString());
}
}
private void ShelfOutProcess() private void ShelfOutProcess()
{ {
string moveName = "送出空料架"; string moveName = "送出空料架";
...@@ -219,7 +249,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -219,7 +249,7 @@ namespace OnlineStore.DeviceLibrary
{ {
moveName = "送出出库料架"; moveName = "送出出库料架";
} }
LogCPU();
if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_01_TopDown)) if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_01_TopDown))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BS_02_LocatinDown); MoveInfo.NextMoveStep(StoreMoveStep.BS_02_LocatinDown);
...@@ -516,6 +546,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -516,6 +546,7 @@ namespace OnlineStore.DeviceLibrary
string rfid = data.ContainsKey(ParamDefine.rfid) ? data[ParamDefine.rfid] : ""; string rfid = data.ContainsKey(ParamDefine.rfid) ? data[ParamDefine.rfid] : "";
int rfidLoc = FormUtil.GetIntData(data, ParamDefine.rfidLoc); int rfidLoc = FormUtil.GetIntData(data, ParamDefine.rfidLoc);
string barcode = data.ContainsKey(ParamDefine.barcode) ? data[ParamDefine.barcode] : ""; string barcode = data.ContainsKey(ParamDefine.barcode) ? data[ParamDefine.barcode] : "";
string realRfid = data.ContainsKey(ParamDefine.realRfid) ? data[ParamDefine.realRfid] : "";
int taskCount = FormUtil.GetIntData(data,ParamDefine.taskCount,0); int taskCount = FormUtil.GetIntData(data,ParamDefine.taskCount,0);
//urgentReel: true 表示紧急料,需要出到料串上 //urgentReel: true 表示紧急料,需要出到料串上
...@@ -533,7 +564,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -533,7 +564,7 @@ namespace OnlineStore.DeviceLibrary
index++; index++;
string plateW = plateWArray[index]; string plateW = plateWArray[index];
string plateH = plateHArray[index]; string plateH = plateHArray[index];
InOutParam inoutParam = new InOutParam(barcode, posId, "", plateW, plateH, urgentReel, cutReel, smallReel, rfid, rfidLoc, taskCount); InOutParam inoutParam = new InOutParam(barcode, posId, "", plateW, plateH, urgentReel, cutReel, smallReel, rfid, rfidLoc, taskCount, realRfid);
//根据发送的posId获取位置列表 //根据发送的posId获取位置列表
ACBoxPosition position = CSVPositionReader<ACBoxPosition>.GetPositon(posId); ACBoxPosition position = CSVPositionReader<ACBoxPosition>.GetPositon(posId);
if (position == null) if (position == null)
......
...@@ -33,13 +33,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -33,13 +33,14 @@ namespace OnlineStore.DeviceLibrary
agvClient.Ready += AgvClient_Ready; agvClient.Ready += AgvClient_Ready;
agvClient.CloseDoor += AgvClient_CloseDoor; agvClient.CloseDoor += AgvClient_CloseDoor;
agvClient.EnterShelf += AgvClient_EnterShelf; agvClient.EnterShelf += AgvClient_EnterShelf;
agvClient.SendLog = true;
} }
actionMap = new Dictionary<string, Asa.ClientAction>(); actionMap = new Dictionary<string, Asa.ClientAction>();
//foreach (string key in NodeList) //foreach (string key in NodeList)
//{ //{
// actionMap.Add(key, Asa.ClientAction.None); // actionMap.Add(key, Asa.ClientAction.None);
//} //}
agvClient.SendSleep = 10;
agvClient.Connect(); agvClient.Connect();
foreach (string str in NodeList) foreach (string str in NodeList)
{ {
......
...@@ -21,7 +21,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -21,7 +21,7 @@ namespace OnlineStore.DeviceLibrary
this.WareCode = ""; this.WareCode = "";
MoveP = null; MoveP = null;
} }
public InOutParam(string wareNo, string posId, string ShelfPosID, string platew = "", string plateh = "", bool urgentReel = false, bool cutReel = false, bool smallReel = false, string rfid = "", int rfidLoc = 0,int taskCount=0) public InOutParam(string wareNo, string posId, string ShelfPosID, string platew = "", string plateh = "", bool urgentReel = false, bool cutReel = false, bool smallReel = false, string rfid = "", int rfidLoc = 0,int taskCount=0,string realRfid="")
{ {
this.ShelfPosID = ShelfPosID; this.ShelfPosID = ShelfPosID;
WareCode = wareNo; WareCode = wareNo;
...@@ -35,6 +35,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -35,6 +35,7 @@ namespace OnlineStore.DeviceLibrary
this.rfid = rfid; this.rfid = rfid;
this.rfidLoc = rfidLoc; this.rfidLoc = rfidLoc;
this.taskCount = taskCount; this.taskCount = taskCount;
this.realRfid = realRfid;
} }
public InOutParam(string wareNo, string posId, string ShelfPosID,LineMoveP linePosition ) public InOutParam(string wareNo, string posId, string ShelfPosID,LineMoveP linePosition )
{ {
...@@ -50,6 +51,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -50,6 +51,8 @@ namespace OnlineStore.DeviceLibrary
this.rfid = ""; this.rfid = "";
this.rfidLoc = 0; this.rfidLoc = 0;
this.taskCount = 0; this.taskCount = 0;
this.realRfid = "";
} }
/// <summary> /// <summary>
/// 物品二维码信息 /// 物品二维码信息
...@@ -115,6 +118,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -115,6 +118,10 @@ namespace OnlineStore.DeviceLibrary
public int taskCount { get; set; } public int taskCount { get; set; }
/// <summary> /// <summary>
/// 真实料架号
/// </summary>
public string realRfid { get; set; }
/// <summary>
/// 根据PosId获取对应的料仓ID,若PosId=="",返回-1 /// 根据PosId获取对应的料仓ID,若PosId=="",返回-1
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!