| | |
| | | using Bro.Common.Helper; |
| | | using Bro.Common.Interface; |
| | | using Bro.Common.Model; |
| | | using Bro.DataBase.Model; |
| | | using Bro.M135.Common; |
| | | using Bro.M135.DBManager; |
| | | using HalconDotNet; |
| | |
| | | } while (true); |
| | | |
| | | |
| | | var Defaultclass = M141Config.DefectClassCollection.FirstOrDefault(u => u.IsDefault); |
| | | productList.ForEach(p => |
| | | var Defaultclass = M141Config.DefectClassCollection.FirstOrDefault(u => u.ClassName == productList[0].Result); |
| | | |
| | | if (M141Config.StationCode == "S4" && productList[0].Result == "OK") |
| | | { |
| | | if (Defaultclass == null) |
| | | { |
| | | if (string.IsNullOrEmpty(p.Result)) |
| | | { |
| | | p.Result = "NG"; |
| | | } |
| | | ////mysqlhelper.GetS2Result(productList[0].SEQUENCE); |
| | | Plc1.WriteSingleAddress(1526, mysqlhelper.GetS2Result(productList[0].SEQUENCE) ? 1 : 2, out _); |
| | | } |
| | | else |
| | | { |
| | | if (string.IsNullOrEmpty(p.Result)) |
| | | { |
| | | p.Result = Defaultclass.ClassName; |
| | | } |
| | | Plc1.WriteSingleAddress(1526, Defaultclass?.ClassValue ?? 2, out _); |
| | | } |
| | | |
| | | Plc1.WriteSingleAddress(1526, p.Result.ToUpper().Contains("NG") ? 2 : 1, out _); |
| | | }); |
| | | Plc1.WriteSingleAddress(1516, 1, out _); |
| | | |
| | | return msg; |