1
czw
8 天以前 60dc4564fabd9f4afed46d4c91aac7b6db9b9e6d
2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Build/Project/´úÂë/VS×Ô¶¨ÒåÀà/AutoThread.cs
@@ -146,14 +146,25 @@
                    device1.Js捷顺2.Config.IP,
                    device1.维希尔抓臂1.Config.IP,
                    device1.维希尔抓臂2.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发那科1下线.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发那科1下线.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发那科1下线.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发那科2下线.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发那科2下线.D2212_LAST", "1", out string msg);
@@ -2549,7 +2558,7 @@
                        LogHelper.Info($"解释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($"解释MES任务 ->{task.S_TASK_NO} ç›´æŽ¥ç”Ÿæˆå¯¹åº”任务 ç»“果:{res}");
                        if (res)