diff --git a/Rs.Controls/Common/ProductModel.cs b/Rs.Controls/Common/ProductModel.cs index e2b3ab0..687bab6 100644 --- a/Rs.Controls/Common/ProductModel.cs +++ b/Rs.Controls/Common/ProductModel.cs @@ -63,6 +63,8 @@ namespace Rs.MotionPlat.Commom public int AngleExtent { get; set; } public double Score { get; set; } + public int Exposure { get; set; } = 50; + public int Gain { get; set; } = 0; /// /// 模板中心X @@ -85,6 +87,8 @@ namespace Rs.MotionPlat.Commom ini.WriteValue("ModelParam", "AngleStart", AngleStart.ToString()); ini.WriteValue("ModelParam", "AngleExtent", AngleExtent.ToString()); ini.WriteValue("ModelParam", "Score", Score.ToString()); + ini.WriteValue("ModelParam", "Exposure", Exposure.ToString()); + ini.WriteValue("ModelParam", "Gain", Gain.ToString()); //保存原图 string dirname = Path.Combine(savePath); diff --git a/Rs.Controls/Properties/AssemblyInfo.cs b/Rs.Controls/Properties/AssemblyInfo.cs index b843db1..afe64c1 100644 --- a/Rs.Controls/Properties/AssemblyInfo.cs +++ b/Rs.Controls/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 //通过使用 "*",如下所示: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.20.24.4")] +[assembly: AssemblyVersion("2.20.24.5")] //[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Rs.Controls/TemplateMatch.Designer.cs b/Rs.Controls/TemplateMatch.Designer.cs index 3744140..d0a8da4 100644 --- a/Rs.Controls/TemplateMatch.Designer.cs +++ b/Rs.Controls/TemplateMatch.Designer.cs @@ -34,12 +34,6 @@ System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); this.panel1 = new System.Windows.Forms.Panel(); - this.groupBox5 = new System.Windows.Forms.GroupBox(); - this.dataGridView1 = new System.Windows.Forms.DataGridView(); - this.Index = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.X = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Y = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.Move = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.cboxMetric = new System.Windows.Forms.ComboBox(); this.txtScore = new System.Windows.Forms.TextBox(); @@ -72,6 +66,16 @@ this.rbtnSearchSelectedRegion = new System.Windows.Forms.RadioButton(); this.btnDrawSearch = new System.Windows.Forms.Button(); this.rbtnSearchWholeRegion = new System.Windows.Forms.RadioButton(); + this.panel2 = new System.Windows.Forms.Panel(); + this.groupBox7 = new System.Windows.Forms.GroupBox(); + this.hWindow_Final1 = new ChoiceTech.Halcon.Control.HWindow_Final(); + this.txtGain = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.txtExposure = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.groupBox6 = new System.Windows.Forms.GroupBox(); + this.panelEx2 = new Rs.Controls.PanelEx(); + this.lblHeadText = new System.Windows.Forms.Label(); this.panelEx5 = new Rs.Controls.PanelEx(); this.panelEx11 = new Rs.Controls.PanelEx(); this.hWindow_Final2 = new ChoiceTech.Halcon.Control.HWindow_Final(); @@ -84,32 +88,36 @@ this.btnGrab = new System.Windows.Forms.Button(); this.btnLoadImage = new System.Windows.Forms.Button(); this.btnGrabContinue = new System.Windows.Forms.Button(); - this.panel2 = new System.Windows.Forms.Panel(); - this.groupBox7 = new System.Windows.Forms.GroupBox(); - this.hWindow_Final1 = new ChoiceTech.Halcon.Control.HWindow_Final(); - this.panelEx2 = new Rs.Controls.PanelEx(); - this.lblHeadText = new System.Windows.Forms.Label(); + this.panel3 = new System.Windows.Forms.Panel(); + this.groupBox5 = new System.Windows.Forms.GroupBox(); + this.dataGridView1 = new System.Windows.Forms.DataGridView(); + this.Index = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.X = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Y = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.Move = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.panel1.SuspendLayout(); - this.groupBox5.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.tbarContrast)).BeginInit(); this.groupBox4.SuspendLayout(); this.groupBox3.SuspendLayout(); this.groupBox2.SuspendLayout(); + this.panel2.SuspendLayout(); + this.groupBox7.SuspendLayout(); + this.groupBox6.SuspendLayout(); + this.panelEx2.SuspendLayout(); this.panelEx5.SuspendLayout(); this.panelEx11.SuspendLayout(); this.panelEx10.SuspendLayout(); this.panelEx4.SuspendLayout(); this.tableLayoutPanel1.SuspendLayout(); - this.panel2.SuspendLayout(); - this.groupBox7.SuspendLayout(); - this.panelEx2.SuspendLayout(); + this.panel3.SuspendLayout(); + this.groupBox5.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).BeginInit(); this.SuspendLayout(); // // panel1 // - this.panel1.Controls.Add(this.groupBox5); + this.panel1.Controls.Add(this.groupBox6); this.panel1.Controls.Add(this.groupBox1); this.panel1.Controls.Add(this.groupBox4); this.panel1.Controls.Add(this.groupBox3); @@ -117,109 +125,12 @@ this.panel1.Controls.Add(this.panelEx5); this.panel1.Controls.Add(this.panelEx4); this.panel1.Dock = System.Windows.Forms.DockStyle.Right; - this.panel1.Location = new System.Drawing.Point(736, 0); + this.panel1.Location = new System.Drawing.Point(552, 0); + this.panel1.Margin = new System.Windows.Forms.Padding(2); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(428, 855); + this.panel1.Size = new System.Drawing.Size(321, 684); this.panel1.TabIndex = 0; // - // groupBox5 - // - this.groupBox5.Controls.Add(this.dataGridView1); - this.groupBox5.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupBox5.ForeColor = System.Drawing.Color.White; - this.groupBox5.Location = new System.Drawing.Point(0, 749); - this.groupBox5.Margin = new System.Windows.Forms.Padding(4); - this.groupBox5.Name = "groupBox5"; - this.groupBox5.Padding = new System.Windows.Forms.Padding(4); - this.groupBox5.Size = new System.Drawing.Size(428, 106); - this.groupBox5.TabIndex = 18; - this.groupBox5.TabStop = false; - this.groupBox5.Text = "测试定位结果"; - // - // dataGridView1 - // - this.dataGridView1.AllowUserToAddRows = false; - this.dataGridView1.AllowUserToDeleteRows = false; - this.dataGridView1.AllowUserToResizeColumns = false; - this.dataGridView1.AllowUserToResizeRows = false; - dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); - dataGridViewCellStyle1.ForeColor = System.Drawing.Color.White; - this.dataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; - this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; - this.dataGridView1.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(11)))), ((int)(((byte)(16)))), ((int)(((byte)(36))))); - this.dataGridView1.ColumnHeadersHeight = 30; - this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.Index, - this.X, - this.Y, - this.Move}); - this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; - this.dataGridView1.EnableHeadersVisualStyles = false; - this.dataGridView1.GridColor = System.Drawing.SystemColors.ActiveCaption; - this.dataGridView1.Location = new System.Drawing.Point(4, 22); - this.dataGridView1.Margin = new System.Windows.Forms.Padding(4); - this.dataGridView1.MultiSelect = false; - this.dataGridView1.Name = "dataGridView1"; - this.dataGridView1.ReadOnly = true; - dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(11)))), ((int)(((byte)(16)))), ((int)(((byte)(36))))); - dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle5.ForeColor = System.Drawing.Color.White; - dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.White; - dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; - dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle5; - this.dataGridView1.RowHeadersVisible = false; - this.dataGridView1.RowHeadersWidth = 30; - this.dataGridView1.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; - this.dataGridView1.RowTemplate.DefaultCellStyle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(11)))), ((int)(((byte)(16)))), ((int)(((byte)(36))))); - this.dataGridView1.RowTemplate.DefaultCellStyle.ForeColor = System.Drawing.Color.White; - this.dataGridView1.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(11)))), ((int)(((byte)(16)))), ((int)(((byte)(36))))); - this.dataGridView1.RowTemplate.Height = 23; - this.dataGridView1.Size = new System.Drawing.Size(420, 80); - this.dataGridView1.TabIndex = 3; - // - // Index - // - this.Index.DataPropertyName = "Index"; - this.Index.FillWeight = 26.47716F; - this.Index.HeaderText = "Row"; - this.Index.Name = "Index"; - this.Index.ReadOnly = true; - // - // X - // - this.X.DataPropertyName = "X"; - dataGridViewCellStyle2.Format = "0.000"; - this.X.DefaultCellStyle = dataGridViewCellStyle2; - this.X.FillWeight = 25.76511F; - this.X.HeaderText = "Column"; - this.X.Name = "X"; - this.X.ReadOnly = true; - // - // Y - // - this.Y.DataPropertyName = "Y"; - dataGridViewCellStyle3.Format = "0.000"; - this.Y.DefaultCellStyle = dataGridViewCellStyle3; - this.Y.FillWeight = 24.21075F; - this.Y.HeaderText = "Angle"; - this.Y.Name = "Y"; - this.Y.ReadOnly = true; - // - // Move - // - dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; - dataGridViewCellStyle4.BackColor = System.Drawing.Color.Silver; - dataGridViewCellStyle4.ForeColor = System.Drawing.Color.White; - this.Move.DefaultCellStyle = dataGridViewCellStyle4; - this.Move.FillWeight = 26.00443F; - this.Move.HeaderText = "Score"; - this.Move.Name = "Move"; - this.Move.ReadOnly = true; - this.Move.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.Move.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; - // // groupBox1 // this.groupBox1.Controls.Add(this.cboxMetric); @@ -237,11 +148,9 @@ this.groupBox1.Controls.Add(this.label3); this.groupBox1.Dock = System.Windows.Forms.DockStyle.Top; this.groupBox1.ForeColor = System.Drawing.Color.White; - this.groupBox1.Location = new System.Drawing.Point(0, 584); - this.groupBox1.Margin = new System.Windows.Forms.Padding(4); + this.groupBox1.Location = new System.Drawing.Point(0, 468); this.groupBox1.Name = "groupBox1"; - this.groupBox1.Padding = new System.Windows.Forms.Padding(4); - this.groupBox1.Size = new System.Drawing.Size(428, 165); + this.groupBox1.Size = new System.Drawing.Size(321, 130); this.groupBox1.TabIndex = 17; this.groupBox1.TabStop = false; this.groupBox1.Text = "定位参数"; @@ -255,10 +164,9 @@ this.cboxMetric.Items.AddRange(new object[] { "忽略极性", "使用极性"}); - this.cboxMetric.Location = new System.Drawing.Point(270, 123); - this.cboxMetric.Margin = new System.Windows.Forms.Padding(4); + this.cboxMetric.Location = new System.Drawing.Point(202, 98); this.cboxMetric.Name = "cboxMetric"; - this.cboxMetric.Size = new System.Drawing.Size(151, 23); + this.cboxMetric.Size = new System.Drawing.Size(114, 20); this.cboxMetric.TabIndex = 5; this.cboxMetric.Visible = false; // @@ -267,10 +175,9 @@ this.txtScore.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.txtScore.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtScore.ForeColor = System.Drawing.Color.White; - this.txtScore.Location = new System.Drawing.Point(95, 124); - this.txtScore.Margin = new System.Windows.Forms.Padding(4); + this.txtScore.Location = new System.Drawing.Point(71, 99); this.txtScore.Name = "txtScore"; - this.txtScore.Size = new System.Drawing.Size(91, 25); + this.txtScore.Size = new System.Drawing.Size(69, 21); this.txtScore.TabIndex = 4; this.txtScore.Text = "0"; this.txtScore.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -280,10 +187,9 @@ this.label14.AutoSize = true; this.label14.ForeColor = System.Drawing.Color.White; this.label14.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label14.Location = new System.Drawing.Point(214, 133); - this.label14.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label14.Location = new System.Drawing.Point(160, 106); this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(45, 15); + this.label14.Size = new System.Drawing.Size(35, 12); this.label14.TabIndex = 3; this.label14.Text = "极性:"; this.label14.Visible = false; @@ -293,10 +199,9 @@ this.label13.AutoSize = true; this.label13.ForeColor = System.Drawing.Color.White; this.label13.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label13.Location = new System.Drawing.Point(39, 127); - this.label13.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label13.Location = new System.Drawing.Point(29, 102); this.label13.Name = "label13"; - this.label13.Size = new System.Drawing.Size(45, 15); + this.label13.Size = new System.Drawing.Size(35, 12); this.label13.TabIndex = 3; this.label13.Text = "分数:"; // @@ -305,10 +210,9 @@ this.txtAngleExtent.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.txtAngleExtent.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtAngleExtent.ForeColor = System.Drawing.Color.White; - this.txtAngleExtent.Location = new System.Drawing.Point(291, 74); - this.txtAngleExtent.Margin = new System.Windows.Forms.Padding(4); + this.txtAngleExtent.Location = new System.Drawing.Point(218, 59); this.txtAngleExtent.Name = "txtAngleExtent"; - this.txtAngleExtent.Size = new System.Drawing.Size(94, 25); + this.txtAngleExtent.Size = new System.Drawing.Size(71, 21); this.txtAngleExtent.TabIndex = 4; this.txtAngleExtent.Text = "5"; this.txtAngleExtent.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -318,10 +222,9 @@ this.txtAngleStart.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.txtAngleStart.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtAngleStart.ForeColor = System.Drawing.Color.White; - this.txtAngleStart.Location = new System.Drawing.Point(92, 74); - this.txtAngleStart.Margin = new System.Windows.Forms.Padding(4); + this.txtAngleStart.Location = new System.Drawing.Point(69, 59); this.txtAngleStart.Name = "txtAngleStart"; - this.txtAngleStart.Size = new System.Drawing.Size(94, 25); + this.txtAngleStart.Size = new System.Drawing.Size(71, 21); this.txtAngleStart.TabIndex = 4; this.txtAngleStart.Text = "-5"; this.txtAngleStart.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -332,12 +235,11 @@ this.tbarContrast.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(26)))), ((int)(((byte)(26))))); this.tbarContrast.ImeMode = System.Windows.Forms.ImeMode.NoControl; this.tbarContrast.LargeChange = 1; - this.tbarContrast.Location = new System.Drawing.Point(88, 30); - this.tbarContrast.Margin = new System.Windows.Forms.Padding(4); + this.tbarContrast.Location = new System.Drawing.Point(66, 24); this.tbarContrast.Maximum = 160; this.tbarContrast.Minimum = 1; this.tbarContrast.Name = "tbarContrast"; - this.tbarContrast.Size = new System.Drawing.Size(303, 26); + this.tbarContrast.Size = new System.Drawing.Size(227, 21); this.tbarContrast.TabIndex = 4; this.tbarContrast.TickStyle = System.Windows.Forms.TickStyle.None; this.tbarContrast.Value = 30; @@ -348,10 +250,9 @@ this.label8.AutoSize = true; this.label8.ForeColor = System.Drawing.Color.White; this.label8.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label8.Location = new System.Drawing.Point(235, 80); - this.label8.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label8.Location = new System.Drawing.Point(176, 64); this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(31, 15); + this.label8.Size = new System.Drawing.Size(23, 12); this.label8.TabIndex = 3; this.label8.Text = "-->"; // @@ -360,10 +261,9 @@ this.label5.AutoSize = true; this.label5.ForeColor = System.Drawing.Color.White; this.label5.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label5.Location = new System.Drawing.Point(7, 80); - this.label5.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label5.Location = new System.Drawing.Point(5, 64); this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(75, 15); + this.label5.Size = new System.Drawing.Size(59, 12); this.label5.TabIndex = 3; this.label5.Text = "角度范围:"; // @@ -372,10 +272,9 @@ this.label10.AutoSize = true; this.label10.ForeColor = System.Drawing.Color.White; this.label10.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label10.Location = new System.Drawing.Point(194, 80); - this.label10.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label10.Location = new System.Drawing.Point(146, 64); this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(22, 15); + this.label10.Size = new System.Drawing.Size(17, 12); this.label10.TabIndex = 3; this.label10.Text = "度"; // @@ -384,10 +283,9 @@ this.label9.AutoSize = true; this.label9.ForeColor = System.Drawing.Color.White; this.label9.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label9.Location = new System.Drawing.Point(399, 131); - this.label9.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label9.Location = new System.Drawing.Point(299, 105); this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(22, 15); + this.label9.Size = new System.Drawing.Size(17, 12); this.label9.TabIndex = 3; this.label9.Text = "度"; // @@ -396,10 +294,9 @@ this.lblContrast.AutoSize = true; this.lblContrast.ForeColor = System.Drawing.Color.White; this.lblContrast.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.lblContrast.Location = new System.Drawing.Point(399, 35); - this.lblContrast.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.lblContrast.Location = new System.Drawing.Point(299, 28); this.lblContrast.Name = "lblContrast"; - this.lblContrast.Size = new System.Drawing.Size(23, 15); + this.lblContrast.Size = new System.Drawing.Size(17, 12); this.lblContrast.TabIndex = 3; this.lblContrast.Text = "30"; // @@ -408,10 +305,9 @@ this.label3.AutoSize = true; this.label3.ForeColor = System.Drawing.Color.White; this.label3.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label3.Location = new System.Drawing.Point(44, 35); - this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label3.Location = new System.Drawing.Point(33, 28); this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(45, 15); + this.label3.Size = new System.Drawing.Size(35, 12); this.label3.TabIndex = 3; this.label3.Text = "阈值:"; // @@ -427,11 +323,9 @@ this.groupBox4.Controls.Add(this.btnClear); this.groupBox4.Dock = System.Windows.Forms.DockStyle.Top; this.groupBox4.ForeColor = System.Drawing.Color.White; - this.groupBox4.Location = new System.Drawing.Point(0, 422); - this.groupBox4.Margin = new System.Windows.Forms.Padding(4); + this.groupBox4.Location = new System.Drawing.Point(0, 338); this.groupBox4.Name = "groupBox4"; - this.groupBox4.Padding = new System.Windows.Forms.Padding(4); - this.groupBox4.Size = new System.Drawing.Size(428, 162); + this.groupBox4.Size = new System.Drawing.Size(321, 130); this.groupBox4.TabIndex = 16; this.groupBox4.TabStop = false; this.groupBox4.Text = "涂抹与擦除"; @@ -446,10 +340,9 @@ this.rbtnBrushCircle.FlatAppearance.CheckedBackColor = System.Drawing.Color.Red; this.rbtnBrushCircle.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.rbtnBrushCircle.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.rbtnBrushCircle.Location = new System.Drawing.Point(172, 71); - this.rbtnBrushCircle.Margin = new System.Windows.Forms.Padding(4); + this.rbtnBrushCircle.Location = new System.Drawing.Point(129, 57); this.rbtnBrushCircle.Name = "rbtnBrushCircle"; - this.rbtnBrushCircle.Size = new System.Drawing.Size(54, 19); + this.rbtnBrushCircle.Size = new System.Drawing.Size(46, 16); this.rbtnBrushCircle.TabIndex = 10; this.rbtnBrushCircle.TabStop = true; this.rbtnBrushCircle.Text = "圆形"; @@ -463,10 +356,9 @@ this.rbtnBrushRectangle.FlatAppearance.CheckedBackColor = System.Drawing.Color.Red; this.rbtnBrushRectangle.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.rbtnBrushRectangle.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.rbtnBrushRectangle.Location = new System.Drawing.Point(100, 71); - this.rbtnBrushRectangle.Margin = new System.Windows.Forms.Padding(4); + this.rbtnBrushRectangle.Location = new System.Drawing.Point(75, 57); this.rbtnBrushRectangle.Name = "rbtnBrushRectangle"; - this.rbtnBrushRectangle.Size = new System.Drawing.Size(54, 19); + this.rbtnBrushRectangle.Size = new System.Drawing.Size(46, 16); this.rbtnBrushRectangle.TabIndex = 9; this.rbtnBrushRectangle.Text = "矩形"; this.rbtnBrushRectangle.UseVisualStyleBackColor = false; @@ -476,10 +368,9 @@ this.txtBrushSize.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.txtBrushSize.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; this.txtBrushSize.ForeColor = System.Drawing.Color.White; - this.txtBrushSize.Location = new System.Drawing.Point(100, 30); - this.txtBrushSize.Margin = new System.Windows.Forms.Padding(4); + this.txtBrushSize.Location = new System.Drawing.Point(75, 24); this.txtBrushSize.Name = "txtBrushSize"; - this.txtBrushSize.Size = new System.Drawing.Size(94, 25); + this.txtBrushSize.Size = new System.Drawing.Size(71, 21); this.txtBrushSize.TabIndex = 4; this.txtBrushSize.Text = "5"; this.txtBrushSize.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; @@ -489,10 +380,9 @@ this.btnWholePaint.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.btnWholePaint.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnWholePaint.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnWholePaint.Location = new System.Drawing.Point(15, 115); - this.btnWholePaint.Margin = new System.Windows.Forms.Padding(4); + this.btnWholePaint.Location = new System.Drawing.Point(11, 92); this.btnWholePaint.Name = "btnWholePaint"; - this.btnWholePaint.Size = new System.Drawing.Size(100, 29); + this.btnWholePaint.Size = new System.Drawing.Size(75, 23); this.btnWholePaint.TabIndex = 8; this.btnWholePaint.Text = "一键涂抹"; this.btnWholePaint.UseVisualStyleBackColor = false; @@ -503,10 +393,9 @@ this.btnPaint.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.btnPaint.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnPaint.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnPaint.Location = new System.Drawing.Point(167, 115); - this.btnPaint.Margin = new System.Windows.Forms.Padding(4); + this.btnPaint.Location = new System.Drawing.Point(125, 92); this.btnPaint.Name = "btnPaint"; - this.btnPaint.Size = new System.Drawing.Size(100, 29); + this.btnPaint.Size = new System.Drawing.Size(75, 23); this.btnPaint.TabIndex = 8; this.btnPaint.Text = "涂抹"; this.btnPaint.UseVisualStyleBackColor = false; @@ -517,10 +406,9 @@ this.label6.AutoSize = true; this.label6.ForeColor = System.Drawing.Color.White; this.label6.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label6.Location = new System.Drawing.Point(13, 71); - this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label6.Location = new System.Drawing.Point(10, 57); this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(75, 15); + this.label6.Size = new System.Drawing.Size(59, 12); this.label6.TabIndex = 3; this.label6.Text = "画笔形状:"; // @@ -529,10 +417,9 @@ this.label12.AutoSize = true; this.label12.ForeColor = System.Drawing.Color.White; this.label12.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.label12.Location = new System.Drawing.Point(13, 32); - this.label12.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); + this.label12.Location = new System.Drawing.Point(10, 26); this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(75, 15); + this.label12.Size = new System.Drawing.Size(59, 12); this.label12.TabIndex = 3; this.label12.Text = "画笔大小:"; // @@ -541,10 +428,9 @@ this.btnClear.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.btnClear.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnClear.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnClear.Location = new System.Drawing.Point(319, 115); - this.btnClear.Margin = new System.Windows.Forms.Padding(4); + this.btnClear.Location = new System.Drawing.Point(239, 92); this.btnClear.Name = "btnClear"; - this.btnClear.Size = new System.Drawing.Size(100, 29); + this.btnClear.Size = new System.Drawing.Size(75, 23); this.btnClear.TabIndex = 8; this.btnClear.Text = "擦除"; this.btnClear.UseVisualStyleBackColor = false; @@ -558,11 +444,9 @@ this.groupBox3.Controls.Add(this.btnDrawCircle); this.groupBox3.Dock = System.Windows.Forms.DockStyle.Top; this.groupBox3.ForeColor = System.Drawing.Color.White; - this.groupBox3.Location = new System.Drawing.Point(0, 351); - this.groupBox3.Margin = new System.Windows.Forms.Padding(4); + this.groupBox3.Location = new System.Drawing.Point(0, 281); this.groupBox3.Name = "groupBox3"; - this.groupBox3.Padding = new System.Windows.Forms.Padding(4); - this.groupBox3.Size = new System.Drawing.Size(428, 71); + this.groupBox3.Size = new System.Drawing.Size(321, 57); this.groupBox3.TabIndex = 15; this.groupBox3.TabStop = false; this.groupBox3.Text = "绘制模板"; @@ -572,10 +456,9 @@ this.btnDrawRectangle2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.btnDrawRectangle2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnDrawRectangle2.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnDrawRectangle2.Location = new System.Drawing.Point(16, 25); - this.btnDrawRectangle2.Margin = new System.Windows.Forms.Padding(4); + this.btnDrawRectangle2.Location = new System.Drawing.Point(12, 20); this.btnDrawRectangle2.Name = "btnDrawRectangle2"; - this.btnDrawRectangle2.Size = new System.Drawing.Size(73, 29); + this.btnDrawRectangle2.Size = new System.Drawing.Size(55, 23); this.btnDrawRectangle2.TabIndex = 8; this.btnDrawRectangle2.Text = "画矩形"; this.btnDrawRectangle2.UseVisualStyleBackColor = false; @@ -586,10 +469,9 @@ this.btnDrawBarCode.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.btnDrawBarCode.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnDrawBarCode.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnDrawBarCode.Location = new System.Drawing.Point(316, 25); - this.btnDrawBarCode.Margin = new System.Windows.Forms.Padding(4); + this.btnDrawBarCode.Location = new System.Drawing.Point(237, 20); this.btnDrawBarCode.Name = "btnDrawBarCode"; - this.btnDrawBarCode.Size = new System.Drawing.Size(95, 29); + this.btnDrawBarCode.Size = new System.Drawing.Size(71, 23); this.btnDrawBarCode.TabIndex = 8; this.btnDrawBarCode.Text = "二维码"; this.btnDrawBarCode.UseVisualStyleBackColor = false; @@ -600,10 +482,9 @@ this.btnDrawAny.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.btnDrawAny.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnDrawAny.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnDrawAny.Location = new System.Drawing.Point(216, 25); - this.btnDrawAny.Margin = new System.Windows.Forms.Padding(4); + this.btnDrawAny.Location = new System.Drawing.Point(162, 20); this.btnDrawAny.Name = "btnDrawAny"; - this.btnDrawAny.Size = new System.Drawing.Size(73, 29); + this.btnDrawAny.Size = new System.Drawing.Size(55, 23); this.btnDrawAny.TabIndex = 8; this.btnDrawAny.Text = "任意"; this.btnDrawAny.UseVisualStyleBackColor = false; @@ -614,10 +495,9 @@ this.btnDrawCircle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.btnDrawCircle.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnDrawCircle.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnDrawCircle.Location = new System.Drawing.Point(116, 25); - this.btnDrawCircle.Margin = new System.Windows.Forms.Padding(4); + this.btnDrawCircle.Location = new System.Drawing.Point(87, 20); this.btnDrawCircle.Name = "btnDrawCircle"; - this.btnDrawCircle.Size = new System.Drawing.Size(73, 29); + this.btnDrawCircle.Size = new System.Drawing.Size(55, 23); this.btnDrawCircle.TabIndex = 8; this.btnDrawCircle.Text = "画圆"; this.btnDrawCircle.UseVisualStyleBackColor = false; @@ -630,11 +510,9 @@ this.groupBox2.Controls.Add(this.rbtnSearchWholeRegion); this.groupBox2.Dock = System.Windows.Forms.DockStyle.Top; this.groupBox2.ForeColor = System.Drawing.Color.White; - this.groupBox2.Location = new System.Drawing.Point(0, 285); - this.groupBox2.Margin = new System.Windows.Forms.Padding(4); + this.groupBox2.Location = new System.Drawing.Point(0, 228); this.groupBox2.Name = "groupBox2"; - this.groupBox2.Padding = new System.Windows.Forms.Padding(4); - this.groupBox2.Size = new System.Drawing.Size(428, 66); + this.groupBox2.Size = new System.Drawing.Size(321, 53); this.groupBox2.TabIndex = 14; this.groupBox2.TabStop = false; this.groupBox2.Text = "搜索区域"; @@ -647,10 +525,9 @@ this.rbtnSearchSelectedRegion.FlatAppearance.CheckedBackColor = System.Drawing.Color.Red; this.rbtnSearchSelectedRegion.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.rbtnSearchSelectedRegion.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.rbtnSearchSelectedRegion.Location = new System.Drawing.Point(155, 26); - this.rbtnSearchSelectedRegion.Margin = new System.Windows.Forms.Padding(4); + this.rbtnSearchSelectedRegion.Location = new System.Drawing.Point(116, 21); this.rbtnSearchSelectedRegion.Name = "rbtnSearchSelectedRegion"; - this.rbtnSearchSelectedRegion.Size = new System.Drawing.Size(84, 19); + this.rbtnSearchSelectedRegion.Size = new System.Drawing.Size(70, 16); this.rbtnSearchSelectedRegion.TabIndex = 9; this.rbtnSearchSelectedRegion.Text = "框选区域"; this.rbtnSearchSelectedRegion.UseVisualStyleBackColor = false; @@ -660,10 +537,9 @@ this.btnDrawSearch.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); this.btnDrawSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnDrawSearch.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnDrawSearch.Location = new System.Drawing.Point(280, 22); - this.btnDrawSearch.Margin = new System.Windows.Forms.Padding(4); + this.btnDrawSearch.Location = new System.Drawing.Point(210, 18); this.btnDrawSearch.Name = "btnDrawSearch"; - this.btnDrawSearch.Size = new System.Drawing.Size(96, 29); + this.btnDrawSearch.Size = new System.Drawing.Size(72, 23); this.btnDrawSearch.TabIndex = 8; this.btnDrawSearch.Text = "搜索区域"; this.btnDrawSearch.UseVisualStyleBackColor = false; @@ -677,23 +553,142 @@ this.rbtnSearchWholeRegion.FlatAppearance.CheckedBackColor = System.Drawing.Color.Red; this.rbtnSearchWholeRegion.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.rbtnSearchWholeRegion.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.rbtnSearchWholeRegion.Location = new System.Drawing.Point(29, 26); - this.rbtnSearchWholeRegion.Margin = new System.Windows.Forms.Padding(4); + this.rbtnSearchWholeRegion.Location = new System.Drawing.Point(22, 21); this.rbtnSearchWholeRegion.Name = "rbtnSearchWholeRegion"; - this.rbtnSearchWholeRegion.Size = new System.Drawing.Size(84, 19); + this.rbtnSearchWholeRegion.Size = new System.Drawing.Size(70, 16); this.rbtnSearchWholeRegion.TabIndex = 9; this.rbtnSearchWholeRegion.Text = "整幅图像"; this.rbtnSearchWholeRegion.UseVisualStyleBackColor = false; // + // panel2 + // + this.panel2.Controls.Add(this.panel3); + this.panel2.Controls.Add(this.groupBox7); + this.panel2.Controls.Add(this.panelEx2); + this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel2.Location = new System.Drawing.Point(0, 0); + this.panel2.Margin = new System.Windows.Forms.Padding(2); + this.panel2.Name = "panel2"; + this.panel2.Size = new System.Drawing.Size(552, 684); + this.panel2.TabIndex = 1; + // + // groupBox7 + // + this.groupBox7.Controls.Add(this.hWindow_Final1); + this.groupBox7.Dock = System.Windows.Forms.DockStyle.Top; + this.groupBox7.ForeColor = System.Drawing.Color.White; + this.groupBox7.Location = new System.Drawing.Point(0, 40); + this.groupBox7.Name = "groupBox7"; + this.groupBox7.Size = new System.Drawing.Size(552, 425); + this.groupBox7.TabIndex = 9; + this.groupBox7.TabStop = false; + this.groupBox7.Text = "图像显示区"; + // + // hWindow_Final1 + // + this.hWindow_Final1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); + this.hWindow_Final1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.hWindow_Final1.Dock = System.Windows.Forms.DockStyle.Fill; + this.hWindow_Final1.DrawModel = false; + this.hWindow_Final1.ForeColor = System.Drawing.Color.White; + this.hWindow_Final1.Image = null; + this.hWindow_Final1.Location = new System.Drawing.Point(3, 17); + this.hWindow_Final1.Margin = new System.Windows.Forms.Padding(4); + this.hWindow_Final1.Name = "hWindow_Final1"; + this.hWindow_Final1.Size = new System.Drawing.Size(546, 405); + this.hWindow_Final1.TabIndex = 6; + // + // txtGain + // + this.txtGain.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); + this.txtGain.ForeColor = System.Drawing.Color.White; + this.txtGain.Location = new System.Drawing.Point(202, 19); + this.txtGain.Margin = new System.Windows.Forms.Padding(2); + this.txtGain.Name = "txtGain"; + this.txtGain.Size = new System.Drawing.Size(76, 21); + this.txtGain.TabIndex = 1; + this.txtGain.Text = "0"; + this.txtGain.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // label2 + // + this.label2.AutoSize = true; + this.label2.ForeColor = System.Drawing.Color.White; + this.label2.Location = new System.Drawing.Point(164, 21); + this.label2.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(35, 12); + this.label2.TabIndex = 0; + this.label2.Text = "增益:"; + // + // txtExposure + // + this.txtExposure.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); + this.txtExposure.ForeColor = System.Drawing.Color.White; + this.txtExposure.Location = new System.Drawing.Point(64, 19); + this.txtExposure.Margin = new System.Windows.Forms.Padding(2); + this.txtExposure.Name = "txtExposure"; + this.txtExposure.Size = new System.Drawing.Size(76, 21); + this.txtExposure.TabIndex = 1; + this.txtExposure.Text = "50"; + this.txtExposure.TextAlign = System.Windows.Forms.HorizontalAlignment.Center; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.ForeColor = System.Drawing.Color.White; + this.label1.Location = new System.Drawing.Point(26, 22); + this.label1.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(35, 12); + this.label1.TabIndex = 0; + this.label1.Text = "曝光:"; + // + // groupBox6 + // + this.groupBox6.Controls.Add(this.txtGain); + this.groupBox6.Controls.Add(this.label2); + this.groupBox6.Controls.Add(this.txtExposure); + this.groupBox6.Controls.Add(this.label1); + this.groupBox6.Dock = System.Windows.Forms.DockStyle.Top; + this.groupBox6.ForeColor = System.Drawing.Color.White; + this.groupBox6.Location = new System.Drawing.Point(0, 598); + this.groupBox6.Name = "groupBox6"; + this.groupBox6.Size = new System.Drawing.Size(321, 62); + this.groupBox6.TabIndex = 18; + this.groupBox6.TabStop = false; + this.groupBox6.Text = "相机"; + // + // panelEx2 + // + this.panelEx2.Controls.Add(this.lblHeadText); + this.panelEx2.Dock = System.Windows.Forms.DockStyle.Top; + this.panelEx2.Location = new System.Drawing.Point(0, 0); + this.panelEx2.Name = "panelEx2"; + this.panelEx2.Size = new System.Drawing.Size(552, 40); + this.panelEx2.TabIndex = 2; + // + // lblHeadText + // + this.lblHeadText.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); + this.lblHeadText.Dock = System.Windows.Forms.DockStyle.Fill; + this.lblHeadText.ForeColor = System.Drawing.Color.White; + this.lblHeadText.ImeMode = System.Windows.Forms.ImeMode.NoControl; + this.lblHeadText.Location = new System.Drawing.Point(0, 0); + this.lblHeadText.Name = "lblHeadText"; + this.lblHeadText.Size = new System.Drawing.Size(552, 40); + this.lblHeadText.TabIndex = 1; + this.lblHeadText.Text = "视觉模板"; + this.lblHeadText.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // // panelEx5 // this.panelEx5.Controls.Add(this.panelEx11); this.panelEx5.Controls.Add(this.panelEx10); this.panelEx5.Dock = System.Windows.Forms.DockStyle.Top; - this.panelEx5.Location = new System.Drawing.Point(0, 50); - this.panelEx5.Margin = new System.Windows.Forms.Padding(4); + this.panelEx5.Location = new System.Drawing.Point(0, 40); this.panelEx5.Name = "panelEx5"; - this.panelEx5.Size = new System.Drawing.Size(428, 235); + this.panelEx5.Size = new System.Drawing.Size(321, 188); this.panelEx5.TabIndex = 12; // // panelEx11 @@ -701,9 +696,8 @@ this.panelEx11.Controls.Add(this.hWindow_Final2); this.panelEx11.Dock = System.Windows.Forms.DockStyle.Fill; this.panelEx11.Location = new System.Drawing.Point(0, 0); - this.panelEx11.Margin = new System.Windows.Forms.Padding(4); this.panelEx11.Name = "panelEx11"; - this.panelEx11.Size = new System.Drawing.Size(309, 235); + this.panelEx11.Size = new System.Drawing.Size(232, 188); this.panelEx11.TabIndex = 2; // // hWindow_Final2 @@ -715,9 +709,9 @@ this.hWindow_Final2.ForeColor = System.Drawing.Color.White; this.hWindow_Final2.Image = null; this.hWindow_Final2.Location = new System.Drawing.Point(0, 0); - this.hWindow_Final2.Margin = new System.Windows.Forms.Padding(5); + this.hWindow_Final2.Margin = new System.Windows.Forms.Padding(4); this.hWindow_Final2.Name = "hWindow_Final2"; - this.hWindow_Final2.Size = new System.Drawing.Size(309, 235); + this.hWindow_Final2.Size = new System.Drawing.Size(232, 188); this.hWindow_Final2.TabIndex = 3; // // panelEx10 @@ -726,10 +720,9 @@ this.panelEx10.Controls.Add(this.btnSaveModel); this.panelEx10.Controls.Add(this.btnStudy); this.panelEx10.Dock = System.Windows.Forms.DockStyle.Right; - this.panelEx10.Location = new System.Drawing.Point(309, 0); - this.panelEx10.Margin = new System.Windows.Forms.Padding(4); + this.panelEx10.Location = new System.Drawing.Point(232, 0); this.panelEx10.Name = "panelEx10"; - this.panelEx10.Size = new System.Drawing.Size(119, 235); + this.panelEx10.Size = new System.Drawing.Size(89, 188); this.panelEx10.TabIndex = 1; // // btnTestModel @@ -739,10 +732,9 @@ this.btnTestModel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnTestModel.ForeColor = System.Drawing.Color.White; this.btnTestModel.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnTestModel.Location = new System.Drawing.Point(9, 185); - this.btnTestModel.Margin = new System.Windows.Forms.Padding(4); + this.btnTestModel.Location = new System.Drawing.Point(7, 148); this.btnTestModel.Name = "btnTestModel"; - this.btnTestModel.Size = new System.Drawing.Size(101, 42); + this.btnTestModel.Size = new System.Drawing.Size(76, 34); this.btnTestModel.TabIndex = 1; this.btnTestModel.Text = "模板测试"; this.btnTestModel.UseVisualStyleBackColor = false; @@ -755,10 +747,9 @@ this.btnSaveModel.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnSaveModel.ForeColor = System.Drawing.Color.White; this.btnSaveModel.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnSaveModel.Location = new System.Drawing.Point(9, 62); - this.btnSaveModel.Margin = new System.Windows.Forms.Padding(4); + this.btnSaveModel.Location = new System.Drawing.Point(7, 50); this.btnSaveModel.Name = "btnSaveModel"; - this.btnSaveModel.Size = new System.Drawing.Size(101, 42); + this.btnSaveModel.Size = new System.Drawing.Size(76, 34); this.btnSaveModel.TabIndex = 1; this.btnSaveModel.Text = "保存模板"; this.btnSaveModel.UseVisualStyleBackColor = false; @@ -771,10 +762,9 @@ this.btnStudy.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnStudy.ForeColor = System.Drawing.Color.White; this.btnStudy.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnStudy.Location = new System.Drawing.Point(8, 8); - this.btnStudy.Margin = new System.Windows.Forms.Padding(4); + this.btnStudy.Location = new System.Drawing.Point(6, 6); this.btnStudy.Name = "btnStudy"; - this.btnStudy.Size = new System.Drawing.Size(101, 42); + this.btnStudy.Size = new System.Drawing.Size(76, 34); this.btnStudy.TabIndex = 1; this.btnStudy.Text = "训练"; this.btnStudy.UseVisualStyleBackColor = false; @@ -785,9 +775,8 @@ this.panelEx4.Controls.Add(this.tableLayoutPanel1); this.panelEx4.Dock = System.Windows.Forms.DockStyle.Top; this.panelEx4.Location = new System.Drawing.Point(0, 0); - this.panelEx4.Margin = new System.Windows.Forms.Padding(4); this.panelEx4.Name = "panelEx4"; - this.panelEx4.Size = new System.Drawing.Size(428, 50); + this.panelEx4.Size = new System.Drawing.Size(321, 40); this.panelEx4.TabIndex = 3; // // tableLayoutPanel1 @@ -796,17 +785,16 @@ this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33334F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33334F)); this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 33.33334F)); - this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 36F)); + this.tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 27F)); this.tableLayoutPanel1.Controls.Add(this.btnGrab, 0, 0); this.tableLayoutPanel1.Controls.Add(this.btnLoadImage, 1, 0); this.tableLayoutPanel1.Controls.Add(this.btnGrabContinue, 2, 0); this.tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; this.tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); - this.tableLayoutPanel1.Margin = new System.Windows.Forms.Padding(4); this.tableLayoutPanel1.Name = "tableLayoutPanel1"; this.tableLayoutPanel1.RowCount = 1; this.tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); - this.tableLayoutPanel1.Size = new System.Drawing.Size(428, 50); + this.tableLayoutPanel1.Size = new System.Drawing.Size(321, 40); this.tableLayoutPanel1.TabIndex = 0; // // btnGrab @@ -817,10 +805,9 @@ this.btnGrab.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnGrab.ForeColor = System.Drawing.Color.White; this.btnGrab.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnGrab.Location = new System.Drawing.Point(4, 4); - this.btnGrab.Margin = new System.Windows.Forms.Padding(4); + this.btnGrab.Location = new System.Drawing.Point(3, 3); this.btnGrab.Name = "btnGrab"; - this.btnGrab.Size = new System.Drawing.Size(134, 42); + this.btnGrab.Size = new System.Drawing.Size(101, 34); this.btnGrab.TabIndex = 0; this.btnGrab.Text = "拍照取图"; this.btnGrab.UseVisualStyleBackColor = false; @@ -834,10 +821,9 @@ this.btnLoadImage.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnLoadImage.ForeColor = System.Drawing.Color.White; this.btnLoadImage.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnLoadImage.Location = new System.Drawing.Point(146, 4); - this.btnLoadImage.Margin = new System.Windows.Forms.Padding(4); + this.btnLoadImage.Location = new System.Drawing.Point(110, 3); this.btnLoadImage.Name = "btnLoadImage"; - this.btnLoadImage.Size = new System.Drawing.Size(134, 42); + this.btnLoadImage.Size = new System.Drawing.Size(101, 34); this.btnLoadImage.TabIndex = 1; this.btnLoadImage.Text = "加载图片"; this.btnLoadImage.UseVisualStyleBackColor = false; @@ -851,90 +837,132 @@ this.btnGrabContinue.FlatStyle = System.Windows.Forms.FlatStyle.Flat; this.btnGrabContinue.ForeColor = System.Drawing.Color.White; this.btnGrabContinue.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.btnGrabContinue.Location = new System.Drawing.Point(288, 4); - this.btnGrabContinue.Margin = new System.Windows.Forms.Padding(4); + this.btnGrabContinue.Location = new System.Drawing.Point(217, 3); this.btnGrabContinue.Name = "btnGrabContinue"; - this.btnGrabContinue.Size = new System.Drawing.Size(136, 42); + this.btnGrabContinue.Size = new System.Drawing.Size(101, 34); this.btnGrabContinue.TabIndex = 1; this.btnGrabContinue.Text = "连续取图"; this.btnGrabContinue.UseVisualStyleBackColor = false; this.btnGrabContinue.Click += new System.EventHandler(this.btnGrabContinue_Click); // - // panel2 + // panel3 // - this.panel2.Controls.Add(this.groupBox7); - this.panel2.Controls.Add(this.panelEx2); - this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel2.Location = new System.Drawing.Point(0, 0); - this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(736, 855); - this.panel2.TabIndex = 1; + this.panel3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); + this.panel3.Controls.Add(this.groupBox5); + this.panel3.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel3.Location = new System.Drawing.Point(0, 465); + this.panel3.Margin = new System.Windows.Forms.Padding(2); + this.panel3.Name = "panel3"; + this.panel3.Size = new System.Drawing.Size(552, 219); + this.panel3.TabIndex = 10; // - // groupBox7 + // groupBox5 // - this.groupBox7.Controls.Add(this.hWindow_Final1); - this.groupBox7.Dock = System.Windows.Forms.DockStyle.Fill; - this.groupBox7.ForeColor = System.Drawing.Color.White; - this.groupBox7.Location = new System.Drawing.Point(0, 50); - this.groupBox7.Margin = new System.Windows.Forms.Padding(4); - this.groupBox7.Name = "groupBox7"; - this.groupBox7.Padding = new System.Windows.Forms.Padding(4); - this.groupBox7.Size = new System.Drawing.Size(736, 805); - this.groupBox7.TabIndex = 8; - this.groupBox7.TabStop = false; - this.groupBox7.Text = "图像显示区"; + this.groupBox5.Controls.Add(this.dataGridView1); + this.groupBox5.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox5.ForeColor = System.Drawing.Color.White; + this.groupBox5.Location = new System.Drawing.Point(0, 0); + this.groupBox5.Name = "groupBox5"; + this.groupBox5.Size = new System.Drawing.Size(552, 219); + this.groupBox5.TabIndex = 19; + this.groupBox5.TabStop = false; + this.groupBox5.Text = "测试定位结果"; // - // hWindow_Final1 + // dataGridView1 // - this.hWindow_Final1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(192)))), ((int)(((byte)(255))))); - this.hWindow_Final1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.hWindow_Final1.Dock = System.Windows.Forms.DockStyle.Fill; - this.hWindow_Final1.DrawModel = false; - this.hWindow_Final1.ForeColor = System.Drawing.Color.White; - this.hWindow_Final1.Image = null; - this.hWindow_Final1.Location = new System.Drawing.Point(4, 22); - this.hWindow_Final1.Margin = new System.Windows.Forms.Padding(5); - this.hWindow_Final1.Name = "hWindow_Final1"; - this.hWindow_Final1.Size = new System.Drawing.Size(728, 779); - this.hWindow_Final1.TabIndex = 6; + this.dataGridView1.AllowUserToAddRows = false; + this.dataGridView1.AllowUserToDeleteRows = false; + this.dataGridView1.AllowUserToResizeColumns = false; + this.dataGridView1.AllowUserToResizeRows = false; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); + dataGridViewCellStyle1.ForeColor = System.Drawing.Color.White; + this.dataGridView1.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; + this.dataGridView1.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill; + this.dataGridView1.BackgroundColor = System.Drawing.Color.FromArgb(((int)(((byte)(11)))), ((int)(((byte)(16)))), ((int)(((byte)(36))))); + this.dataGridView1.ColumnHeadersHeight = 30; + this.dataGridView1.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.Index, + this.X, + this.Y, + this.Move}); + this.dataGridView1.Dock = System.Windows.Forms.DockStyle.Fill; + this.dataGridView1.EnableHeadersVisualStyles = false; + this.dataGridView1.GridColor = System.Drawing.SystemColors.ActiveCaption; + this.dataGridView1.Location = new System.Drawing.Point(3, 17); + this.dataGridView1.MultiSelect = false; + this.dataGridView1.Name = "dataGridView1"; + this.dataGridView1.ReadOnly = true; + dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle5.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(11)))), ((int)(((byte)(16)))), ((int)(((byte)(36))))); + dataGridViewCellStyle5.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + dataGridViewCellStyle5.ForeColor = System.Drawing.Color.White; + dataGridViewCellStyle5.SelectionBackColor = System.Drawing.Color.White; + dataGridViewCellStyle5.SelectionForeColor = System.Drawing.Color.White; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridView1.RowHeadersDefaultCellStyle = dataGridViewCellStyle5; + this.dataGridView1.RowHeadersVisible = false; + this.dataGridView1.RowHeadersWidth = 30; + this.dataGridView1.RowHeadersWidthSizeMode = System.Windows.Forms.DataGridViewRowHeadersWidthSizeMode.DisableResizing; + this.dataGridView1.RowTemplate.DefaultCellStyle.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(11)))), ((int)(((byte)(16)))), ((int)(((byte)(36))))); + this.dataGridView1.RowTemplate.DefaultCellStyle.ForeColor = System.Drawing.Color.White; + this.dataGridView1.RowTemplate.DefaultCellStyle.SelectionBackColor = System.Drawing.Color.FromArgb(((int)(((byte)(11)))), ((int)(((byte)(16)))), ((int)(((byte)(36))))); + this.dataGridView1.RowTemplate.Height = 23; + this.dataGridView1.Size = new System.Drawing.Size(546, 199); + this.dataGridView1.TabIndex = 3; // - // panelEx2 + // Index // - this.panelEx2.Controls.Add(this.lblHeadText); - this.panelEx2.Dock = System.Windows.Forms.DockStyle.Top; - this.panelEx2.Location = new System.Drawing.Point(0, 0); - this.panelEx2.Margin = new System.Windows.Forms.Padding(4); - this.panelEx2.Name = "panelEx2"; - this.panelEx2.Size = new System.Drawing.Size(736, 50); - this.panelEx2.TabIndex = 2; + this.Index.DataPropertyName = "Index"; + this.Index.FillWeight = 26.47716F; + this.Index.HeaderText = "Row"; + this.Index.Name = "Index"; + this.Index.ReadOnly = true; // - // lblHeadText + // X // - this.lblHeadText.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(56)))), ((int)(((byte)(56)))), ((int)(((byte)(56))))); - this.lblHeadText.Dock = System.Windows.Forms.DockStyle.Fill; - this.lblHeadText.ForeColor = System.Drawing.Color.White; - this.lblHeadText.ImeMode = System.Windows.Forms.ImeMode.NoControl; - this.lblHeadText.Location = new System.Drawing.Point(0, 0); - this.lblHeadText.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); - this.lblHeadText.Name = "lblHeadText"; - this.lblHeadText.Size = new System.Drawing.Size(736, 50); - this.lblHeadText.TabIndex = 1; - this.lblHeadText.Text = "视觉模板"; - this.lblHeadText.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + this.X.DataPropertyName = "X"; + dataGridViewCellStyle2.Format = "0.000"; + this.X.DefaultCellStyle = dataGridViewCellStyle2; + this.X.FillWeight = 25.76511F; + this.X.HeaderText = "Column"; + this.X.Name = "X"; + this.X.ReadOnly = true; + // + // Y + // + this.Y.DataPropertyName = "Y"; + dataGridViewCellStyle3.Format = "0.000"; + this.Y.DefaultCellStyle = dataGridViewCellStyle3; + this.Y.FillWeight = 24.21075F; + this.Y.HeaderText = "Angle"; + this.Y.Name = "Y"; + this.Y.ReadOnly = true; + // + // Move + // + dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter; + dataGridViewCellStyle4.BackColor = System.Drawing.Color.Silver; + dataGridViewCellStyle4.ForeColor = System.Drawing.Color.White; + this.Move.DefaultCellStyle = dataGridViewCellStyle4; + this.Move.FillWeight = 26.00443F; + this.Move.HeaderText = "Score"; + this.Move.Name = "Move"; + this.Move.ReadOnly = true; + this.Move.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.Move.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; // // TemplateMatch // - this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 15F); + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(11)))), ((int)(((byte)(16)))), ((int)(((byte)(36))))); this.Controls.Add(this.panel2); this.Controls.Add(this.panel1); + this.Margin = new System.Windows.Forms.Padding(2); this.Name = "TemplateMatch"; - this.Size = new System.Drawing.Size(1164, 855); + this.Size = new System.Drawing.Size(873, 684); this.Load += new System.EventHandler(this.TemplateMatch_Load); this.panel1.ResumeLayout(false); - this.groupBox5.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.tbarContrast)).EndInit(); @@ -943,14 +971,19 @@ this.groupBox3.ResumeLayout(false); this.groupBox2.ResumeLayout(false); this.groupBox2.PerformLayout(); + this.panel2.ResumeLayout(false); + this.groupBox7.ResumeLayout(false); + this.groupBox6.ResumeLayout(false); + this.groupBox6.PerformLayout(); + this.panelEx2.ResumeLayout(false); this.panelEx5.ResumeLayout(false); this.panelEx11.ResumeLayout(false); this.panelEx10.ResumeLayout(false); this.panelEx4.ResumeLayout(false); this.tableLayoutPanel1.ResumeLayout(false); - this.panel2.ResumeLayout(false); - this.groupBox7.ResumeLayout(false); - this.panelEx2.ResumeLayout(false); + this.panel3.ResumeLayout(false); + this.groupBox5.ResumeLayout(false); + ((System.ComponentModel.ISupportInitialize)(this.dataGridView1)).EndInit(); this.ResumeLayout(false); } @@ -1003,15 +1036,21 @@ private System.Windows.Forms.Label label9; private System.Windows.Forms.Label lblContrast; private System.Windows.Forms.Label label3; + private PanelEx panelEx2; + private System.Windows.Forms.Label lblHeadText; + private System.Windows.Forms.GroupBox groupBox7; + private ChoiceTech.Halcon.Control.HWindow_Final hWindow_Final1; + private System.Windows.Forms.TextBox txtGain; + private System.Windows.Forms.Label label2; + private System.Windows.Forms.TextBox txtExposure; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.GroupBox groupBox6; + private System.Windows.Forms.Panel panel3; private System.Windows.Forms.GroupBox groupBox5; private System.Windows.Forms.DataGridView dataGridView1; private System.Windows.Forms.DataGridViewTextBoxColumn Index; private System.Windows.Forms.DataGridViewTextBoxColumn X; private System.Windows.Forms.DataGridViewTextBoxColumn Y; private System.Windows.Forms.DataGridViewTextBoxColumn Move; - private PanelEx panelEx2; - private System.Windows.Forms.Label lblHeadText; - private System.Windows.Forms.GroupBox groupBox7; - private ChoiceTech.Halcon.Control.HWindow_Final hWindow_Final1; } } diff --git a/Rs.Controls/TemplateMatch.cs b/Rs.Controls/TemplateMatch.cs index c34d512..adb58b0 100644 --- a/Rs.Controls/TemplateMatch.cs +++ b/Rs.Controls/TemplateMatch.cs @@ -54,11 +54,6 @@ namespace Rs.Controls this.eFindShapeMode = eFindShapeMode; } - public void AttachFindShapeEvent(Action fun) - { - FindShapeEvent = fun; - } - static int i = 0; private void Instance_GrabOkEvent(int arg1, HObject arg2) { @@ -577,6 +572,8 @@ namespace Rs.Controls pm.AngleStart = int.Parse(txtAngleStart.Text); pm.AngleExtent = int.Parse(txtAngleExtent.Text); pm.Score = double.Parse(txtScore.Text); + pm.Exposure=int.Parse(txtExposure.Text); + pm.Gain = int.Parse(txtGain.Text); //pm.ItemName = m_itemName; pm.SaveModel(m_savePath); Msg.ShowInfo("Save product model success!"); @@ -634,6 +631,7 @@ namespace Rs.Controls HOperatorSet.GetImageSize(hImage, out HTuple imgWidth, out HTuple imgHeight); HOperatorSet.GenCrossContourXld(out HObject camCenter, imgHeight / 2, imgWidth / 2, Math.Max(imgHeight, imgWidth), 0); hWindow_Final1.DispObj(camCenter, "green"); + FindShapeEvent?.Invoke(hWindow_Final1, hImage); } } else @@ -713,12 +711,16 @@ namespace Rs.Controls string angleStart = ini.ReadValue("ModelParam", "AngleStart"); string angleExtent = ini.ReadValue("ModelParam", "AngleExtent"); string score = ini.ReadValue("ModelParam", "Score"); + string exposure = ini.ReadValue("ModelParam", "Exposure"); + string gain = ini.ReadValue("ModelParam", "Gain"); if (!string.IsNullOrEmpty(contrast) && !string.IsNullOrEmpty(angleStart) && !string.IsNullOrEmpty(angleExtent) && !string.IsNullOrEmpty(score)) { tbarContrast.Value = int.Parse(contrast); txtAngleStart.Text = angleStart; txtAngleExtent.Text = angleExtent; txtScore.Text = score; + txtExposure.Text = exposure; + txtGain.Text = gain; } } } @@ -806,5 +808,29 @@ namespace Rs.Controls hWindow_Final1.DrawModel = false; } + + public int GetExposure() + { + if(int.TryParse(txtExposure.Text,out int value)) + return value; + return -1; + } + + public int GetGain() + { + if(int.TryParse((txtGain.Text),out int value)) + return value; + return -1; + } + + public HObject GetImage() + { + return hImage; + } + + public DataGridViewRowCollection GetResultRows() + { + return this.dataGridView1.Rows; + } } }