| | |
| | | public static object _productListLock = new object(); |
| | | public List<ProductModel> ProductList = new List<ProductModel>(); |
| | | MachineLearningBase ML = null; |
| | | TcpListenerWrap TcpListener = null; |
| | | Spec _errorSpec = null; |
| | | |
| | | TcpListenerWrap _realTimeServer = null; |
| | | |
| | | volatile int _productIndex = 0; |
| | | |
| | | int _backgroundImageWidth = 2448; |
| | | //volatile int _productIndex = 0; |
| | | |
| | | M141Process_Mysql mysqlhelper = new M141Process_Mysql(); |
| | | |
| | | |
| | | |
| | | |
| | | public override void InitialProcessMethods() |
| | |
| | | public void Heartplc() |
| | | { |
| | | Thread.Sleep(1000); |
| | | |
| | | //Open(); |
| | | |
| | | string _statisticFilePath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Statistic.json"); |
| | | if (File.Exists(_statisticFilePath)) |
| | | { |
| | |
| | | { |
| | | products.ForEach(p => |
| | | { |
| | | var pResults = resultList.Where(u => u.PID == p.PID).ToList(); |
| | | var pResults = resultList.ToList(); |
| | | p.AddNewDetectResults(M141Config.StationCode, measureBind.WorkPosition, pResults); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Action, $"产品{p.PID}_{p.SEQUENCE}添加工位{measureBind.WorkPosition}检测结果,数量{pResults.Count}"); |
| | | }); |
| | |
| | | { |
| | | p.BasketCode = mysqlhelper.Getbasketcode(p.SEQUENCE, out string sntem); |
| | | p.SN = sntem; |
| | | p.PID = $"{sntem}_{i}"; |
| | | if ("NoRead".Equals(p.BasketCode)) |
| | | { |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Error, $"{p.PID}_{p.SEQUENCE}获取框具码失败 赋值Noread"); |
| | |
| | | |
| | | //初始化产品的检测次数 |
| | | var checkIndexList = M141Config.MeasureBindCollection.Where(u => u.WorkPosition == b.WorkPosition && u.ProductIndices.Contains(i)).Select(u => u.CheckIndex).OrderBy(u => u).ToList(); |
| | | p.InitialPositionCheckList(b.WorkPosition, checkIndexList); |
| | | p.InitialPositionCheckList(b.WorkPosition, checkIndexList, M141Config.StationCode); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"产品{p.PID}_{p.SEQUENCE}已清理{b.WorkPosition}检测数据。当前已完成工位{string.Join(",", p.Details.Select(u => u.PositionName))}"); |
| | | |
| | | }); |
| | | |
| | | //初始化工位的检测次数 |
| | |
| | | newp.BasketCode = p.BasketCode; |
| | | newp.Result = p.Result; |
| | | newp.SN = p.SN; |
| | | |
| | | Thread.Sleep(500); |
| | | var plist = mysqlhelper.GetProductList(p.SEQUENCE); |
| | | |
| | | |
| | |
| | | newp.Details.AddRange(item.Details); |
| | | } |
| | | } |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Error, $"AllDeviceProductRecord从数据库获取到数据{p.SEQUENCE} plist数量{plist.Count} Details数量{newp.Details.Count}"); |
| | | |
| | | //newp.Details.AddRange(p.Details); |
| | | |