diff --git a/halftoneproject-master/DefectInferTool/DefectInferTool.csproj b/halftoneproject-master/DefectInferTool/DefectInferTool.csproj index 3cd04429..b7170792 100644 --- a/halftoneproject-master/DefectInferTool/DefectInferTool.csproj +++ b/halftoneproject-master/DefectInferTool/DefectInferTool.csproj @@ -37,6 +37,17 @@ 4 + + ..\..\..\..\开发文件\标定\CalTools.dll + + + False + ..\BanBoShi\Dlls\halcondotnet.dll + + + False + ..\BanBoShi\Dlls\hdevenginedotnet.dll + ..\AssistClient\bin\Debug\Microsoft.ML.OnnxRuntime.dll diff --git a/halftoneproject-master/DefectInferTool/Form1.Designer.cs b/halftoneproject-master/DefectInferTool/Form1.Designer.cs index ba732d2a..37e8176c 100644 --- a/halftoneproject-master/DefectInferTool/Form1.Designer.cs +++ b/halftoneproject-master/DefectInferTool/Form1.Designer.cs @@ -52,6 +52,66 @@ this.numericUpDown5 = new System.Windows.Forms.NumericUpDown(); this.lstLog = new System.Windows.Forms.ListBox(); this.checkBox2 = new System.Windows.Forms.CheckBox(); + this.tabControl1 = new System.Windows.Forms.TabControl(); + this.tabPage1 = new System.Windows.Forms.TabPage(); + this.tabPage2 = new System.Windows.Forms.TabPage(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.tbTZPath = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.tbSFPath = new System.Windows.Forms.TextBox(); + this.markX1 = new System.Windows.Forms.NumericUpDown(); + this.MarkY1 = new System.Windows.Forms.NumericUpDown(); + this.label4 = new System.Windows.Forms.Label(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.label7 = new System.Windows.Forms.Label(); + this.MarkY2 = new System.Windows.Forms.NumericUpDown(); + this.markX2 = new System.Windows.Forms.NumericUpDown(); + this.label8 = new System.Windows.Forms.Label(); + this.label9 = new System.Windows.Forms.Label(); + this.MarkY3 = new System.Windows.Forms.NumericUpDown(); + this.markX3 = new System.Windows.Forms.NumericUpDown(); + this.label10 = new System.Windows.Forms.Label(); + this.label11 = new System.Windows.Forms.Label(); + this.MarkY4 = new System.Windows.Forms.NumericUpDown(); + this.markX4 = new System.Windows.Forms.NumericUpDown(); + this.label12 = new System.Windows.Forms.Label(); + this.ZPos = new System.Windows.Forms.NumericUpDown(); + this.btnMarkCal = new System.Windows.Forms.Button(); + this.groupBox7 = new System.Windows.Forms.GroupBox(); + this.groupBox8 = new System.Windows.Forms.GroupBox(); + this.label13 = new System.Windows.Forms.Label(); + this.qx_markX1 = new System.Windows.Forms.NumericUpDown(); + this.qx_markY1 = new System.Windows.Forms.NumericUpDown(); + this.label15 = new System.Windows.Forms.Label(); + this.label16 = new System.Windows.Forms.Label(); + this.qx_markX2 = new System.Windows.Forms.NumericUpDown(); + this.label17 = new System.Windows.Forms.Label(); + this.qx_markY4 = new System.Windows.Forms.NumericUpDown(); + this.qx_markY2 = new System.Windows.Forms.NumericUpDown(); + this.qx_markX4 = new System.Windows.Forms.NumericUpDown(); + this.label18 = new System.Windows.Forms.Label(); + this.label19 = new System.Windows.Forms.Label(); + this.label20 = new System.Windows.Forms.Label(); + this.label21 = new System.Windows.Forms.Label(); + this.qx_markX3 = new System.Windows.Forms.NumericUpDown(); + this.qx_markY3 = new System.Windows.Forms.NumericUpDown(); + this.btnNoMarkCal = new System.Windows.Forms.Button(); + this.groupBox9 = new System.Windows.Forms.GroupBox(); + this.btnCal = new System.Windows.Forms.Button(); + this.groupBox11 = new System.Windows.Forms.GroupBox(); + this.label29 = new System.Windows.Forms.Label(); + this.bX1 = new System.Windows.Forms.NumericUpDown(); + this.bY1 = new System.Windows.Forms.NumericUpDown(); + this.label31 = new System.Windows.Forms.Label(); + this.label40 = new System.Windows.Forms.Label(); + this.label41 = new System.Windows.Forms.Label(); + this.groupBox10 = new System.Windows.Forms.GroupBox(); + this.label14 = new System.Windows.Forms.Label(); + this.aX1 = new System.Windows.Forms.NumericUpDown(); + this.aY1 = new System.Windows.Forms.NumericUpDown(); + this.label22 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); this.gboxDefectList.SuspendLayout(); this.groupBox3.SuspendLayout(); @@ -64,6 +124,36 @@ ((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).BeginInit(); this.groupBox6.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).BeginInit(); + this.tabControl1.SuspendLayout(); + this.tabPage1.SuspendLayout(); + this.tabPage2.SuspendLayout(); + this.groupBox2.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.markX1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.MarkY1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.MarkY2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.markX2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.MarkY3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.markX3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.MarkY4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.markX4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.ZPos)).BeginInit(); + this.groupBox7.SuspendLayout(); + this.groupBox8.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.qx_markX1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.qx_markY1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.qx_markX2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.qx_markY4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.qx_markY2)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.qx_markX4)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.qx_markX3)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.qx_markY3)).BeginInit(); + this.groupBox9.SuspendLayout(); + this.groupBox11.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.bX1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.bY1)).BeginInit(); + this.groupBox10.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.aX1)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.aY1)).BeginInit(); this.SuspendLayout(); // // flpQualifiedPannel @@ -81,7 +171,7 @@ // groupBox1 // this.groupBox1.Controls.Add(this.flpQualifiedPannel); - this.groupBox1.Location = new System.Drawing.Point(12, 197); + this.groupBox1.Location = new System.Drawing.Point(6, 194); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(598, 436); this.groupBox1.TabIndex = 2; @@ -90,7 +180,7 @@ // // button1 // - this.button1.Location = new System.Drawing.Point(15, 54); + this.button1.Location = new System.Drawing.Point(9, 51); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(143, 23); this.button1.TabIndex = 3; @@ -100,7 +190,7 @@ // // textBox1 // - this.textBox1.Location = new System.Drawing.Point(614, 12); + this.textBox1.Location = new System.Drawing.Point(608, 9); this.textBox1.Multiline = true; this.textBox1.Name = "textBox1"; this.textBox1.Size = new System.Drawing.Size(491, 119); @@ -109,7 +199,7 @@ // gboxDefectList // this.gboxDefectList.Controls.Add(this.pnlBmpList); - this.gboxDefectList.Location = new System.Drawing.Point(616, 210); + this.gboxDefectList.Location = new System.Drawing.Point(610, 207); this.gboxDefectList.Name = "gboxDefectList"; this.gboxDefectList.Size = new System.Drawing.Size(489, 423); this.gboxDefectList.TabIndex = 5; @@ -133,21 +223,21 @@ // // textBox3 // - this.textBox3.Location = new System.Drawing.Point(193, 56); + this.textBox3.Location = new System.Drawing.Point(187, 53); this.textBox3.Name = "textBox3"; this.textBox3.Size = new System.Drawing.Size(393, 21); this.textBox3.TabIndex = 7; // // textBox4 // - this.textBox4.Location = new System.Drawing.Point(193, 91); + this.textBox4.Location = new System.Drawing.Point(187, 88); this.textBox4.Name = "textBox4"; this.textBox4.Size = new System.Drawing.Size(393, 21); this.textBox4.TabIndex = 8; // // button2 // - this.button2.Location = new System.Drawing.Point(15, 89); + this.button2.Location = new System.Drawing.Point(9, 86); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(143, 23); this.button2.TabIndex = 9; @@ -158,7 +248,7 @@ // comboBox1 // this.comboBox1.FormattingEnabled = true; - this.comboBox1.Location = new System.Drawing.Point(193, 22); + this.comboBox1.Location = new System.Drawing.Point(187, 19); this.comboBox1.Name = "comboBox1"; this.comboBox1.Size = new System.Drawing.Size(393, 20); this.comboBox1.TabIndex = 10; @@ -167,7 +257,7 @@ // label1 // this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(105, 25); + this.label1.Location = new System.Drawing.Point(99, 22); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(53, 12); this.label1.TabIndex = 11; @@ -178,7 +268,7 @@ this.checkBox1.AutoSize = true; this.checkBox1.Checked = true; this.checkBox1.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBox1.Location = new System.Drawing.Point(164, 122); + this.checkBox1.Location = new System.Drawing.Point(158, 119); this.checkBox1.Name = "checkBox1"; this.checkBox1.Size = new System.Drawing.Size(96, 16); this.checkBox1.TabIndex = 12; @@ -189,7 +279,7 @@ // this.groupBox3.Controls.Add(this.numericUpDown2); this.groupBox3.Controls.Add(this.numericUpDown1); - this.groupBox3.Location = new System.Drawing.Point(164, 144); + this.groupBox3.Location = new System.Drawing.Point(158, 141); this.groupBox3.Name = "groupBox3"; this.groupBox3.Size = new System.Drawing.Size(163, 47); this.groupBox3.TabIndex = 13; @@ -224,7 +314,7 @@ // this.groupBox4.Controls.Add(this.numericUpDown3); this.groupBox4.Controls.Add(this.numericUpDown4); - this.groupBox4.Location = new System.Drawing.Point(333, 144); + this.groupBox4.Location = new System.Drawing.Point(327, 141); this.groupBox4.Name = "groupBox4"; this.groupBox4.Size = new System.Drawing.Size(163, 47); this.groupBox4.TabIndex = 14; @@ -258,7 +348,7 @@ // groupBox5 // this.groupBox5.Controls.Add(this.numericUpDown6); - this.groupBox5.Location = new System.Drawing.Point(502, 144); + this.groupBox5.Location = new System.Drawing.Point(496, 141); this.groupBox5.Name = "groupBox5"; this.groupBox5.Size = new System.Drawing.Size(84, 47); this.groupBox5.TabIndex = 15; @@ -286,7 +376,7 @@ // groupBox6 // this.groupBox6.Controls.Add(this.numericUpDown5); - this.groupBox6.Location = new System.Drawing.Point(74, 144); + this.groupBox6.Location = new System.Drawing.Point(68, 141); this.groupBox6.Name = "groupBox6"; this.groupBox6.Size = new System.Drawing.Size(84, 47); this.groupBox6.TabIndex = 16; @@ -314,7 +404,7 @@ // this.lstLog.FormattingEnabled = true; this.lstLog.ItemHeight = 12; - this.lstLog.Location = new System.Drawing.Point(614, 137); + this.lstLog.Location = new System.Drawing.Point(608, 134); this.lstLog.Name = "lstLog"; this.lstLog.Size = new System.Drawing.Size(491, 64); this.lstLog.TabIndex = 17; @@ -322,34 +412,831 @@ // checkBox2 // this.checkBox2.AutoSize = true; - this.checkBox2.Location = new System.Drawing.Point(12, 24); + this.checkBox2.Location = new System.Drawing.Point(6, 21); this.checkBox2.Name = "checkBox2"; this.checkBox2.Size = new System.Drawing.Size(66, 16); this.checkBox2.TabIndex = 18; this.checkBox2.Text = "使用GPU"; this.checkBox2.UseVisualStyleBackColor = true; // + // tabControl1 + // + this.tabControl1.Controls.Add(this.tabPage1); + this.tabControl1.Controls.Add(this.tabPage2); + this.tabControl1.Location = new System.Drawing.Point(2, 1); + this.tabControl1.Name = "tabControl1"; + this.tabControl1.SelectedIndex = 0; + this.tabControl1.Size = new System.Drawing.Size(1113, 661); + this.tabControl1.TabIndex = 19; + // + // tabPage1 + // + this.tabPage1.Controls.Add(this.checkBox2); + this.tabPage1.Controls.Add(this.groupBox1); + this.tabPage1.Controls.Add(this.lstLog); + this.tabPage1.Controls.Add(this.button1); + this.tabPage1.Controls.Add(this.groupBox6); + this.tabPage1.Controls.Add(this.textBox1); + this.tabPage1.Controls.Add(this.groupBox5); + this.tabPage1.Controls.Add(this.gboxDefectList); + this.tabPage1.Controls.Add(this.groupBox4); + this.tabPage1.Controls.Add(this.textBox3); + this.tabPage1.Controls.Add(this.groupBox3); + this.tabPage1.Controls.Add(this.textBox4); + this.tabPage1.Controls.Add(this.checkBox1); + this.tabPage1.Controls.Add(this.button2); + this.tabPage1.Controls.Add(this.label1); + this.tabPage1.Controls.Add(this.comboBox1); + this.tabPage1.Location = new System.Drawing.Point(4, 22); + this.tabPage1.Name = "tabPage1"; + this.tabPage1.Padding = new System.Windows.Forms.Padding(3); + this.tabPage1.Size = new System.Drawing.Size(1105, 635); + this.tabPage1.TabIndex = 0; + this.tabPage1.Text = "推理"; + this.tabPage1.UseVisualStyleBackColor = true; + // + // tabPage2 + // + this.tabPage2.Controls.Add(this.groupBox9); + this.tabPage2.Controls.Add(this.groupBox2); + this.tabPage2.Location = new System.Drawing.Point(4, 22); + this.tabPage2.Name = "tabPage2"; + this.tabPage2.Padding = new System.Windows.Forms.Padding(3); + this.tabPage2.Size = new System.Drawing.Size(1105, 635); + this.tabPage2.TabIndex = 1; + this.tabPage2.Text = "标定"; + this.tabPage2.UseVisualStyleBackColor = true; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.label40); + this.groupBox2.Controls.Add(this.btnNoMarkCal); + this.groupBox2.Controls.Add(this.groupBox8); + this.groupBox2.Controls.Add(this.groupBox7); + this.groupBox2.Controls.Add(this.btnMarkCal); + this.groupBox2.Controls.Add(this.label3); + this.groupBox2.Controls.Add(this.tbSFPath); + this.groupBox2.Controls.Add(this.label2); + this.groupBox2.Controls.Add(this.tbTZPath); + this.groupBox2.Location = new System.Drawing.Point(6, 18); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(547, 611); + this.groupBox2.TabIndex = 0; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "主机台标定"; + // + // tbTZPath + // + this.tbTZPath.Location = new System.Drawing.Point(99, 39); + this.tbTZPath.Multiline = true; + this.tbTZPath.Name = "tbTZPath"; + this.tbTZPath.Size = new System.Drawing.Size(420, 41); + this.tbTZPath.TabIndex = 8; + this.tbTZPath.Click += new System.EventHandler(this.tbTZPath_Click); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(6, 42); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(89, 12); + this.label2.TabIndex = 9; + this.label2.Text = "图纸文件路径:"; + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(6, 89); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(89, 12); + this.label3.TabIndex = 11; + this.label3.Text = "算法文件路径:"; + // + // tbSFPath + // + this.tbSFPath.Location = new System.Drawing.Point(99, 86); + this.tbSFPath.Multiline = true; + this.tbSFPath.Name = "tbSFPath"; + this.tbSFPath.Size = new System.Drawing.Size(420, 35); + this.tbSFPath.TabIndex = 10; + this.tbSFPath.Text = "C:\\Users\\user\\AppData\\Local\\Programs\\MVTec\\HALCON-21.05-Progress\\procedures\\gener" + + "al"; + this.tbSFPath.Click += new System.EventHandler(this.tbSFPath_Click); + // + // markX1 + // + this.markX1.DecimalPlaces = 4; + this.markX1.Location = new System.Drawing.Point(93, 29); + this.markX1.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.markX1.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.markX1.Name = "markX1"; + this.markX1.Size = new System.Drawing.Size(120, 21); + this.markX1.TabIndex = 12; + // + // MarkY1 + // + this.MarkY1.DecimalPlaces = 4; + this.MarkY1.Location = new System.Drawing.Point(93, 56); + this.MarkY1.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.MarkY1.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.MarkY1.Name = "MarkY1"; + this.MarkY1.Size = new System.Drawing.Size(120, 21); + this.MarkY1.TabIndex = 13; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(26, 31); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(47, 12); + this.label4.TabIndex = 14; + this.label4.Text = "mark1 X"; + // + // label5 + // + this.label5.AutoSize = true; + this.label5.Location = new System.Drawing.Point(26, 58); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(47, 12); + this.label5.TabIndex = 15; + this.label5.Text = "mark1 Y"; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(297, 58); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(47, 12); + this.label6.TabIndex = 19; + this.label6.Text = "mark2 Y"; + // + // label7 + // + this.label7.AutoSize = true; + this.label7.Location = new System.Drawing.Point(297, 31); + this.label7.Name = "label7"; + this.label7.Size = new System.Drawing.Size(47, 12); + this.label7.TabIndex = 18; + this.label7.Text = "mark2 X"; + // + // MarkY2 + // + this.MarkY2.DecimalPlaces = 4; + this.MarkY2.Location = new System.Drawing.Point(364, 56); + this.MarkY2.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.MarkY2.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.MarkY2.Name = "MarkY2"; + this.MarkY2.Size = new System.Drawing.Size(120, 21); + this.MarkY2.TabIndex = 17; + // + // markX2 + // + this.markX2.DecimalPlaces = 4; + this.markX2.Location = new System.Drawing.Point(364, 29); + this.markX2.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.markX2.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.markX2.Name = "markX2"; + this.markX2.Size = new System.Drawing.Size(120, 21); + this.markX2.TabIndex = 16; + // + // label8 + // + this.label8.AutoSize = true; + this.label8.Location = new System.Drawing.Point(26, 138); + this.label8.Name = "label8"; + this.label8.Size = new System.Drawing.Size(47, 12); + this.label8.TabIndex = 23; + this.label8.Text = "mark3 Y"; + // + // label9 + // + this.label9.AutoSize = true; + this.label9.Location = new System.Drawing.Point(26, 111); + this.label9.Name = "label9"; + this.label9.Size = new System.Drawing.Size(47, 12); + this.label9.TabIndex = 22; + this.label9.Text = "mark3 X"; + // + // MarkY3 + // + this.MarkY3.DecimalPlaces = 4; + this.MarkY3.Location = new System.Drawing.Point(93, 136); + this.MarkY3.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.MarkY3.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.MarkY3.Name = "MarkY3"; + this.MarkY3.Size = new System.Drawing.Size(120, 21); + this.MarkY3.TabIndex = 21; + // + // markX3 + // + this.markX3.DecimalPlaces = 4; + this.markX3.Location = new System.Drawing.Point(93, 109); + this.markX3.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.markX3.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.markX3.Name = "markX3"; + this.markX3.Size = new System.Drawing.Size(120, 21); + this.markX3.TabIndex = 20; + // + // label10 + // + this.label10.AutoSize = true; + this.label10.Location = new System.Drawing.Point(297, 138); + this.label10.Name = "label10"; + this.label10.Size = new System.Drawing.Size(47, 12); + this.label10.TabIndex = 27; + this.label10.Text = "mark4 Y"; + // + // label11 + // + this.label11.AutoSize = true; + this.label11.Location = new System.Drawing.Point(297, 111); + this.label11.Name = "label11"; + this.label11.Size = new System.Drawing.Size(47, 12); + this.label11.TabIndex = 26; + this.label11.Text = "mark4 X"; + // + // MarkY4 + // + this.MarkY4.DecimalPlaces = 4; + this.MarkY4.Location = new System.Drawing.Point(364, 136); + this.MarkY4.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.MarkY4.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.MarkY4.Name = "MarkY4"; + this.MarkY4.Size = new System.Drawing.Size(120, 21); + this.MarkY4.TabIndex = 25; + // + // markX4 + // + this.markX4.DecimalPlaces = 4; + this.markX4.Location = new System.Drawing.Point(364, 109); + this.markX4.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.markX4.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.markX4.Name = "markX4"; + this.markX4.Size = new System.Drawing.Size(120, 21); + this.markX4.TabIndex = 24; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Location = new System.Drawing.Point(26, 179); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(191, 12); + this.label12.TabIndex = 29; + this.label12.Text = "尺寸相机7.5X下对焦清晰,z轴坐标"; + // + // ZPos + // + this.ZPos.DecimalPlaces = 4; + this.ZPos.Location = new System.Drawing.Point(245, 177); + this.ZPos.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.ZPos.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.ZPos.Name = "ZPos"; + this.ZPos.Size = new System.Drawing.Size(120, 21); + this.ZPos.TabIndex = 28; + // + // btnMarkCal + // + this.btnMarkCal.Location = new System.Drawing.Point(34, 544); + this.btnMarkCal.Name = "btnMarkCal"; + this.btnMarkCal.Size = new System.Drawing.Size(174, 23); + this.btnMarkCal.TabIndex = 30; + this.btnMarkCal.Text = "有Mark点标定计算"; + this.btnMarkCal.UseVisualStyleBackColor = true; + this.btnMarkCal.Click += new System.EventHandler(this.btnMarkCal_Click); + // + // groupBox7 + // + this.groupBox7.Controls.Add(this.label4); + this.groupBox7.Controls.Add(this.markX1); + this.groupBox7.Controls.Add(this.label12); + this.groupBox7.Controls.Add(this.ZPos); + this.groupBox7.Controls.Add(this.MarkY1); + this.groupBox7.Controls.Add(this.label5); + this.groupBox7.Controls.Add(this.label10); + this.groupBox7.Controls.Add(this.markX2); + this.groupBox7.Controls.Add(this.label11); + this.groupBox7.Controls.Add(this.MarkY4); + this.groupBox7.Controls.Add(this.MarkY2); + this.groupBox7.Controls.Add(this.markX4); + this.groupBox7.Controls.Add(this.label7); + this.groupBox7.Controls.Add(this.label8); + this.groupBox7.Controls.Add(this.label6); + this.groupBox7.Controls.Add(this.label9); + this.groupBox7.Controls.Add(this.markX3); + this.groupBox7.Controls.Add(this.MarkY3); + this.groupBox7.Location = new System.Drawing.Point(6, 135); + this.groupBox7.Name = "groupBox7"; + this.groupBox7.Size = new System.Drawing.Size(533, 210); + this.groupBox7.TabIndex = 31; + this.groupBox7.TabStop = false; + this.groupBox7.Text = "尺寸相机参数"; + // + // groupBox8 + // + this.groupBox8.Controls.Add(this.label13); + this.groupBox8.Controls.Add(this.qx_markX1); + this.groupBox8.Controls.Add(this.qx_markY1); + this.groupBox8.Controls.Add(this.label15); + this.groupBox8.Controls.Add(this.label16); + this.groupBox8.Controls.Add(this.qx_markX2); + this.groupBox8.Controls.Add(this.label17); + this.groupBox8.Controls.Add(this.qx_markY4); + this.groupBox8.Controls.Add(this.qx_markY2); + this.groupBox8.Controls.Add(this.qx_markX4); + this.groupBox8.Controls.Add(this.label18); + this.groupBox8.Controls.Add(this.label19); + this.groupBox8.Controls.Add(this.label20); + this.groupBox8.Controls.Add(this.label21); + this.groupBox8.Controls.Add(this.qx_markX3); + this.groupBox8.Controls.Add(this.qx_markY3); + this.groupBox8.Location = new System.Drawing.Point(8, 351); + this.groupBox8.Name = "groupBox8"; + this.groupBox8.Size = new System.Drawing.Size(533, 175); + this.groupBox8.TabIndex = 32; + this.groupBox8.TabStop = false; + this.groupBox8.Text = "缺陷相机参数"; + // + // label13 + // + this.label13.AutoSize = true; + this.label13.Location = new System.Drawing.Point(24, 31); + this.label13.Name = "label13"; + this.label13.Size = new System.Drawing.Size(47, 12); + this.label13.TabIndex = 14; + this.label13.Text = "mark1 X"; + // + // qx_markX1 + // + this.qx_markX1.DecimalPlaces = 4; + this.qx_markX1.Location = new System.Drawing.Point(91, 29); + this.qx_markX1.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.qx_markX1.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.qx_markX1.Name = "qx_markX1"; + this.qx_markX1.Size = new System.Drawing.Size(120, 21); + this.qx_markX1.TabIndex = 12; + // + // qx_markY1 + // + this.qx_markY1.DecimalPlaces = 4; + this.qx_markY1.Location = new System.Drawing.Point(91, 56); + this.qx_markY1.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.qx_markY1.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.qx_markY1.Name = "qx_markY1"; + this.qx_markY1.Size = new System.Drawing.Size(120, 21); + this.qx_markY1.TabIndex = 13; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Location = new System.Drawing.Point(24, 58); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(47, 12); + this.label15.TabIndex = 15; + this.label15.Text = "mark1 Y"; + // + // label16 + // + this.label16.AutoSize = true; + this.label16.Location = new System.Drawing.Point(295, 138); + this.label16.Name = "label16"; + this.label16.Size = new System.Drawing.Size(47, 12); + this.label16.TabIndex = 27; + this.label16.Text = "mark4 Y"; + // + // qx_markX2 + // + this.qx_markX2.DecimalPlaces = 4; + this.qx_markX2.Location = new System.Drawing.Point(362, 29); + this.qx_markX2.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.qx_markX2.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.qx_markX2.Name = "qx_markX2"; + this.qx_markX2.Size = new System.Drawing.Size(120, 21); + this.qx_markX2.TabIndex = 16; + // + // label17 + // + this.label17.AutoSize = true; + this.label17.Location = new System.Drawing.Point(295, 111); + this.label17.Name = "label17"; + this.label17.Size = new System.Drawing.Size(47, 12); + this.label17.TabIndex = 26; + this.label17.Text = "mark4 X"; + // + // qx_markY4 + // + this.qx_markY4.DecimalPlaces = 4; + this.qx_markY4.Location = new System.Drawing.Point(362, 136); + this.qx_markY4.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.qx_markY4.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.qx_markY4.Name = "qx_markY4"; + this.qx_markY4.Size = new System.Drawing.Size(120, 21); + this.qx_markY4.TabIndex = 25; + // + // qx_markY2 + // + this.qx_markY2.DecimalPlaces = 4; + this.qx_markY2.Location = new System.Drawing.Point(362, 56); + this.qx_markY2.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.qx_markY2.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.qx_markY2.Name = "qx_markY2"; + this.qx_markY2.Size = new System.Drawing.Size(120, 21); + this.qx_markY2.TabIndex = 17; + // + // qx_markX4 + // + this.qx_markX4.DecimalPlaces = 4; + this.qx_markX4.Location = new System.Drawing.Point(362, 109); + this.qx_markX4.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.qx_markX4.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.qx_markX4.Name = "qx_markX4"; + this.qx_markX4.Size = new System.Drawing.Size(120, 21); + this.qx_markX4.TabIndex = 24; + // + // label18 + // + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(295, 31); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(47, 12); + this.label18.TabIndex = 18; + this.label18.Text = "mark2 X"; + // + // label19 + // + this.label19.AutoSize = true; + this.label19.Location = new System.Drawing.Point(24, 138); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(47, 12); + this.label19.TabIndex = 23; + this.label19.Text = "mark3 Y"; + // + // label20 + // + this.label20.AutoSize = true; + this.label20.Location = new System.Drawing.Point(295, 58); + this.label20.Name = "label20"; + this.label20.Size = new System.Drawing.Size(47, 12); + this.label20.TabIndex = 19; + this.label20.Text = "mark2 Y"; + // + // label21 + // + this.label21.AutoSize = true; + this.label21.Location = new System.Drawing.Point(24, 111); + this.label21.Name = "label21"; + this.label21.Size = new System.Drawing.Size(47, 12); + this.label21.TabIndex = 22; + this.label21.Text = "mark3 X"; + // + // qx_markX3 + // + this.qx_markX3.DecimalPlaces = 4; + this.qx_markX3.Location = new System.Drawing.Point(91, 109); + this.qx_markX3.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.qx_markX3.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.qx_markX3.Name = "qx_markX3"; + this.qx_markX3.Size = new System.Drawing.Size(120, 21); + this.qx_markX3.TabIndex = 20; + // + // qx_markY3 + // + this.qx_markY3.DecimalPlaces = 4; + this.qx_markY3.Location = new System.Drawing.Point(91, 136); + this.qx_markY3.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.qx_markY3.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.qx_markY3.Name = "qx_markY3"; + this.qx_markY3.Size = new System.Drawing.Size(120, 21); + this.qx_markY3.TabIndex = 21; + // + // btnNoMarkCal + // + this.btnNoMarkCal.Location = new System.Drawing.Point(305, 544); + this.btnNoMarkCal.Name = "btnNoMarkCal"; + this.btnNoMarkCal.Size = new System.Drawing.Size(174, 23); + this.btnNoMarkCal.TabIndex = 33; + this.btnNoMarkCal.Text = "无Mark点标定计算"; + this.btnNoMarkCal.UseVisualStyleBackColor = true; + this.btnNoMarkCal.Click += new System.EventHandler(this.btnNoMarkCal_Click); + // + // groupBox9 + // + this.groupBox9.Controls.Add(this.groupBox10); + this.groupBox9.Controls.Add(this.label41); + this.groupBox9.Controls.Add(this.btnCal); + this.groupBox9.Controls.Add(this.groupBox11); + this.groupBox9.Location = new System.Drawing.Point(562, 18); + this.groupBox9.Name = "groupBox9"; + this.groupBox9.Size = new System.Drawing.Size(547, 611); + this.groupBox9.TabIndex = 1; + this.groupBox9.TabStop = false; + this.groupBox9.Text = "修复台标定"; + // + // btnCal + // + this.btnCal.Location = new System.Drawing.Point(162, 456); + this.btnCal.Name = "btnCal"; + this.btnCal.Size = new System.Drawing.Size(174, 23); + this.btnCal.TabIndex = 33; + this.btnCal.Text = "修复台标定计算"; + this.btnCal.UseVisualStyleBackColor = true; + this.btnCal.Click += new System.EventHandler(this.btnCal_Click); + // + // groupBox11 + // + this.groupBox11.Controls.Add(this.label29); + this.groupBox11.Controls.Add(this.bX1); + this.groupBox11.Controls.Add(this.bY1); + this.groupBox11.Controls.Add(this.label31); + this.groupBox11.Location = new System.Drawing.Point(8, 89); + this.groupBox11.Name = "groupBox11"; + this.groupBox11.Size = new System.Drawing.Size(533, 103); + this.groupBox11.TabIndex = 31; + this.groupBox11.TabStop = false; + this.groupBox11.Text = "修复台XY轴调整前坐标"; + // + // label29 + // + this.label29.AutoSize = true; + this.label29.Location = new System.Drawing.Point(26, 48); + this.label29.Name = "label29"; + this.label29.Size = new System.Drawing.Size(47, 12); + this.label29.TabIndex = 14; + this.label29.Text = "Point X"; + // + // bX1 + // + this.bX1.DecimalPlaces = 4; + this.bX1.Location = new System.Drawing.Point(93, 46); + this.bX1.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.bX1.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.bX1.Name = "bX1"; + this.bX1.Size = new System.Drawing.Size(120, 21); + this.bX1.TabIndex = 12; + // + // bY1 + // + this.bY1.DecimalPlaces = 4; + this.bY1.Location = new System.Drawing.Point(348, 46); + this.bY1.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.bY1.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.bY1.Name = "bY1"; + this.bY1.Size = new System.Drawing.Size(120, 21); + this.bY1.TabIndex = 13; + // + // label31 + // + this.label31.AutoSize = true; + this.label31.Location = new System.Drawing.Point(281, 48); + this.label31.Name = "label31"; + this.label31.Size = new System.Drawing.Size(47, 12); + this.label31.TabIndex = 15; + this.label31.Text = "Point Y"; + // + // label40 + // + this.label40.AutoSize = true; + this.label40.ForeColor = System.Drawing.Color.IndianRed; + this.label40.Location = new System.Drawing.Point(99, 17); + this.label40.Name = "label40"; + this.label40.Size = new System.Drawing.Size(125, 12); + this.label40.TabIndex = 34; + this.label40.Text = "请在主机台电脑上使用"; + // + // label41 + // + this.label41.AutoSize = true; + this.label41.ForeColor = System.Drawing.Color.IndianRed; + this.label41.Location = new System.Drawing.Point(99, 17); + this.label41.Name = "label41"; + this.label41.Size = new System.Drawing.Size(125, 12); + this.label41.TabIndex = 35; + this.label41.Text = "请在修复台电脑上使用"; + // + // groupBox10 + // + this.groupBox10.Controls.Add(this.label14); + this.groupBox10.Controls.Add(this.aX1); + this.groupBox10.Controls.Add(this.aY1); + this.groupBox10.Controls.Add(this.label22); + this.groupBox10.Location = new System.Drawing.Point(8, 251); + this.groupBox10.Name = "groupBox10"; + this.groupBox10.Size = new System.Drawing.Size(533, 103); + this.groupBox10.TabIndex = 36; + this.groupBox10.TabStop = false; + this.groupBox10.Text = "修复台XY轴调整后坐标"; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Location = new System.Drawing.Point(26, 47); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(47, 12); + this.label14.TabIndex = 14; + this.label14.Text = "Point X"; + // + // aX1 + // + this.aX1.DecimalPlaces = 4; + this.aX1.Location = new System.Drawing.Point(93, 45); + this.aX1.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.aX1.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.aX1.Name = "aX1"; + this.aX1.Size = new System.Drawing.Size(120, 21); + this.aX1.TabIndex = 12; + // + // aY1 + // + this.aY1.DecimalPlaces = 4; + this.aY1.Location = new System.Drawing.Point(348, 45); + this.aY1.Maximum = new decimal(new int[] { + 1000000, + 0, + 0, + 0}); + this.aY1.Minimum = new decimal(new int[] { + 1000000, + 0, + 0, + -2147483648}); + this.aY1.Name = "aY1"; + this.aY1.Size = new System.Drawing.Size(120, 21); + this.aY1.TabIndex = 13; + // + // label22 + // + this.label22.AutoSize = true; + this.label22.Location = new System.Drawing.Point(281, 47); + this.label22.Name = "label22"; + this.label22.Size = new System.Drawing.Size(47, 12); + this.label22.TabIndex = 15; + this.label22.Text = "Point Y"; + // // Form1 // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(1117, 645); - this.Controls.Add(this.checkBox2); - this.Controls.Add(this.lstLog); - this.Controls.Add(this.groupBox6); - this.Controls.Add(this.groupBox5); - this.Controls.Add(this.groupBox4); - this.Controls.Add(this.groupBox3); - this.Controls.Add(this.checkBox1); - this.Controls.Add(this.label1); - this.Controls.Add(this.comboBox1); - this.Controls.Add(this.button2); - this.Controls.Add(this.textBox4); - this.Controls.Add(this.textBox3); - this.Controls.Add(this.gboxDefectList); - this.Controls.Add(this.textBox1); - this.Controls.Add(this.button1); - this.Controls.Add(this.groupBox1); + this.ClientSize = new System.Drawing.Size(1119, 664); + this.Controls.Add(this.tabControl1); this.Name = "Form1"; this.Text = "版博士推理工具"; this.Load += new System.EventHandler(this.Form1_Load); @@ -366,8 +1253,44 @@ ((System.ComponentModel.ISupportInitialize)(this.numericUpDown6)).EndInit(); this.groupBox6.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.numericUpDown5)).EndInit(); + this.tabControl1.ResumeLayout(false); + this.tabPage1.ResumeLayout(false); + this.tabPage1.PerformLayout(); + this.tabPage2.ResumeLayout(false); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.markX1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.MarkY1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.MarkY2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.markX2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.MarkY3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.markX3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.MarkY4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.markX4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.ZPos)).EndInit(); + this.groupBox7.ResumeLayout(false); + this.groupBox7.PerformLayout(); + this.groupBox8.ResumeLayout(false); + this.groupBox8.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.qx_markX1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.qx_markY1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.qx_markX2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.qx_markY4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.qx_markY2)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.qx_markX4)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.qx_markX3)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.qx_markY3)).EndInit(); + this.groupBox9.ResumeLayout(false); + this.groupBox9.PerformLayout(); + this.groupBox11.ResumeLayout(false); + this.groupBox11.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.bX1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.bY1)).EndInit(); + this.groupBox10.ResumeLayout(false); + this.groupBox10.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.aX1)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.aY1)).EndInit(); this.ResumeLayout(false); - this.PerformLayout(); } @@ -397,6 +1320,66 @@ private System.Windows.Forms.NumericUpDown numericUpDown5; private System.Windows.Forms.ListBox lstLog; private System.Windows.Forms.CheckBox checkBox2; + private System.Windows.Forms.TabControl tabControl1; + private System.Windows.Forms.TabPage tabPage1; + private System.Windows.Forms.TabPage tabPage2; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.NumericUpDown markX1; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.TextBox tbSFPath; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox tbTZPath; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.NumericUpDown MarkY1; + private System.Windows.Forms.GroupBox groupBox8; + private System.Windows.Forms.Label label13; + private System.Windows.Forms.NumericUpDown qx_markX1; + private System.Windows.Forms.NumericUpDown qx_markY1; + private System.Windows.Forms.Label label15; + private System.Windows.Forms.Label label16; + private System.Windows.Forms.NumericUpDown qx_markX2; + private System.Windows.Forms.Label label17; + private System.Windows.Forms.NumericUpDown qx_markY4; + private System.Windows.Forms.NumericUpDown qx_markY2; + private System.Windows.Forms.NumericUpDown qx_markX4; + private System.Windows.Forms.Label label18; + private System.Windows.Forms.Label label19; + private System.Windows.Forms.Label label20; + private System.Windows.Forms.Label label21; + private System.Windows.Forms.NumericUpDown qx_markX3; + private System.Windows.Forms.NumericUpDown qx_markY3; + private System.Windows.Forms.GroupBox groupBox7; + private System.Windows.Forms.Label label12; + private System.Windows.Forms.NumericUpDown ZPos; + private System.Windows.Forms.Label label10; + private System.Windows.Forms.NumericUpDown markX2; + private System.Windows.Forms.Label label11; + private System.Windows.Forms.NumericUpDown MarkY4; + private System.Windows.Forms.NumericUpDown MarkY2; + private System.Windows.Forms.NumericUpDown markX4; + private System.Windows.Forms.Label label7; + private System.Windows.Forms.Label label8; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.Label label9; + private System.Windows.Forms.NumericUpDown markX3; + private System.Windows.Forms.NumericUpDown MarkY3; + private System.Windows.Forms.Button btnMarkCal; + private System.Windows.Forms.Button btnNoMarkCal; + private System.Windows.Forms.GroupBox groupBox9; + private System.Windows.Forms.GroupBox groupBox10; + private System.Windows.Forms.Label label14; + private System.Windows.Forms.NumericUpDown aX1; + private System.Windows.Forms.NumericUpDown aY1; + private System.Windows.Forms.Label label22; + private System.Windows.Forms.Label label41; + private System.Windows.Forms.Button btnCal; + private System.Windows.Forms.GroupBox groupBox11; + private System.Windows.Forms.Label label29; + private System.Windows.Forms.NumericUpDown bX1; + private System.Windows.Forms.NumericUpDown bY1; + private System.Windows.Forms.Label label31; + private System.Windows.Forms.Label label40; } } diff --git a/halftoneproject-master/DefectInferTool/Form1.cs b/halftoneproject-master/DefectInferTool/Form1.cs index c25bc728..e76c506c 100644 --- a/halftoneproject-master/DefectInferTool/Form1.cs +++ b/halftoneproject-master/DefectInferTool/Form1.cs @@ -1,4 +1,5 @@ -using MaiMuAOI.ImageProcessing; +using CalTools; +using MaiMuAOI.ImageProcessing; using Newtonsoft.Json; using OpenCvSharp; using ProductionControl.UIExtend; @@ -609,6 +610,184 @@ namespace DefectInferTool return; } #endregion + + #region 标定 + /// + /// 选择文件 + /// + /// 如 图像文件|*.jpg|图像文件|*.png|所有文件|*.* + /// + public static string SelectFile(string filter = "所有文件|*.*", string defaultPath = "") + { + OpenFileDialog fie = new OpenFileDialog(); + fie.Title = "选择文件"; + //fie.InitialDirectory = (defaultPath != "" ? defaultPath : Path.GetFullPath(".")); + fie.Filter = filter; //设置文件类型 + if (fie.ShowDialog() == DialogResult.OK) + return fie.FileName; + + return ""; + } + + private void tbTZPath_Click(object sender, EventArgs e) + { + TextBox tb = (TextBox)sender; + string path = SelectFile("所有文件|*.*", Application.StartupPath); + if (!string.IsNullOrWhiteSpace(path)) + { + tb.Text = path; + } + } + + /// + /// 选择目录 + /// + /// + public static string SelectFolder(string defaultPath = "") + { + FolderBrowserDialog dlg = new FolderBrowserDialog(); + dlg.SelectedPath = (defaultPath != "" ? defaultPath : Path.GetFullPath(".")); + if (dlg.ShowDialog() == DialogResult.OK) + return dlg.SelectedPath; + + return ""; + } + private void tbSFPath_Click(object sender, EventArgs e) + { + TextBox tb = (TextBox)sender; + string path = SelectFolder(Application.StartupPath); + if (!string.IsNullOrWhiteSpace(path)) + { + tb.Text = path; + } + } + + private void btnMarkCal_Click(object sender, EventArgs e) + { + CalToolsClass calToolsClass = new CalToolsClass(); + double[] sizeX = new double[4]; + double[] sizeY = new double[4]; + double[] defectX = new double[4]; + double[] defectY = new double[4]; + double zpos = (double)ZPos.Value; + + sizeX[0] = (double)markX1.Value; + sizeX[1] = (double)markX2.Value; + sizeX[2] = (double)markX3.Value; + sizeX[3] = (double)markX4.Value; + + sizeY[0] = (double)MarkY1.Value; + sizeY[1] = (double)MarkY2.Value; + sizeY[2] = (double)MarkY3.Value; + sizeY[3] = (double)MarkY4.Value; + + defectX[0] = (double)qx_markX1.Value; + defectX[1] = (double)qx_markX2.Value; + defectX[2] = (double)qx_markX3.Value; + defectX[3] = (double)qx_markX4.Value; + + defectY[0] = (double)qx_markY1.Value; + defectY[1] = (double)qx_markY2.Value; + defectY[2] = (double)qx_markY3.Value; + defectY[3] = (double)qx_markY4.Value; + HalconDotNet.HTuple GerBerPath = new HalconDotNet.HTuple(tbTZPath.Text); + HalconDotNet.HTuple FilePath = new HalconDotNet.HTuple(tbSFPath.Text); + HalconDotNet.HTuple hv_PoseMarkX_CCDSize = new HalconDotNet.HTuple(sizeX); + HalconDotNet.HTuple hv_PoseMarkY_CCDSize = new HalconDotNet.HTuple(sizeY); + HalconDotNet.HTuple hv_PoseMarkX_CCDDefect = new HalconDotNet.HTuple(defectX); + HalconDotNet.HTuple hv_PoseMarkY_CCDDefect = new HalconDotNet.HTuple(defectY); + HalconDotNet.HTuple hv_PoseZ_Size = new HalconDotNet.HTuple(zpos); + var ret = (bool)calToolsClass.CCDPoseCal_Mark(GerBerPath, FilePath, hv_PoseMarkX_CCDSize, hv_PoseMarkY_CCDSize, + hv_PoseMarkX_CCDDefect, hv_PoseMarkY_CCDDefect, hv_PoseZ_Size); + if(ret) + { + MessageBox.Show("主机台标定成功!", "标定"); + } + else + { + MessageBox.Show("主机台标定失败!", "标定", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + private void btnNoMarkCal_Click(object sender, EventArgs e) + { + CalToolsClass calToolsClass = new CalToolsClass(); + double[] sizeX = new double[4]; + double[] sizeY = new double[4]; + double[] defectX = new double[4]; + double[] defectY = new double[4]; + double zpos = (double)ZPos.Value; + + sizeX[0] = (double)markX1.Value; + sizeX[1] = (double)markX2.Value; + sizeX[2] = (double)markX3.Value; + sizeX[3] = (double)markX4.Value; + + sizeY[0] = (double)MarkY1.Value; + sizeY[1] = (double)MarkY2.Value; + sizeY[2] = (double)MarkY3.Value; + sizeY[3] = (double)MarkY4.Value; + + defectX[0] = (double)qx_markX1.Value; + defectX[1] = (double)qx_markX2.Value; + defectX[2] = (double)qx_markX3.Value; + defectX[3] = (double)qx_markX4.Value; + + defectY[0] = (double)qx_markY1.Value; + defectY[1] = (double)qx_markY2.Value; + defectY[2] = (double)qx_markY3.Value; + defectY[3] = (double)qx_markY4.Value; + HalconDotNet.HTuple GerBerPath = new HalconDotNet.HTuple(tbTZPath.Text); + HalconDotNet.HTuple FilePath = new HalconDotNet.HTuple(tbSFPath.Text); + HalconDotNet.HTuple hv_PoseMarkX_CCDSize = new HalconDotNet.HTuple(sizeX); + HalconDotNet.HTuple hv_PoseMarkY_CCDSize = new HalconDotNet.HTuple(sizeY); + HalconDotNet.HTuple hv_PoseMarkX_CCDDefect = new HalconDotNet.HTuple(defectX); + HalconDotNet.HTuple hv_PoseMarkY_CCDDefect = new HalconDotNet.HTuple(defectY); + HalconDotNet.HTuple hv_PoseZ_Size = new HalconDotNet.HTuple(zpos); + var ret = (bool)calToolsClass.CCDPoseCal_Corner(GerBerPath, FilePath, hv_PoseMarkX_CCDSize, hv_PoseMarkY_CCDSize, + hv_PoseMarkX_CCDDefect, hv_PoseMarkY_CCDDefect, hv_PoseZ_Size); + if (ret) + { + MessageBox.Show("主机台无Mark标定成功!", "标定"); + } + else + { + MessageBox.Show("主机台无Mark标定失败!", "标定", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + private void btnCal_Click(object sender, EventArgs e) + { + CalToolsClass calToolsClass = new CalToolsClass(); + double BeforeX = (double)bX1.Value; + double BeforeY = (double)bY1.Value; + double AfterX = (double)aX1.Value; + double AfterY = (double)aY1.Value; + + HalconDotNet.HTuple hv_BeforeX = new HalconDotNet.HTuple(BeforeX); + HalconDotNet.HTuple hv_BeforeY = new HalconDotNet.HTuple(BeforeY); + HalconDotNet.HTuple hv_AfterX = new HalconDotNet.HTuple(AfterX); + HalconDotNet.HTuple hv_AfterY = new HalconDotNet.HTuple(AfterY); + + var ret = (bool)calToolsClass.RepairCal_1(); + if (ret) + { + ret = (bool)calToolsClass.RepairCal_2(hv_BeforeX, hv_BeforeY, hv_AfterX, hv_AfterY); + if (ret) + { + MessageBox.Show("修复台标定成功!", "标定"); + } + else + { + MessageBox.Show("修复台标定失败!", "标定", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + else + { + MessageBox.Show("修复台关联标定失败!", "标定", MessageBoxButtons.OK, MessageBoxIcon.Error); + } + } + #endregion + + } public class DefectCntInfo {