| | |
| | | public void ThreadSettingInit(Tag tag) |
| | | { |
| | | List<Task> tasks = new List<Task>(); |
| | | //tasks.Add(GetTask(sa2008, tag, 3000)); |
| | | Task.WaitAll(tasks.ToArray()); |
| | | tasks.Add(GetTask(wmsPrint, tag, 3000)); |
| | | |
| | | |
| | | //GZ.Modular.Redis.WriteGroupEntity group = new GZ.Modular.Redis.WriteGroupEntity(); |
| | | //group.groupName = "PLC1.ssx2Xplc"; |
| | | //group.queueStatus = 1; |
| | | //group.queueTime = DateTime.Now; |
| | | |
| | | //group.writeList = new List<GZ.Modular.Redis.ParamData>(); |
| | | //GZ.Modular.Redis.ParamData barcodeData = new GZ.Modular.Redis.ParamData(); |
| | | //barcodeData.paramName = "PLC1.Param4"; |
| | | //barcodeData.paramValue = Tag.PLC1.Param4 + 1 + ""; |
| | | |
| | | //GZ.Modular.Redis.ParamData sendData = new GZ.Modular.Redis.ParamData(); |
| | | //sendData.paramName = "PLC1.Param5"; |
| | | //sendData.paramValue = Tag.PLC1.Param5 + 2 + ""; |
| | | |
| | | //group.writeList.Add(barcodeData); |
| | | //group.writeList.Add(sendData); |
| | | //Conn.é»è®¤Redis.SetQueue(group, "PLC1Queue", "PLC1.Param1_LAST", "1") ? "--æå" : "--失败"; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | Task.WaitAll(tasks.ToArray()); |
| | | } |
| | | |
| | | private void wmsPrint(Tag tag) |
| | | { |
| | | HttpServer.apiHelper.WebGet($"http://{"test1.wmsdev.net:18980"}/expcenter/WebSocketPrintAction?sysType=OT01&QS01=YANGYZ&QS02={"æ¶é´æ³"}&QS04=P4EL67LRIWWDCMP7C&clsid=export_header&method=printByWebSocket&origin=http%3A%2F%2Ftest1.wmsdev.net%3A18980&organizationId=FLUX&warehouseId=FLUXWH01&printServer=YYZ&printerName=LocalPrinter&copies=1&functionId=A2002&tableId=BAS_LOCATION&exportCode=YYZ_CN&itemObj=%0A%7B%0A++++%22bizOrgId%22%3A+%22FLUX%22%2C%0A++++%22CHECK.locationId%22%3A+%22001-001-01-01%22%2C%0A++++%22bizWarehouseId%22%3A+%22FLUXWH01%22%0A%7D%0A%0A"); |
| | | } |
| | | |
| | | private Task GetTask(Action<Tag> action, Tag tag, int i = 2500) |
| | | { |
| | | var task = Task.Run(() => |
| | |
| | | if (stream != null) stream.Close(); |
| | | if (rsp != null) rsp.Close(); |
| | | } |
| | | |
| | | } |
| | | public string WebGet(string url) |
| | | { |
| | | //using (var client = new HttpClient()) { |
| | | // //请æ±ç»æ |
| | | // string result = client.GetAsync(url).Result.Content.ReadAsStringAsync().Result; |
| | | |
| | | // Console.WriteLine(result); |
| | | // return result; |
| | | |
| | | //} |
| | | //Console.WriteLine(url); |
| | | WebRequest request = WebRequest.Create(url); |
| | | request.Timeout = 6000; |
| | | request.Method = "GET"; |
| | | |
| | | try |
| | | { |
| | | WebResponse response = request.GetResponse(); |
| | | Stream dataStream = response.GetResponseStream(); |
| | | StreamReader reader = new StreamReader(dataStream); |
| | | string responseFromServer = reader.ReadToEnd(); |
| | | |
| | | reader.Close(); |
| | | dataStream.Close(); |
| | | response.Close(); |
| | | Console.WriteLine(responseFromServer); |
| | | return responseFromServer; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | LogHelper.Error($"WebGet Error:{ex.Message}", ex); |
| | | return ""; |
| | | } |
| | | } |
| | | |
| | | #endregion [èªå®ä¹ç±»][20250325095622918][HttpHelper] |
| | | } |
| | | public class Clloc |
| | |
| | | "AddrType": "", |
| | | "Length": 1, |
| | | "Desc": "", |
| | | "Trigger": false, |
| | | "Trigger": true, |
| | | "Reserve1": "", |
| | | "Reserve2": "", |
| | | "Reserve3": "" |
| | |
| | | "Comm": "S7Net", |
| | | "IP": "127.0.0.1:102[0,1]", |
| | | "RedisQueueName": "PLC1Queue", |
| | | "IsSimulate": false, |
| | | "IsSimulate": true, |
| | | "Reserve1": "", |
| | | "Reserve2": "", |
| | | "Reserve3": "" |
| | | } |
| | | ], |
| | | "CreationTime": "2025-07-01 10:23:43", |
| | | "LastWriteTime": "2025-07-04 09:09:38" |
| | | "LastWriteTime": "2025-07-21 11:21:28" |
| | | } |
| | |
| | | "ProjectSn": "", |
| | | "DeviceList": [], |
| | | "CreationTime": "2025-07-01 10:23:37", |
| | | "LastWriteTime": "2025-07-04 09:09:41" |
| | | "LastWriteTime": "2025-07-21 11:21:31" |
| | | } |
| | |
| | | "DevelopVersion": "1.0.6.0", |
| | | "Encode": "1bKKzS3nmbstyerHBqNS0Q==", |
| | | "CreationTime": "0001-01-01 00:00:00", |
| | | "LastWriteTime": "2025-07-21 09:08:19" |
| | | "LastWriteTime": "2025-07-21 11:22:24" |
| | | } |
| | |
| | | ], |
| | | "Globals": [], |
| | | "CreationTime": "2025-07-01 10:23:39", |
| | | "LastWriteTime": "2025-07-04 11:18:35" |
| | | "LastWriteTime": "2025-07-21 11:22:24" |
| | | } |
| | |
| | | #endregion |
| | | |
| | | #region åéç» |
| | | private TagGroup1 _Group1 = new TagGroup1(); |
| | | public TagGroup1 Group1 { get { return _Group1; } set { _Group1=value; RaisePropertyChanged("Group1"); } } |
| | | #endregion |
| | | |
| | | #region å
é¨ç±» |
| | | public class TagGroup1 : System.ComponentModel.INotifyPropertyChanged |
| | | { |
| | | #region åé |
| | | private System.UInt16 _Param3_LAST; |
| | | public System.UInt16 Param3_LAST |
| | | { |
| | | get |
| | | { |
| | | return _Param3_LAST; |
| | | } |
| | | set |
| | | { |
| | | _Param3_LAST = value; |
| | | RaisePropertyChanged("Param3_LAST"); |
| | | } |
| | | } |
| | | private System.UInt16 _Param3; |
| | | public System.UInt16 Param3 |
| | | { |
| | | get |
| | | { |
| | | return _Param3; |
| | | } |
| | | set |
| | | { |
| | | _Param3 = value; |
| | | RaisePropertyChanged("Param3"); |
| | | } |
| | | } |
| | | private System.UInt16 _Param4; |
| | | public System.UInt16 Param4 |
| | | { |
| | | get |
| | | { |
| | | return _Param4; |
| | | } |
| | | set |
| | | { |
| | | _Param4 = value; |
| | | RaisePropertyChanged("Param4"); |
| | | } |
| | | } |
| | | #endregion |
| | | |
| | | #region åéç» |
| | | #endregion |
| | | |
| | | #region å
é¨ç±» |
| | | |
| | | #endregion |
| | | |
| | | #region 屿§åæ´ |
| | | public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged; |
| | | public void RaisePropertyChanged(string propertyName) |
| | | { |
| | | System.ComponentModel.PropertyChangedEventHandler handler = PropertyChanged; |
| | | if (handler != null) |
| | | { |
| | | handler(this, new System.ComponentModel.PropertyChangedEventArgs(propertyName)); |
| | | } |
| | | } |
| | | #endregion |
| | | } |
| | | |
| | | |
| | | #endregion |
| | | |
| | |
| | | "ID": "20250704145122680", |
| | | "Name": "é«éæ«ç åæ£æ¨¡å", |
| | | "Desc": "1", |
| | | "Content": "AutoThread.InvokeMethod(AutoThread.Instance, \"ThreadwebSoc\");", |
| | | "ContentCopy": "AutoThread.InvokeMethod(AutoThread.Instance, \"ThreadwebSoc\");", |
| | | "Content": "AutoThread.InvokeMethod(AutoThread.Instance, \"ThreadwebSoc\");\r\n", |
| | | "ContentCopy": "AutoThread.InvokeMethod(AutoThread.Instance, \"ThreadwebSoc\");\r\n", |
| | | "ParentID": "20250701102338326", |
| | | "Children": [], |
| | | "Type": "Program", |
| | |
| | | } |
| | | ], |
| | | "CreationTime": "2025-07-01 10:23:38", |
| | | "LastWriteTime": "2025-07-21 10:11:26", |
| | | "LastWriteTime": "2025-07-21 11:16:15", |
| | | "HasSaved": true |
| | | } |
| | |
| | | "ParentFullName": "", |
| | | "FullName": "Tag", |
| | | "Vars": [], |
| | | "Children": [ |
| | | { |
| | | "ID": "20250721112111161", |
| | | "Name": "Group1", |
| | | "Desc": "", |
| | | "ParentID": "20250701102337900", |
| | | "ParentFullName": "Tag", |
| | | "FullName": "Tag.Group1", |
| | | "Vars": [ |
| | | { |
| | | "ID": "20250721112117949", |
| | | "Name": "Param3_LAST", |
| | | "Desc": "", |
| | | "Type": "System.UInt16", |
| | | "ShortType": "", |
| | | "MinVal": "", |
| | | "MaxVal": "", |
| | | "DefaultVal": "", |
| | | "MapDevice": "PLC1", |
| | | "MapParam": "Param3_LAST", |
| | | "Map": "PLC1.Param3_LAST", |
| | | "Queue": "PLC1Queue", |
| | | "Converter": "", |
| | | "GroupID": "20250721112111161", |
| | | "GroupFullName": "Tag.Group1", |
| | | "FullName": "Tag.Group1.Param3_LAST" |
| | | }, |
| | | { |
| | | "ID": "20250721112117933", |
| | | "Name": "Param3", |
| | | "Desc": "", |
| | | "Type": "System.UInt16", |
| | | "ShortType": "", |
| | | "MinVal": "", |
| | | "MaxVal": "", |
| | | "DefaultVal": "", |
| | | "MapDevice": "PLC1", |
| | | "MapParam": "Param3", |
| | | "Map": "PLC1.Param3", |
| | | "Queue": "PLC1Queue", |
| | | "Converter": "", |
| | | "GroupID": "20250721112111161", |
| | | "GroupFullName": "Tag.Group1", |
| | | "FullName": "Tag.Group1.Param3" |
| | | }, |
| | | { |
| | | "ID": "20250721112117918", |
| | | "Name": "Param4", |
| | | "Desc": "", |
| | | "Type": "System.UInt16", |
| | | "ShortType": "", |
| | | "MinVal": "", |
| | | "MaxVal": "", |
| | | "DefaultVal": "", |
| | | "MapDevice": "PLC1", |
| | | "MapParam": "Param4", |
| | | "Map": "PLC1.Param4", |
| | | "Queue": "PLC1Queue", |
| | | "Converter": "", |
| | | "GroupID": "20250721112111161", |
| | | "GroupFullName": "Tag.Group1", |
| | | "FullName": "Tag.Group1.Param4" |
| | | } |
| | | ], |
| | | "Children": [] |
| | | } |
| | | ] |
| | | }, |
| | | "CreationTime": "2025-07-01 10:23:37", |
| | | "LastWriteTime": "0001-01-01 00:00:00", |
| | | "LastWriteTime": "2025-07-21 11:21:21", |
| | | "Sample": { |
| | | "ID": "", |
| | | "Name": "Tag", |