using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading; using QMFrameWork.Common.Serialization; using QMAPP.FJC.Entity.Basic; namespace OpcProcessWinService { public class Class1 { public delegate void DelegateName(); public void Test() { while (true) { Thread.Sleep(5000); int index = 0; int sum = ChatEventHelper.chatters.Count; List getParaList = new List(); getParaList.Add(new ParameterConfig() { PARAVALUE = "B9A15112319455551127" }); if (sum > 0 && index == 0) { index++; //定义参数信息 ChatEventArgs e = new ChatEventArgs(); //设备编号 e.MachineCode = "1A-CD0004"; //传输参数的类别 e.MessageType = "0";// OpcEnumGeter.MESSAGETYPE.PRODUCTCODE.GetHashCode().ToString(); //传输参数的内容 e.MessageContent = JsonConvertHelper.GetSerializes(getParaList); OpcService opcService = new OpcService(); opcService.ReturnProductCodeToMachine(e); } } } public void CallBackMethod(IAsyncResult ar) { } } }