peizhiyong
2025-08-01 73d6d058983ff914e5092bba4b2c403eef2caec5
src/Bro.M141.Process/M141Process.cs
@@ -589,7 +589,8 @@
                                {
                                    item1.IsAbandoned = false;
                                    item1.FinalResult = ResultState.NG;
                                    LogAsync(DateTime.Now, EnumHelper.LogLevel.Action, $"产品{products[0].PID}_{products[0].SEQUENCE}工位{measureBind.WorkPosition}   S3S5组合检测检出缺陷:{item1.NetName}");
                                    //products[0].Result = M141Config.defectname;
                                    LogAsync(DateTime.Now, EnumHelper.LogLevel.Action, $"产品{products[0].PID}_{products[0].SEQUENCE}工位{measureBind.WorkPosition}   S3S5组合检测检出缺陷:{item1.NetName},产品结果为{products[0].Result}");
                                    break;
                                }
                            }
@@ -695,10 +696,19 @@
                                    }
                                    string ngImageFile = Path.Combine(folder, $"{id}.{post}");
                                    var bitmap = imgSet.HImage.ConvertHImageToBitmap();
                                    bitmap.Save(ngImageFile, M141Config.ImageFormatNG);
                                    LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"{id}NG图片已保存");
                                    bitmap.Dispose();
                                    //var bitmap = imgSet.HImage.ConvertHImageToBitmap();
                                    //bitmap.Save(ngImageFile, M141Config.ImageFormatNG);
                                    //LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"{id}NG图片已保存");
                                    //bitmap.Dispose();
                                    try
                                    {
                                        LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"{id}NG图片测试转存{ngImageFile}");
                                        imgSet.HImage.WriteImage(M141Config.ImageFormatOK.ToString().ToLower(), 0, ngImageFile);
                                    }
                                    catch (Exception)
                                    {
                                        LogAsync(DateTime.Now, EnumHelper.LogLevel.Error, $"{id}NG图片保存失败");
                                    }
                                }
                            }
                        }
@@ -731,11 +741,20 @@
                                        post = M141Config.ImageFormatOK.ToString().ToLower();
                                    }
                                    string ngImageFile = Path.Combine(folder, $"{id}.{post}");
                                    var bitmap = imgSet.HImage.ConvertHImageToBitmap();
                                    bitmap.Save(ngImageFile, M141Config.ImageFormatOK);
                                    LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"{id}OK图片已保存");
                                    bitmap.Dispose();
                                    string ngImageFile = Path.Combine(folder, $"{id}.{post}");
                                    //var bitmap = imgSet.HImage.ConvertHImageToBitmap();
                                    //bitmap.Save(ngImageFile, M141Config.ImageFormatOK);
                                    //LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"{id}OK图片已保存");
                                    //bitmap.Dispose();
                                    try
                                    {
                                        LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"{id}OK图片测试转存{ngImageFile}");
                                        imgSet.HImage.WriteImage(M141Config.ImageFormatOK.ToString().ToLower(), 0, ngImageFile);
                                    }
                                    catch (Exception)
                                    {
                                        LogAsync(DateTime.Now, EnumHelper.LogLevel.Error, $"{id}OK图片保存失败");
                                    }
                                }
                            }
                        }