Commit 6565a536 LN

入库通知增加日志。

1 个父辈 8f0c4992
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
namespace OnlineStore.Common namespace OnlineStore.Common
{ {
...@@ -71,6 +71,26 @@ namespace OnlineStore.Common ...@@ -71,6 +71,26 @@ namespace OnlineStore.Common
/// 报警集合 /// 报警集合
/// </summary> /// </summary>
public List<AlarmInfo> alarmList = new List<AlarmInfo>(); public List<AlarmInfo> alarmList = new List<AlarmInfo>();
public string GetBoxData(string key="")
{
if (key == "")
{
key = ParamDefine.posId;
}
if(boxStatus!=null&&boxStatus.Count>0)
{
foreach(BoxStatus item in boxStatus.Values)
{
if(item.data.ContainsKey(key))
{
return item.data[key];
}
}
}
return "";
}
} }
/// <summary> /// <summary>
......
...@@ -37,6 +37,11 @@ namespace OnlineStore.Common ...@@ -37,6 +37,11 @@ namespace OnlineStore.Common
string result = PostJson(url, json, Encoding.UTF8, out isTimeOut); string result = PostJson(url, json, Encoding.UTF8, out isTimeOut);
if ((operation.op > 0 && operation.op != 5) || operation.GetBoxData() != "")
{
LogUtil.info($"PostOP send [{json}] ,revice [{result}]");
}
if (!string.IsNullOrEmpty(result)) if (!string.IsNullOrEmpty(result))
{ {
......
...@@ -1460,8 +1460,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -1460,8 +1460,12 @@ namespace OnlineStore.DeviceLibrary
} }
else if (lastPosId != "") else if (lastPosId != "")
{ {
LogUtil.info($"SendLineStatus ,发送成功,清空 lastPosId " + lastPosId); string sendPosId = operation.GetBoxData();
lastPosId = ""; if (sendPosId != "")
{
LogUtil.info($"SendLineStatus , sendPosId ={sendPosId}, 发送成功,清空 lastPosId " + lastPosId);
lastPosId = "";
}
} }
if (resultOperation == null) if (resultOperation == null)
{ {
...@@ -1788,10 +1792,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -1788,10 +1792,14 @@ namespace OnlineStore.DeviceLibrary
if (IsDebug) if (IsDebug)
{ {
boxStatus.status = (int)StoreStatus.Debugging; boxStatus.status = (int)StoreStatus.Debugging;
} }
else if (storeStatus.Equals(StoreStatus.OutStoreBoxEnd) || storeStatus.Equals(StoreStatus.InStoreEnd)) else if (storeStatus.Equals(StoreStatus.OutStoreBoxEnd) || storeStatus.Equals(StoreStatus.InStoreEnd))
{ {
boxStatus.data.Add(ParamDefine.posId, lastPosId); boxStatus.data.Add(ParamDefine.posId, lastPosId);
if (lastPosId != "")
{
LogUtil.info("给服务器发送出入库完成消息:" + StoreName + ",status【" + storeStatus + "】posId【" + lastPosId + "】");
}
} }
else if (!lastPosId.Equals("")) else if (!lastPosId.Equals(""))
{ {
...@@ -1799,9 +1807,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -1799,9 +1807,9 @@ namespace OnlineStore.DeviceLibrary
boxStatus.status = (int)lastPosIdStatus; boxStatus.status = (int)lastPosIdStatus;
if (lastPosId != "") if (lastPosId != "")
{ {
LogUtil.info( "给服务器发送出入库完成消息:" + StoreName + ",status【" + lastPosIdStatus + "】posId【" + lastPosId + "】"); LogUtil.info("给服务器发送出入库完成消息:" + StoreName + ",status【" + lastPosIdStatus + "】posId【" + lastPosId + "】");
} }
// lastPosId = ""; // lastPosId = "";
} }
//如果在空闲中,且有入库未完成,直接发送入库执行中 //如果在空闲中,且有入库未完成,直接发送入库执行中
...@@ -1860,8 +1868,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -1860,8 +1868,12 @@ namespace OnlineStore.DeviceLibrary
} }
else if(lastPosId!="") else if(lastPosId!="")
{ {
LogUtil.info($"SendLineStatus ,发送成功,清空 lastPosId " + lastPosId); string sendPosId = lineOperation.GetBoxData();
lastPosId = ""; if (sendPosId != "" )
{
LogUtil.info($"SendLineStatus , sendPosId ={sendPosId}, 发送成功,清空 lastPosId " + lastPosId);
lastPosId = "";
}
} }
//发送状态信息到服务器 //发送状态信息到服务器
if (resultOperation == null || (resultOperation.op <= 0)) if (resultOperation == null || (resultOperation.op <= 0))
......
...@@ -583,7 +583,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -583,7 +583,7 @@ namespace OnlineStore.DeviceLibrary
//SendLineStatus(StoreID, posId, StoreStatus.InStoreEnd); //SendLineStatus(StoreID, posId, StoreStatus.InStoreEnd);
StoreMove.NextMoveStep(StoreMoveStep.SI_14_PutWareToBag); StoreMove.NextMoveStep(StoreMoveStep.SI_14_PutWareToBag);
InStoreLog("入库: 放下物品,升降轴至P4(库位入料缓冲点)[" + moveP.UpDown_P4 + "] ,压紧轴至P3(压紧前点) [" + moveP.ComPress_P3 + "]"); InStoreLog($"入库: 放下物品, 设置lastPosId={lastPosId} , lastPosIdStatus={lastPosIdStatus},升降轴至P4(库位入料缓冲点)[" + moveP.UpDown_P4 + "] ,压紧轴至P3(压紧前点) [" + moveP.ComPress_P3 + "]");
ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed); ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P4, Config.UpDownAxis_P4_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P4, Config.UpDownAxis_P4_Speed);
...@@ -766,11 +766,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -766,11 +766,11 @@ namespace OnlineStore.DeviceLibrary
else if (StoreMove.MoveStep == StoreMoveStep.SO_05_GetWare) else if (StoreMove.MoveStep == StoreMoveStep.SO_05_GetWare)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_06_InoutToP1); StoreMove.NextMoveStep(StoreMoveStep.SO_06_InoutToP1);
OutStoreLog("出库:进出轴至P1(待机点) "); string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PosInfo.PosId : "";
OutStoreLog("出库:进出轴至P1(待机点) ,设置 lastPosId="+posId);
//ACAxisMove(Config.InOut_Axis, moveP.InOut_P1, Config.InOutAxis_P1_Speed); //ACAxisMove(Config.InOut_Axis, moveP.InOut_P1, Config.InOutAxis_P1_Speed);
InOutBackToP1(moveP.InOut_P1); InOutBackToP1(moveP.InOut_P1);
//把库位的物品放到取到叉子上之后是出仓完成 //把库位的物品放到取到叉子上之后是出仓完成
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PosInfo.PosId : "";
lastPosIdStatus = StoreStatus.OutStoreBoxEnd; lastPosIdStatus = StoreStatus.OutStoreBoxEnd;
storeStatus = StoreStatus.OutStoreBoxEnd; storeStatus = StoreStatus.OutStoreBoxEnd;
lastPosId = posId; lastPosId = posId;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!