diff --git a/halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs b/halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs index ec35e4c1..2b2b6421 100644 --- a/halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs +++ b/halftoneproject-master/BanBoShi/SysCtrl/SysMgr.cs @@ -4204,7 +4204,7 @@ namespace MaiMuAOI.SysCtrl path = Util.CreateSubDir(confMgr.SysConfigParams.DefectSmallImag.SavePath, new List { order.CreateTime.ToString("yyyyMMdd"), order.SN }); path += $"Defect_SN{order.SN}_I{res.index}_X{res.Xmm}_Y{res.Ymm}_{model.StepInfo.Name}"; - if (res.bmps_tag.Count() != indexList.Count) + if (confMgr.SysConfigParams.OpenFlawDistribution && res.bmps_tag.Count() != indexList.Count) Log($"{res.stepIndex + 1}-{res.processName}", $"缺陷图片张数和index对不上:{res.bmps_tag.Count()} - {indexList.Count}", WarningEnum.Low); for (int i = 0; i < res.bmps_tag.Count(); i++) { @@ -9212,7 +9212,7 @@ namespace MaiMuAOI.SysCtrl path = Util.CreateSubDir(confMgr.SysConfigParams.DefectSmallImag.SavePath, new List { order.CreateTime.ToString("yyyyMMdd"), order.SN }); path += $"Defect_SN{order.SN}_I{res.index}_X{res.Xmm}_Y{res.Ymm}_{picName}"; - if (res.bmps_tag.Count() != indexList.Count) + if (confMgr.SysConfigParams.OpenFlawDistribution && res.bmps_tag.Count() != indexList.Count) Log($"{res.stepIndex + 1}-{res.processName}", $"缺陷图片张数和index对不上:{res.bmps_tag.Count()} - {indexList.Count}", WarningEnum.Low); for (int i = 0; i < res.bmps_tag.Count(); i++) { diff --git a/halftoneproject-master/BanBoShi/SysCtrl/SysUpdata.cs b/halftoneproject-master/BanBoShi/SysCtrl/SysUpdata.cs index d187a034..51cba6ab 100644 --- a/halftoneproject-master/BanBoShi/SysCtrl/SysUpdata.cs +++ b/halftoneproject-master/BanBoShi/SysCtrl/SysUpdata.cs @@ -76,6 +76,7 @@ namespace MaiMuAOI.SysCtrl "\t4.加入3道鱼叉口宽,3道鱼叉口间隔\r\n" + "\t5.导出表格加入上下限,按工序分sheet,加入蜈蚣脚平行段长度\r\n" + "\t6.excle导出列自动生成\r\n" + - "\t7.加入尺寸检测,主栅焊点间隔\r\n"; + "\t7.加入尺寸检测,主栅焊点间隔\r\n" + + "\t8.加入比对设置参数\r\n"; } } diff --git a/halftoneproject-master/BanBoShi/SysUI/ProductAndStep/ProductInfoFrm.Designer.cs b/halftoneproject-master/BanBoShi/SysUI/ProductAndStep/ProductInfoFrm.Designer.cs index 6c365c63..d79da13c 100644 --- a/halftoneproject-master/BanBoShi/SysUI/ProductAndStep/ProductInfoFrm.Designer.cs +++ b/halftoneproject-master/BanBoShi/SysUI/ProductAndStep/ProductInfoFrm.Designer.cs @@ -327,6 +327,8 @@ this.toolTip1 = new System.Windows.Forms.ToolTip(this.components); this.uiTitel1 = new MaiMuControl.UIKits.MaiMuMenu.UITitel(); this.cbWangJie = new System.Windows.Forms.CheckBox(); + this.numWM = new System.Windows.Forms.NumericUpDown(); + this.label89 = new System.Windows.Forms.Label(); this.toolStrip1.SuspendLayout(); this.tabControl1.SuspendLayout(); this.tabPage1.SuspendLayout(); @@ -479,6 +481,7 @@ this.groupBox28.SuspendLayout(); this.panel28.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.numWM)).BeginInit(); this.SuspendLayout(); // // toolStrip1 @@ -934,11 +937,13 @@ this.groupBox6.Size = new System.Drawing.Size(629, 461); this.groupBox6.TabIndex = 33; this.groupBox6.TabStop = false; - this.groupBox6.Text = "Mark点设置"; + this.groupBox6.Text = "图纸设置"; // // panel5 // this.panel5.BackColor = System.Drawing.Color.White; + this.panel5.Controls.Add(this.label89); + this.panel5.Controls.Add(this.numWM); this.panel5.Controls.Add(this.cbWangJie); this.panel5.Controls.Add(this.cbHavePad); this.panel5.Controls.Add(this.label25); @@ -4356,6 +4361,36 @@ this.cbWangJie.Text = "是否有网结"; this.cbWangJie.UseVisualStyleBackColor = true; // + // numWM + // + this.numWM.DecimalPlaces = 1; + this.numWM.Location = new System.Drawing.Point(194, 292); + this.numWM.Margin = new System.Windows.Forms.Padding(2); + this.numWM.Maximum = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + this.numWM.Name = "numWM"; + this.numWM.Size = new System.Drawing.Size(80, 21); + this.numWM.TabIndex = 16; + this.numWM.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // label89 + // + this.label89.AutoSize = true; + this.label89.ForeColor = System.Drawing.SystemColors.ControlText; + this.label89.Location = new System.Drawing.Point(77, 294); + this.label89.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label89.Name = "label89"; + this.label89.Size = new System.Drawing.Size(113, 12); + this.label89.TabIndex = 18; + this.label89.Text = "图纸比对精度(网目)"; + // // ProductInfoFrm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -4549,6 +4584,7 @@ this.panel28.ResumeLayout(false); this.panel28.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.numWM)).EndInit(); this.ResumeLayout(false); this.PerformLayout(); @@ -4839,5 +4875,7 @@ private System.Windows.Forms.CheckBox cbOrderSave; private System.Windows.Forms.Label label88; private System.Windows.Forms.CheckBox cbWangJie; + private System.Windows.Forms.NumericUpDown numWM; + private System.Windows.Forms.Label label89; } } \ No newline at end of file diff --git a/halftoneproject-master/BanBoShi/SysUI/ProductAndStep/ProductInfoFrm.cs b/halftoneproject-master/BanBoShi/SysUI/ProductAndStep/ProductInfoFrm.cs index 797a5264..afcef460 100644 --- a/halftoneproject-master/BanBoShi/SysUI/ProductAndStep/ProductInfoFrm.cs +++ b/halftoneproject-master/BanBoShi/SysUI/ProductAndStep/ProductInfoFrm.cs @@ -19,6 +19,7 @@ using System.Threading.Tasks; using System.Windows.Forms; using ToolKits.EnumTool; using ToolKits.mAPI; +using Yolo5; namespace MaiMuAOI.SysUI.ProductAndStep { @@ -186,6 +187,9 @@ namespace MaiMuAOI.SysUI.ProductAndStep //2024-5-10 网节 this.cbWangJie.Checked = (m.HaveWJ == 1); + //this.cbOpenWM.Checked = m.OpenWM; + this.numWM.Value = (decimal)m.WangMuThresh; + Models.Attachment attachmentFile = model.AttachmentList.FirstOrDefault(x => x.Type == 0); if (attachmentFile != null) { @@ -591,6 +595,28 @@ namespace MaiMuAOI.SysUI.ProductAndStep model.EnableOrderSave = cbOrderSave.Checked; model.OrderSavePath = tbSavePath.Text; + + + //设置比对参数 + Yolo_Class yolo_Class = new Yolo_Class(); + if (model.AttachmentList == null || model.AttachmentList.Count == 0) + { + MessageBox.Show("图纸未上传,跳过图纸比对参数设置!"); + } + else + { + var attachmentFile = model.AttachmentList.FirstOrDefault(x => x.Type == 0); + string gbxBmpPath = ConfMgr.Instance.ProjectDir + $"\\{attachmentFile.NameTimestamp}"; + if (!yolo_Class.WriteCustomThresh(gbxBmpPath, (double)numWM.Value)) + { + MessageBox.Show($"比对精度设置失败!请检测 {gbxBmpPath} 图纸是否存在!"); + } + else + { + //model.OpenWM = cbOpenWM.Checked; + model.WangMuThresh = (double)numWM.Value; + } + } ///////////////////////////////////////////////// /// bool result; diff --git a/halftoneproject-master/Models/Product.cs b/halftoneproject-master/Models/Product.cs index 307cf766..5014f5b7 100644 --- a/halftoneproject-master/Models/Product.cs +++ b/halftoneproject-master/Models/Product.cs @@ -215,6 +215,10 @@ namespace Models [SugarColumn(IsNullable = true)] public int HaveWJ { get; set; } + //2024-9-12 设置比对精度 + [SugarColumn(IsNullable = true)] + public double WangMuThresh { get; set; } + //2024 03-12 加入打印内容绑定产品 #region 打印 [SugarColumn(IsNullable = true)]