Commit 120633de LN

1

1 个父辈 3315e408
...@@ -129,17 +129,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -129,17 +129,17 @@ namespace OnlineStore.DeviceLibrary
public static bool SetToNone(string id, string shelfId = "") public static bool SetToNone(string id, string shelfId = "")
{ {
ClientAction currA = GetAction(id); ClientAction currA = GetAction(id);
if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.FinishLeave) || currA.Equals(ClientAction.FinishEnter) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter)) if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter))
{ {
SetStatus(id, shelfId, ClientAction.None); SetStatus(id, shelfId, ClientAction.None);
return true; return true;
} }
return false; return false;
} }
public static bool NeedEnter(string id, string shelfId = "") public static bool NeedEnter(string id, string shelfId="")
{ {
ClientAction currA = GetAction(id); ClientAction currA = GetAction(id);
if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.FinishLeave) || currA.Equals(ClientAction.FinishEnter) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter)) if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter))
{ {
SetStatus(id, shelfId, ClientAction.NeedEnter); SetStatus(id, shelfId, ClientAction.NeedEnter);
return true; return true;
...@@ -148,28 +148,27 @@ namespace OnlineStore.DeviceLibrary ...@@ -148,28 +148,27 @@ namespace OnlineStore.DeviceLibrary
} }
public static bool NeedLeave(string id, string shelfId="") public static bool NeedLeave(string id, string shelfId="")
{ {
ClientAction currA = GetAction(id); ClientAction currA = GetAction(id);
if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.FinishLeave) || currA.Equals(ClientAction.FinishEnter) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter)) if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter))
{ {
SetStatus(id, shelfId, ClientAction.NeedLeave); SetStatus(id, shelfId, ClientAction.NeedLeave);
return true; return true;
} }
return false; return false;
} }
internal static void MayEnter(string NodeName, string shelfId = "") //internal static void MayEnter(string NodeName, string shelfId = "")
{ //{
SetStatus(NodeName, shelfId, ClientAction.MayEnter, ClientLevel.High); // SetStatus(NodeName, shelfId, ClientAction.MayEnter, ClientLevel.High);
} //}
internal static void FinishEnter(string NodeName, string shelfId = "") //internal static void FinishEnter(string NodeName, string shelfId = "")
{ //{
SetStatus(NodeName, shelfId, ClientAction.FinishEnter, ClientLevel.High); // SetStatus(NodeName, shelfId, ClientAction.FinishEnter, ClientLevel.High);
} //}
internal static void MayLeave(string NodeName, string shelfId = "") //internal static void MayLeave(string NodeName, string shelfId = "")
{ //{
SetStatus(NodeName, shelfId, ClientAction.MayLeave, ClientLevel.High); // SetStatus(NodeName, shelfId, ClientAction.MayLeave, ClientLevel.High);
} //}
private static bool isLog = ConfigAppSettings.GetIntValue(Setting_Init.Agv_Log_Open).Equals(1); private static bool isLog = ConfigAppSettings.GetIntValue(Setting_Init.Agv_Log_Open).Equals(1);
private static void AgvClient_Log(string s) private static void AgvClient_Log(string s)
......
...@@ -102,6 +102,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -102,6 +102,9 @@ namespace OnlineStore.DeviceLibrary
{ {
LogInfo("复位前,清理出库高度:" + OutStoreHeight); LogInfo("复位前,清理出库高度:" + OutStoreHeight);
} }
//复位时设置状态为none
AgvClient.SetStatus(Config.AgvInName);
AgvClient.SetStatus(Config.AgvOutName);
OutStoreHeight = -1; OutStoreHeight = -1;
//OutStoreCount = 0; //OutStoreCount = 0;
...@@ -673,7 +676,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -673,7 +676,7 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.SL_Out_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.SL_Out_Check).Equals(IO_VALUE.HIGH))
{ {
LogUtil.info(logName+"开始"); LogUtil.info(logName+"开始");
AgvClient.MayLeave(Config.AgvOutName); AgvClient.SetStatus(Config.AgvOutName,"",ClientAction.MayLeave,ClientLevel.High);
ProcessShelfOut = true; ProcessShelfOut = true;
//出口阻挡下降,出口线体转动 //出口阻挡下降,出口线体转动
IOMove(IO_Type.SL_Out_StopDown, IO_VALUE.HIGH); IOMove(IO_Type.SL_Out_StopDown, IO_VALUE.HIGH);
...@@ -697,7 +700,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -697,7 +700,7 @@ namespace OnlineStore.DeviceLibrary
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
Thread.Sleep(10000); Thread.Sleep(10000);
AgvClient.SetStatus(Config.AgvOutName, "", ClientAction.None); AgvClient.SetStatus(Config.AgvOutName, "", ClientAction.None, ClientLevel.High);
}); });
ProcessShelfOut = false; ProcessShelfOut = false;
LogUtil.info(logName + " 结束"); LogUtil.info(logName + " 结束");
...@@ -728,7 +731,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -728,7 +731,7 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.LOW))
{ {
LogUtil.info(logName+ " 开始"); LogUtil.info(logName+ " 开始");
AgvClient.MayEnter(Config.AgvInName); AgvClient.SetStatus(Config.AgvInName,"",ClientAction.MayEnter,ClientLevel.High);
ProcessShelfEnter = true; ProcessShelfEnter = true;
////进料阻挡上升 ////进料阻挡上升
//IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.LOW); //IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.LOW);
...@@ -751,11 +754,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -751,11 +754,11 @@ namespace OnlineStore.DeviceLibrary
Thread.Sleep(3000); Thread.Sleep(3000);
IOMove(IO_Type.SL_Line_Run, IO_VALUE.LOW); IOMove(IO_Type.SL_Line_Run, IO_VALUE.LOW);
//料架可离开 //料架可离开
AgvClient.FinishEnter(Config.AgvInName); AgvClient.SetStatus(Config.AgvInName,"",ClientAction.FinishEnter,ClientLevel.High);
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
Thread.Sleep(10000); Thread.Sleep(10000);
AgvClient.SetStatus(Config.AgvInName, "", ClientAction.None); AgvClient.SetStatus(Config.AgvInName, "", ClientAction.None, ClientLevel.High);
}); });
ProcessShelfEnter = false; ProcessShelfEnter = false;
LogUtil.info(logName + " 结束"); LogUtil.info(logName + " 结束");
......
...@@ -271,8 +271,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -271,8 +271,8 @@ namespace OnlineStore.DeviceLibrary
if (!AgvClient.ISConnected()) if (!AgvClient.ISConnected())
{ {
AgvClient.Init(); AgvClient.Init();
} }
LineServer.StartServer(ConfigAppSettings.GetIntValue(Setting_Init.TCPServerPort)); LineServer.StartServer(ConfigAppSettings.GetIntValue(Setting_Init.TCPServerPort));
RHomeOp(); RHomeOp();
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!