| | |
| | | using GZ.DB.Entity.OIDATABASE; |
| | | using static GZ.Projects.AuxAllWCS.ToWMSMES.CreateTask; |
| | | using GZ.Device.PLC; |
| | | using System.Text.RegularExpressions; |
| | | using ServiceStack.Text; |
| | | namespace GZ.Projects.AuxAllWCS |
| | | { |
| | | /// <summary> |
| | |
| | | } |
| | | View1_Init(sender, e); |
| | | |
| | | //var path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Configs"); |
| | | var path = System.IO.Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Configs"); |
| | | //string text = File.ReadAllText(configPath); |
| | | //PlcConfig plcConfig = JsonConvert.DeserializeObject<PlcConfig>(text); |
| | | //if (plcConfig != null && FactoryMap.ContainsKey((int)plcConfig.Brand) && FactoryMap[(int)plcConfig.Brand].Contains((int)plcConfig.Comm)) |
| | | //{ |
| | | |
| | | //foreach (var configPath in Directory.EnumerateFiles(@"G:\1AGIT\HH-0167_WuHuAoKeSi\2025å¹´6æ12æ¥\AuxAllWCS\Build\auxwcs\bin\Debug\Configs", "* - 坿¬", SearchOption.TopDirectoryOnly)) |
| | | //{ |
| | | // string text = File.ReadAllText(configPath); |
| | | // PlcConfig plcConfig = JsonConvert.DeserializeObject<PlcConfig>(text); |
| | | // if (plcConfig.Brand == DeviceBrand.Siemens) |
| | | // { |
| | | // string pattern = "^(?<ip>((?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d)\\.){3}(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d))\r\n:(?<port>0|[1-9]\\d{0,4}|[1-5]\\d{4}|6[0-4]\\d{3}|65[0-4]\\d{2}|655[0-2]\\d|6553[0-5])\r\n(?:(?::(?<number>\\d+)|\\[(?<rack>\\d+),(?<slot>\\d+)\\]|\\[v(?<ver>\\d+\\.\\d+)\\])){0,3}$"; |
| | | // Match match = Regex.Match(plcConfig.IP, pattern, RegexOptions.IgnorePatternWhitespace); |
| | | // if (match.Success) |
| | | // { |
| | | |
| | | // string value = match.Groups["ip"].Value; |
| | | // int.TryParse(match.Groups["port"].Value, out var result3); |
| | | // int.TryParse(match.Groups["number"].Value, out var result4); |
| | | // short.TryParse(match.Groups["rack"].Value, out var result5); |
| | | // short.TryParse(match.Groups["slot"].Value, out var result6); |
| | | // string value2 = match.Groups["ver"].Value; |
| | | // var result = new Comm_S7Net(Comm_S7Net. CpuType., value, result3, result5, result6, result4, value2); |
| | | // } |
| | | // } |
| | | //} |
| | | //} |
| | | //Console.Write(path); |
| | | /// <summary> |