Commit 9cc504c9 LN

1

1 个父辈 7fb1e0a4
......@@ -262,10 +262,11 @@ namespace OnlineStore.DeviceLibrary
//开始复位动作
MoveInfo.NextMoveStep(StoreMoveStep.BOX_H01_InOutBack);
LogInfo(MoveInfo.MoveType + ": 开始料架入库,线体停止,进出轴先原点返回");
LogInfo(MoveInfo.MoveType + ": 开始料架入库,线体停止,进出轴先原点返回,设置agv状态为None");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(2000));
LineStop();
ACAxisHomeMove(Config.InOut_Axis);
AgvClient.SetStatus(Config.AgvNodeName);
}
/// <summary>
......@@ -685,6 +686,16 @@ namespace OnlineStore.DeviceLibrary
{
StartShelfInStore();
}
//判断是否要更新状态为None
ClientAction action = AgvClient.GetAction(Config.AgvNodeName);
if (action.Equals(ClientAction.FinishEnter) || action.Equals(ClientAction.FinishLeave))
{
AgvClient.SetStatus(Config.AgvNodeName);
}
else if(IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.LOW)&&IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW))
{
AgvClient.NeedEnter(Config.AgvNodeName);
}
}
}
catch (Exception ex)
......@@ -854,9 +865,10 @@ namespace OnlineStore.DeviceLibrary
msg += "runS: " + storeRunStatus + "\n";
msg += "lineS: " + storeStatus + "\n";
msg += "alarm: " + alarmType + "\n";
msg += "Move:" + MoveInfo.MoveType + "\n";
msg += "MoveS: " + MoveInfo.SLog + "\n";
msg += "Shlef: " + CurrShelfID ;
msg += MoveInfo.MoveType +" "+MoveInfo.SLog+ "\n";
// msg += "MoveS: " + MoveInfo.SLog + "\n";
msg += "Shlef: " + CurrShelfID + "\n";
msg += Config.AgvNodeName + ":" + AgvClient.GetAction(Config.AgvNodeName);
return msg;
}
}
......
......@@ -284,7 +284,7 @@ namespace OnlineStore.DeviceLibrary
RFIDData data = RFIDManager.ReadRFID(Config.RFID_IP, true);
LogUtil.info(Name + "更新当前料架号【" + data.NumStr() + "】");
//TODO 判断料架是否正确
if (data.RFType.Equals("A"))
// if (data.RFType.Equals('A'))
{
CurrShelfID = data.NumStr();
AgvClient.SetStatus(Config.AgvNodeName,"", CurrShelfID,ClientAction.FinishEnter);
......
......@@ -6,6 +6,7 @@ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
......@@ -53,7 +54,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_03_LineRun);
InOutStoreLog(moveName + MoveInfo.SLog + "调用AgvClient.MayEnter,线体正转,等待LineIn_Check信号");
AgvClient.MayEnter(Config.AgvNodeName);
AgvClient.SetStatus(Config.AgvNodeName,"","",ClientAction.MayEnter,ClientLevel.High);
LineRun();
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LineIn_Check, IO_VALUE.HIGH));
}
......@@ -66,8 +67,8 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(StoreMoveStep.BI_05_LineStop);
InOutStoreLog(moveName + MoveInfo.SLog + "调用AgvClient.FinishEnter,取料位检测到信号,停止线体正转");
LineStop();
AgvClient.FinishEnter(Config.AgvNodeName);
AgvClient.SetStatus(Config.AgvNodeName, "", "", ClientAction.FinishEnter, ClientLevel.High);
if (!instoreShelf)
{
EmprtShelfList = new System.Collections.Concurrent.ConcurrentQueue<string>(ShelfPosList);
......@@ -94,7 +95,8 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_05_LineStop))
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_06_DoorClose);
InOutStoreLog(moveName + MoveInfo.SLog + "入料口移门关闭");
InOutStoreLog(moveName + MoveInfo.SLog + "入料口移门关闭 ,发送 FinishEnter");
AgvClient.SetStatus(Config.AgvNodeName, "", "", ClientAction.FinishEnter, ClientLevel.High);
// CylinderMove(MoveInfo, IO_Type.EntranceDoor_Open, IO_Type.EntranceDoor_Close);
DoorBean.StartClose(MoveInfo);
if (!instoreShelf)
......@@ -108,9 +110,9 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_06_DoorClose))
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_07_LineRun);
InOutStoreLog(moveName + MoveInfo.SLog + "继续转动1500");
InOutStoreLog(moveName + MoveInfo.SLog + "继续转动 7000");
LineRun();
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(7000));
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_07_LineRun))
{
......@@ -143,7 +145,7 @@ namespace OnlineStore.DeviceLibrary
if (instoreShelf)
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_10_StartGetTray);
InOutStoreLog(moveName + MoveInfo.SLog + "开始循环料架取料盘");
InOutStoreLog(moveName + MoveInfo.SLog + "开始循环料架取料盘 ");
}
else
{
......@@ -201,8 +203,8 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(StoreMoveStep.BS_04_ReadyEmpty);
MoveInfo.OneWaitCanEndStep = true;
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(10000));
InOutStoreLog(moveName + MoveInfo.SLog + ":调用AgvClient.ReadyEmpty,等待Agv到达 ,最多等待1000");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(60000));
InOutStoreLog(moveName + MoveInfo.SLog + ":调用AgvClient.ReadyEmpty,等待Agv到达 ,最多等待60000");
AgvClient.NeedLeave(Config.AgvNodeName, CurrShelfID);
//等待agv到达
MoveInfo.WaitList.Add(WaitResultInfo.WaitAgvAction((int)ClientAction.Arrive));
......@@ -213,6 +215,7 @@ namespace OnlineStore.DeviceLibrary
//agv到达
if (AgvClient.GetAction(Config.AgvNodeName).Equals(ClientAction.Arrive))
{
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
if (instoreShelf)
{
InOutStoreLog(moveName + MoveInfo.SLog + ":agv到达,调用AgvClient.SendRFID【" + CurrShelfID + "】,调用AgvClient.MayOut,线体开始反转");
......@@ -223,7 +226,7 @@ namespace OnlineStore.DeviceLibrary
{
InOutStoreLog(moveName + MoveInfo.SLog + ":agv到达, 调用AgvClient.MayOut,线体开始反转");
}
AgvClient.MayLeave(Config.AgvNodeName);
AgvClient.SetStatus(Config.AgvNodeName, "", CurrShelfID,ClientAction.MayLeave,ClientLevel.High);
LineBackRun();
}
else
......@@ -254,7 +257,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_07_WaitTime))
{
MoveInfo.NextMoveStep(StoreMoveStep.BS_08_WaitAGVLeave);
InOutStoreLog(moveName + MoveInfo.SLog + ": ,同时等待 AGV离开,最多等待5000");
InOutStoreLog(moveName + MoveInfo.SLog + ": ,同时等待 AGV离开,最多等待5000 ");
MoveInfo.OneWaitCanEndStep = true;
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
//MoveInfo.WaitList.Add(WaitResultInfo.WaitAgvAction(action.FinishOut));
......@@ -263,16 +266,19 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_08_WaitAGVLeave))
{
MoveInfo.NextMoveStep(StoreMoveStep.BS_09_CloseDoor);
InOutStoreLog(moveName + MoveInfo.SLog + ":停止线体转动,关闭仓门");
InOutStoreLog(moveName + MoveInfo.SLog + ":停止线体转动,关闭仓门 ,发送FinishLeave ,等待最少5000");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(5000));
LineStop();
DoorBean.StartClose(MoveInfo);
AgvClient.SetStatus(Config.AgvNodeName, "", CurrShelfID, ClientAction.FinishLeave, ClientLevel.High);
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_09_CloseDoor))
{
//结束
MoveEndToRuningStatus();
EmprtShelfList = new ConcurrentQueue<string>();
InOutStoreLog(moveName + MoveInfo.SLog + ":停止转动,送出料架结束");
InOutStoreLog(moveName + MoveInfo.SLog + ":停止转动,送出料架结束 ,设置状态为None");
AgvClient.SetStatus(Config.AgvNodeName);
}
}
......
......@@ -63,7 +63,7 @@ namespace OnlineStore.DeviceLibrary
{
UpdateAction(id, ClientAction.Ready);
RFIDData data = new RFIDData(content);
LogUtil.info("收到 AgvClient_Ready [" + id + "] [" + data.ToData() + "] ");
LogUtil.info("收到 AgvClient_Ready [" + id + "] [" + data.NumStr() + "] ");
StoreManager.Store.AGVProcess(id, ClientAction.Ready);
}
......@@ -72,7 +72,7 @@ namespace OnlineStore.DeviceLibrary
{
UpdateAction(id, ClientAction.Arrive);
RFIDData data = new RFIDData(content);
LogUtil.info("收到 AgvClient_Arrive [" + id + "] [" + data.ToData() + "] ");
LogUtil.info("收到 AgvClient_Arrive [" + id + "] [" + data.NumStr() + "] ");
StoreManager.Store.AGVProcess(id, ClientAction.Arrive);
}
......@@ -86,15 +86,22 @@ namespace OnlineStore.DeviceLibrary
}
return agvClient.IsConn;
}
//internal static void SendRFID(string NodeName, string rfid)
//{
// agvClient.SendRFID(NodeName, rfid);
//}
public static bool NeedEnter(string id, string shelfId)
public static bool SetToNone(string id, string shelfId = "")
{
ClientAction currA = GetAction(id);
if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.FinishLeave) || currA.Equals(ClientAction.FinishEnter))
if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter))
{
SetStatus(id, shelfId, shelfId, ClientAction.None);
return true;
}
return false;
}
public static bool NeedEnter(string id, string shelfId = "")
{
ClientAction currA = GetAction(id);
if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter))
{
SetStatus(id, shelfId, shelfId, ClientAction.NeedEnter);
return true;
......@@ -103,31 +110,30 @@ namespace OnlineStore.DeviceLibrary
}
public static bool NeedLeave(string id, string shelfId = "")
{
ClientAction currA = GetAction(id);
if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.FinishLeave) || currA.Equals(ClientAction.FinishEnter))
if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter))
{
SetStatus(id, shelfId, shelfId, ClientAction.NeedLeave);
return true;
}
return false;
}
internal static void MayEnter(string NodeName, string shelfId = "")
{
SetStatus(NodeName, shelfId, shelfId, ClientAction.MayEnter);
//agvClient.MayEnter(NodeName);
}
internal static void FinishEnter(string NodeName, string shelfId = "")
{
SetStatus(NodeName, shelfId, shelfId, ClientAction.FinishEnter);
// agvClient.FinishEnter(NodeName);
}
//internal static void MayEnter(string NodeName, string shelfId = "")
//{
// SetStatus(NodeName, shelfId, shelfId, ClientAction.MayEnter);
// //agvClient.MayEnter(NodeName);
//}
//internal static void FinishEnter(string NodeName, string shelfId = "")
//{
// SetStatus(NodeName, shelfId, shelfId, ClientAction.FinishEnter);
// // agvClient.FinishEnter(NodeName);
//}
internal static void MayLeave(string NodeName, string shelfId = "")
{
SetStatus(NodeName, shelfId, shelfId, ClientAction.MayLeave);
// agvClient.MayLeave(NodeName);
}
//internal static void MayLeave(string NodeName, string shelfId = "")
//{
// SetStatus(NodeName, shelfId, shelfId, ClientAction.MayLeave);
// // agvClient.MayLeave(NodeName);
//}
private static void AgvClient_Log(string s)
{
try
......
......@@ -113,7 +113,7 @@ namespace Asa.RFID
LOGGER.Info(IP + " Scan Data:" + dataStr);
Received?.Invoke(IP, bb);
}
System.Threading.Thread.Sleep(100);
System.Threading.Thread.Sleep(50);
}
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!