| | |
| | | //using (StreamReader reader = new StreamReader(configPath, System.Text.Encoding.UTF8)) |
| | | //{ |
| | | // _configBackupStr = reader.ReadToEnd(); |
| | | |
| | | |
| | | //} |
| | | |
| | | //ProductModel p = JsonConvert.DeserializeObject<ProductModel>(_configBackupStr, new JsonSerializerSettings() { TypeNameHandling = TypeNameHandling.All }); |
| | |
| | | } |
| | | else |
| | | { |
| | | ret.Add(1); |
| | | if (barcode.Split('-').Length > 5) |
| | | { |
| | | int mh = Plc1.Read(4000, 1, out _)[0]; |
| | | string codestr = barcode.Split('-')[4]; |
| | | if (codestr == "L") |
| | | { |
| | | codestr = "10"; |
| | | } |
| | | |
| | | if (codestr.Equals(mh.ToString())) |
| | | { |
| | | ret.Add(1); |
| | | } |
| | | else |
| | | { |
| | | ret.Add(2); |
| | | Plc1.WriteSingleAddress(4010, 1, out _);//给plc报警 |
| | | } |
| | | } |
| | | else |
| | | { |
| | | ret.Add(999); |
| | | } |
| | | } |
| | | |
| | | FillSpecResults(results[0].PID, results[0].Specs, ret, opConfig.Products[0].SEQUENCE); |
| | | |
| | | |
| | | opConfig.Products[0].SN = barcode; |
| | | opConfig.Products[0].Details.ForEach(u => u.SN = barcode); |
| | | opConfig.Products[0].PID = barcode + "_1"; |
| | | opConfig.Products[0].Details.ForEach(u => |
| | | { |
| | | u.SN = barcode; |
| | | u.PID = barcode + "_1"; |
| | | u.ResultList.ForEach(x => |
| | | { |
| | | |
| | | x.PID = barcode + "_1"; |
| | | |
| | | }); |
| | | }); |
| | | |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Action, $"产品{opConfig.Products[0].PID}条码获取为{barcode}"); |
| | | } |
| | |
| | | |
| | | return msg; |
| | | } |
| | | |
| | | |
| | | |
| | | private string BarcodeScannerCommunicate(TcpClientWrapBase client) |
| | |
| | | } |
| | | return isBarcodeValid; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | [ProcessMethod("ImageCheck", "CheckLineProfile", "检测产品线轮廓度", InvokeType.TestInvoke)] |
| | |
| | | |
| | | return msg; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |