From 60dc4564fabd9f4afed46d4c91aac7b6db9b9e6d Mon Sep 17 00:00:00 2001 From: czw <selecti@yeah.net> Date: 星期四, 10 七月 2025 14:16:10 +0800 Subject: [PATCH] 1 --- 2025年6月12日/AuxAllWCS/Build/Project/代码/VS自定义类/AutoThread.cs | 29 +++++++++++++++++++---------- 1 files changed, 19 insertions(+), 10 deletions(-) diff --git "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs" "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs" index 8845f98..d28c119 100644 --- "a/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs" +++ "b/2025\345\271\2646\346\234\21012\346\227\245/AuxAllWCS/Build/Project/\344\273\243\347\240\201/VS\350\207\252\345\256\232\344\271\211\347\261\273/AutoThread.cs" @@ -146,14 +146,25 @@ device1.Js鎹烽『2.Config.IP, device1.缁村笇灏旀姄鑷�.Config.IP, device1.缁村笇灏旀姄鑷�.Config.IP, - device1.RGV.Config.IP + device1.RGV.Config.IP, + device1.S1002Read.Config.IP, + device1.S2001Read.Config.IP, + device1.S3001Read.Config.IP }) { string pattern = @"\b(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\b"; var matches = Regex.Match(ip, pattern); if (matches.Success) - IsMachineOnline(matches.Value); + { + var b = IsMachineOnline(matches.Value); + if (!Iponlines.ContainsKey(ip)) + { + Iponlines.TryAdd(ip, b); + } + else + Iponlines[ip] = b; + } } } catch (Exception ex) @@ -177,12 +188,10 @@ tasks.Add(GetTask(sa3006, tag, 3000)); tasks.Add(GetTask(sa3010, tag, 3000)); - - - Task.WaitAll(tasks.ToArray()); } + public static ConcurrentDictionary<string, bool> Iponlines = new ConcurrentDictionary<string, bool>(); public bool IsMachineOnline(string hostNameOrIp, int timeout = 1000) { //device.p鍙戦偅绉�涓嬬嚎.Config.IP @@ -1877,7 +1886,7 @@ if (tag.FNK1.D2217 == 1 && tag.FNK1.D2217_LAST == 0) { //tag.FNK1.D2215 = 0; - tag.FNK1.D2218 = 1; + //tag.FNK1.D2218 = 1; //tag.FNK1.D2212_LAST = 1; RedisHelper.Add($"p鍙戦偅绉�涓嬬嚎.D2217_LAST", "1", out string msg); @@ -1904,7 +1913,7 @@ LogHelper.Info($" FN1 D2212>{tag.FNK1.D2212} D2212LAST>{tag.FNK1.D2212_LAST} D2210>{tag.FNK1.D2210} D2211>{tag.FNK1.D2211} D2213>{tag.FNK1.D2213}"); if (tag.FNK1.D2212 == 1 && tag.FNK1.D2212_LAST == 0) { - tag.FNK1.D2213 = 1; + //tag.FNK1.D2213 = 1; //tag.FNK1.D2210 = 0; //tag.FNK1.D2217_LAST = 1; RedisHelper.Add($"p鍙戦偅绉�涓嬬嚎.D2212_LAST", "1", out string msg); @@ -1939,7 +1948,7 @@ if (tag.FNK2.D2217 == 1 && tag.FNK2.D2217_LAST == 0) { //tag.FNK2.D2215 = 0; - tag.FNK2.D2218 = 1; + //tag.FNK2.D2218 = 1; //tag.FNK2.D2212_LAST = 1; RedisHelper.Add($"p鍙戦偅绉�涓嬬嚎.D2217_LAST", "1", out string msg); @@ -1968,7 +1977,7 @@ if (tag.FNK2.D2212 == 1 && tag.FNK2.D2212_LAST == 0) { //tag.FNK2.D2210 = 0; - tag.FNK2.D2213 = 1; + //tag.FNK2.D2213 = 1; //tag.FNK2.D2217_LAST = 1; RedisHelper.Add($"p鍙戦偅绉�涓嬬嚎.D2212_LAST", "1", out string msg); @@ -2549,7 +2558,7 @@ LogHelper.Info($"瑙i噴MES浠诲姟 ->{task.S_TASK_NO} 鐩存帴鐢熸垚瀵瑰簲浠诲姟"); //鐩存帴鐢熸垚瀵瑰簲浠诲姟銆�- var res = TaskProcess.CreateTask(task.S_TASK_NO, task.S_START_LOC, task.S_END_LOC, task.S_TYPE, 6, task.S_CNTRS?.Split(',').ToList() ?? new List<string>(), type); + var res = TaskProcess.CreateTask(task.S_TASK_NO, task.S_START_LOC, task.S_END_LOC, task.S_TYPE, 6, task.S_CNTRS?.Split(',').ToList() ?? new List<string>(), "AGV", type); LogHelper.Info($"瑙i噴MES浠诲姟 ->{task.S_TASK_NO} 鐩存帴鐢熸垚瀵瑰簲浠诲姟 缁撴灉锛歿res}"); if (res) -- Gitblit v1.9.1