1
czw
5 天以前 a47e45d04ca5beadcf815d852cae52ef56f669e5
2025Äê6ÔÂ12ÈÕ/AuxAllWCS/Build/Project/´úÂë/VS×Ô¶¨ÒåÀà/AutoThread.cs
@@ -30,6 +30,7 @@
using System.Net.NetworkInformation;
using System.Windows.Documents;
using System.Text.RegularExpressions;
using GZ.Device.PLC;
namespace GZ.Projects.AuxAllWCS
{
@@ -113,7 +114,7 @@
            }
            catch (Exception ex)
            {
                LogHelper.Error($"InvokeMethod > cacheKey-{ex.Message}", ex);
                LogHelper.Error($"InvokeMethod > cacheKey:{cacheKey}-{ex.Message}", ex);
                throw ex;
            }
        }
@@ -149,6 +150,7 @@
        //        return _repository;
        //    }
        //}
        /// <summary>
        /// é…ç½®åˆå§‹åŒ–。
        /// </summary>
@@ -173,6 +175,7 @@
                Console.Clear();
            }
        }
        public void ThreaTotal(Tag tag, Device device)
@@ -240,11 +243,26 @@
            tasks.Add(GetTask(ThreadMXC5, tag, 3000));
            tasks.Add(GetTask(ThreadMXC6, tag, 3000));
            tasks.Add(GetTask(ThreadS7helper, tag, 3000));
            LogHelper.Info("ThreaTotal çº¿ç¨‹æ€»çº¿runing");
            Task.WaitAll(tasks.ToArray());
            LogHelper.Info("ThreaTotal çº¿ç¨‹æ€»çº¿over");
        }
        private void ThreadS7helper(Tag tag)
        {
            //var plc = new Plc(CpuType.S71500,);
            //foreach (var item in collection)
            //{
            //    S7.Net.Plc plc = new Plc(CpuType.S71500, item.address, 0, 1);
            //    Link(plc);
            //    PLCS.Add(item.deviceName, plc);
            //}
        }
        void taskssss1(Tag tag)
        {
            sa1025(tag);
@@ -264,7 +282,7 @@
            sa3010(tag);
        }
        public static ConcurrentDictionary<string, bool> Iponlines = new ConcurrentDictionary<string, bool>();
        //public static ConcurrentDictionary<string, bool> Iponlines = new ConcurrentDictionary<string, bool>();
        public bool IsMachineOnline(string hostNameOrIp, int timeout = 1000)
        {
            //device.p发那科1下线.Config.IP