diff --git a/.vs/VisionEdit/v14/.suo b/.vs/VisionEdit/v14/.suo index 79a9b5e..9159d43 100644 Binary files a/.vs/VisionEdit/v14/.suo and b/.vs/VisionEdit/v14/.suo differ diff --git a/CaliperTool/CaliperTool.csproj b/CaliperTool/CaliperTool.csproj index 1d4a675..c880084 100644 --- a/CaliperTool/CaliperTool.csproj +++ b/CaliperTool/CaliperTool.csproj @@ -1,4 +1,4 @@ - + @@ -9,8 +9,9 @@ Properties CaliperTool CaliperTool - v4.5.2 + v4.6.1 512 + true diff --git a/CommonMethods/CommonHelper.csproj b/CommonMethods/CommonHelper.csproj index b22e8ac..1101403 100644 --- a/CommonMethods/CommonHelper.csproj +++ b/CommonMethods/CommonHelper.csproj @@ -1,4 +1,4 @@ - + @@ -9,8 +9,9 @@ Properties CommonMethods CommonMethods - v4.5.2 + v4.6.1 512 + true diff --git a/DataStruct/DataStruct.csproj b/DataStruct/DataStruct.csproj index 7f48e87..f959560 100644 --- a/DataStruct/DataStruct.csproj +++ b/DataStruct/DataStruct.csproj @@ -1,4 +1,4 @@ - + @@ -9,8 +9,9 @@ Properties DataStruct DataStruct - v4.5.2 + v4.6.1 512 + true diff --git a/FindCircle/FindCircleTool.csproj b/FindCircle/FindCircleTool.csproj index 3455cae..d3f1313 100644 --- a/FindCircle/FindCircleTool.csproj +++ b/FindCircle/FindCircleTool.csproj @@ -1,4 +1,4 @@ - + @@ -9,8 +9,9 @@ Properties FindCircleTool FindCircleTool - v4.5.2 + v4.6.1 512 + true diff --git a/FindLine/FindLine.cs b/FindLine/FindLine.cs index f1cc44a..cc3c371 100644 --- a/FindLine/FindLine.cs +++ b/FindLine/FindLine.cs @@ -346,46 +346,6 @@ namespace FindLineTool //arrowTrans.Dispose(); } } - - internal void DrawExpectLine(HWindow myHwindow) - { - - /* - if(inputImage != null) - { - try - { - HOperatorSet.SetColor(myHwindow, new HTuple("green")); - Stopwatch sw = new Stopwatch(); - sw.Restart(); - HOperatorSet.DrawLineMod(myHwindow, newExpectLineStartRow, newExpectLineStartCol, newExpectLineEndRow, newExpectLineEndCol, out expectLineStartRow, out expectLineStartCol, out expectLineEndRow, out expectLineEndCol); - - if (inputPose != null) - { - templatePose.X = inputPose.X; - templatePose.Y = inputPose.Y; - templatePose.U = inputPose.U; - } - - FormFindLine.Instance.tbx_expectLineStartRow.Text = expectLineStartRow.TupleString("10.3f"); - FormFindLine.Instance.tbx_expectLineStartCol.Text = expectLineStartCol.TupleString("10.3f"); - FormFindLine.Instance.tbx_expectLineEndRow.Text = expectLineEndRow.TupleString("10.3f"); - FormFindLine.Instance.tbx_expectLineEndCol.Text = expectLineEndCol.TupleString("10.3f"); - - Run(SoftwareRunState.Debug); - } - catch (Exception ex) - { - FormFindLine.Instance.SetToolStatus($"编辑卡尺时工具出现异常!{ex}", ToolRunStatu.Tool_Run_Error); - } - } - else - { - FormFindLine.Instance.SetToolStatus("输入图像为空!", ToolRunStatu.Not_Input_Image); - } - */ - } - /// /// 将数据传递给FindlineToolInterface /// diff --git a/FindLine/FindLineTool.csproj b/FindLine/FindLineTool.csproj index a2fe512..cae03de 100644 --- a/FindLine/FindLineTool.csproj +++ b/FindLine/FindLineTool.csproj @@ -1,4 +1,4 @@ - + @@ -9,8 +9,9 @@ Properties FindLineTool FindLineTool - v4.5.2 + v4.6.1 512 + true diff --git a/FindLine/FindLineToolRun.cs b/FindLine/FindLineToolRun.cs index f0c3150..d7d6323 100644 --- a/FindLine/FindLineToolRun.cs +++ b/FindLine/FindLineToolRun.cs @@ -25,6 +25,7 @@ using System.Text.RegularExpressions; using System.Threading.Tasks; using System.Windows.Forms; using ToolLib.VisionJob; +using static DataStruct.DataStruct; namespace FindLineTool { @@ -38,18 +39,30 @@ namespace FindLineTool { if (L_toolList[toolIndex].GetInput(L_toolList[toolIndex].toolInput[j].IOName).value == null) { - selectNode.ForeColor = Color.Red; - LoggerClass.WriteLog(L_toolList[toolIndex].toolName + " 无输入图像", MsgLevel.Exception); + // 仅当无输入图像时,将工具置为错误 + if (L_toolList[toolIndex].toolInput[j].IOName == "InputImage") + { + selectNode.ForeColor = Color.Red; + LoggerClass.WriteLog(L_toolList[toolIndex].toolName + " 无输入图像", MsgLevel.Exception); + myFindLine.runMessage = "无输入图像"; + } } else { string sourceFrom = L_toolList[toolIndex].GetInput(L_toolList[toolIndex].toolInput[j].IOName).value.ToString(); - if (L_toolList[toolIndex].toolInput[j].IOName == "InputImage") + string sourceToolName = Regex.Split(sourceFrom, "->")[0]; + sourceToolName = sourceToolName.Substring(3, Regex.Split(sourceFrom, "->")[0].Length - 3); + string toolItem = Regex.Split(sourceFrom, "->")[1]; + switch (L_toolList[toolIndex].toolInput[j].IOName) { - string sourceToolName = Regex.Split(sourceFrom, "->")[0]; - sourceToolName = sourceToolName.Substring(3, Regex.Split(sourceFrom, "->")[0].Length - 3); - string toolItem = Regex.Split(sourceFrom, "->")[1]; - myFindLine.inputImage = myJob.GetToolInfoByToolName(sourceToolName).GetOutput(toolItem).value as HObject; + case "InputImage": + myFindLine.inputImage = myJob.GetToolInfoByToolName(sourceToolName).GetOutput(toolItem).value as HObject; + break; + case "InputPos": + myFindLine.inputPose = myJob.GetToolInfoByToolName(sourceToolName).GetOutput(toolItem).value as PosXYU; + break; + default: + break; } } } diff --git a/FormLib/FormImageWindow.cs.cs b/FormLib/FormImageWindow.cs.cs index 8c8431f..9f1848f 100644 --- a/FormLib/FormImageWindow.cs.cs +++ b/FormLib/FormImageWindow.cs.cs @@ -42,5 +42,10 @@ namespace FormLib this.panel1.Controls.Add(myHWindow); myHWindow.Dock = DockStyle.Fill; } + + public void ClearWindow() + { + myHWindow.DispHWindow.ClearWindow(); + } } } diff --git a/FormLib/FormLib.csproj b/FormLib/FormLib.csproj index 2f02716..8f028e9 100644 --- a/FormLib/FormLib.csproj +++ b/FormLib/FormLib.csproj @@ -9,8 +9,9 @@ Properties FormLib FormLib - v4.5.2 + v4.6.1 512 + true @@ -78,18 +79,10 @@ {1c8d0ddc-2086-48a9-9586-f2b643e2fc54} CommonHelper - - {df3d4d4c-02df-4f92-9fd4-0a861f64b0ef} - DataStruct - {9BAA53FD-89B5-43E2-AC59-A27B006DEBB6} HWindow_Tool - - {7cd50b44-bf56-4e8e-8fa1-05f6968c1835} - ToolBase - {D4E052B9-E541-4B67-A1F9-273073EF1D4B} Logger diff --git a/HalconTool/FormHalconTool.Designer.cs b/HalconTool/FormHalconTool.Designer.cs index 66ab304..b66ce58 100644 --- a/HalconTool/FormHalconTool.Designer.cs +++ b/HalconTool/FormHalconTool.Designer.cs @@ -30,62 +30,31 @@ namespace HalconTool { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(FormHalconTool)); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); - this.superTabControl1 = new DevComponents.DotNetBar.SuperTabControl(); - this.superTabControlPanel1 = new DevComponents.DotNetBar.SuperTabControlPanel(); - this.panelMultImage = new System.Windows.Forms.Panel(); - this.gpb_multImage = new System.Windows.Forms.GroupBox(); - this.btn_selectImageDirectory = new System.Windows.Forms.Button(); - this.lbl_imageNum = new System.Windows.Forms.Label(); - this.lbl_imageName = new System.Windows.Forms.Label(); - this.btn_lastImage = new System.Windows.Forms.Button(); - this.btn_nextImage = new System.Windows.Forms.Button(); - this.tbx_imageDirectory = new System.Windows.Forms.TextBox(); - this.panelOneImage = new System.Windows.Forms.Panel(); - this.gpb_oneImage = new System.Windows.Forms.GroupBox(); - this.btn_readImage = new System.Windows.Forms.Button(); - this.tbx_imagePath = new System.Windows.Forms.TextBox(); - this.btn_browseImage = new System.Windows.Forms.Button(); - this.ckb_autoSwitch = new System.Windows.Forms.CheckBox(); - this.btn_runHalconInterfaceTool = new System.Windows.Forms.Button(); - this.btn_registImage = new System.Windows.Forms.Button(); - this.rdo_readOneImage = new System.Windows.Forms.RadioButton(); - this.rdo_readMultImage = new System.Windows.Forms.RadioButton(); - this.ckb_RGBToGray = new System.Windows.Forms.CheckBox(); - this.tabReadFormLocal = new DevComponents.DotNetBar.SuperTabItem(); - this.superTabControlPanel2 = new DevComponents.DotNetBar.SuperTabControlPanel(); - this.checkBox1 = new System.Windows.Forms.CheckBox(); - this.btn_RealTime = new System.Windows.Forms.Button(); - this.cbx_deviceList = new System.Windows.Forms.ComboBox(); - this.button1 = new System.Windows.Forms.Button(); - this.label148 = new System.Windows.Forms.Label(); - this.tbx_exposure = new System.Windows.Forms.TextBox(); - this.button2 = new System.Windows.Forms.Button(); - this.label147 = new System.Windows.Forms.Label(); - this.btn_saveImage = new System.Windows.Forms.Button(); - this.label123 = new System.Windows.Forms.Label(); - this.tabReadFormCamera = new DevComponents.DotNetBar.SuperTabItem(); - this.superTabControl2 = new DevComponents.DotNetBar.SuperTabControl(); - this.imageDispPanel = new DevComponents.DotNetBar.SuperTabControlPanel(); - this.superTabItem1 = new DevComponents.DotNetBar.SuperTabItem(); this.statusStrip = new System.Windows.Forms.StatusStrip(); this.lb_RunStatus = new System.Windows.Forms.ToolStripStatusLabel(); this.lb_Split = new System.Windows.Forms.ToolStripStatusLabel(); this.lb_RunTime = new System.Windows.Forms.ToolStripStatusLabel(); + this.tabGrabImage = new Sunny.UI.UITabControl(); + this.grabFile = new System.Windows.Forms.TabPage(); + this.camera = new System.Windows.Forms.TabPage(); + this.gbImageDisp = new Sunny.UI.UIGroupBox(); + this.uiMarkLabel2 = new Sunny.UI.UIMarkLabel(); + this.uiLabel1 = new Sunny.UI.UILabel(); + this.txbFilePath = new Sunny.UI.UITextBox(); + this.btnSelectFilePath = new Sunny.UI.UISymbolButton(); + this.btnRun = new Sunny.UI.UISymbolButton(); + this.uiGroupBox2 = new Sunny.UI.UIGroupBox(); + this.uiGroupBox3 = new Sunny.UI.UIGroupBox(); + this.chbRGB2Gray = new Sunny.UI.UICheckBox(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.superTabControl1)).BeginInit(); - this.superTabControl1.SuspendLayout(); - this.superTabControlPanel1.SuspendLayout(); - this.panelMultImage.SuspendLayout(); - this.gpb_multImage.SuspendLayout(); - this.panelOneImage.SuspendLayout(); - this.gpb_oneImage.SuspendLayout(); - this.superTabControlPanel2.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.superTabControl2)).BeginInit(); - this.superTabControl2.SuspendLayout(); this.statusStrip.SuspendLayout(); + this.tabGrabImage.SuspendLayout(); + this.grabFile.SuspendLayout(); + this.camera.SuspendLayout(); + this.uiGroupBox2.SuspendLayout(); this.SuspendLayout(); // // splitContainer1 @@ -98,521 +67,15 @@ namespace HalconTool // // splitContainer1.Panel1 // - this.splitContainer1.Panel1.Controls.Add(this.superTabControl1); + this.splitContainer1.Panel1.Controls.Add(this.tabGrabImage); // // splitContainer1.Panel2 // - this.splitContainer1.Panel2.Controls.Add(this.superTabControl2); + this.splitContainer1.Panel2.Controls.Add(this.gbImageDisp); this.splitContainer1.Size = new System.Drawing.Size(1111, 517); this.splitContainer1.SplitterDistance = 605; this.splitContainer1.TabIndex = 1; // - // superTabControl1 - // - this.superTabControl1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(239)))), ((int)(((byte)(239)))), ((int)(((byte)(242))))); - // - // - // - // - // - // - this.superTabControl1.ControlBox.CloseBox.Name = ""; - // - // - // - this.superTabControl1.ControlBox.MenuBox.Name = ""; - this.superTabControl1.ControlBox.Name = ""; - this.superTabControl1.ControlBox.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.superTabControl1.ControlBox.MenuBox, - this.superTabControl1.ControlBox.CloseBox}); - this.superTabControl1.Controls.Add(this.superTabControlPanel1); - this.superTabControl1.Controls.Add(this.superTabControlPanel2); - this.superTabControl1.Dock = System.Windows.Forms.DockStyle.Fill; - this.superTabControl1.ForeColor = System.Drawing.Color.Black; - this.superTabControl1.Location = new System.Drawing.Point(0, 0); - this.superTabControl1.Name = "superTabControl1"; - this.superTabControl1.ReorderTabsEnabled = true; - this.superTabControl1.SelectedTabFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold); - this.superTabControl1.SelectedTabIndex = 0; - this.superTabControl1.Size = new System.Drawing.Size(605, 517); - this.superTabControl1.TabFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.superTabControl1.TabIndex = 1; - this.superTabControl1.Tabs.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.tabReadFormLocal, - this.tabReadFormCamera}); - this.superTabControl1.TabStyle = DevComponents.DotNetBar.eSuperTabStyle.OfficeMobile2014; - this.superTabControl1.Text = "superTabControl1"; - // - // superTabControlPanel1 - // - this.superTabControlPanel1.Controls.Add(this.panelMultImage); - this.superTabControlPanel1.Controls.Add(this.panelOneImage); - this.superTabControlPanel1.Controls.Add(this.btn_browseImage); - this.superTabControlPanel1.Controls.Add(this.ckb_autoSwitch); - this.superTabControlPanel1.Controls.Add(this.btn_runHalconInterfaceTool); - this.superTabControlPanel1.Controls.Add(this.btn_registImage); - this.superTabControlPanel1.Controls.Add(this.rdo_readOneImage); - this.superTabControlPanel1.Controls.Add(this.rdo_readMultImage); - this.superTabControlPanel1.Controls.Add(this.ckb_RGBToGray); - this.superTabControlPanel1.Dock = System.Windows.Forms.DockStyle.Fill; - this.superTabControlPanel1.Location = new System.Drawing.Point(0, 36); - this.superTabControlPanel1.Name = "superTabControlPanel1"; - this.superTabControlPanel1.Size = new System.Drawing.Size(605, 481); - this.superTabControlPanel1.TabIndex = 1; - this.superTabControlPanel1.TabItem = this.tabReadFormLocal; - // - // panelMultImage - // - this.panelMultImage.BackColor = System.Drawing.Color.White; - this.panelMultImage.Controls.Add(this.gpb_multImage); - this.panelMultImage.Location = new System.Drawing.Point(77, 69); - this.panelMultImage.Name = "panelMultImage"; - this.panelMultImage.Size = new System.Drawing.Size(462, 182); - this.panelMultImage.TabIndex = 92; - // - // gpb_multImage - // - this.gpb_multImage.Controls.Add(this.btn_selectImageDirectory); - this.gpb_multImage.Controls.Add(this.lbl_imageNum); - this.gpb_multImage.Controls.Add(this.lbl_imageName); - this.gpb_multImage.Controls.Add(this.btn_lastImage); - this.gpb_multImage.Controls.Add(this.btn_nextImage); - this.gpb_multImage.Controls.Add(this.tbx_imageDirectory); - this.gpb_multImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.gpb_multImage.Location = new System.Drawing.Point(6, 4); - this.gpb_multImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.gpb_multImage.Name = "gpb_multImage"; - this.gpb_multImage.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.gpb_multImage.Size = new System.Drawing.Size(451, 170); - this.gpb_multImage.TabIndex = 15; - this.gpb_multImage.TabStop = false; - this.gpb_multImage.Text = "图像文件夹路径"; - // - // btn_selectImageDirectory - // - this.btn_selectImageDirectory.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btn_selectImageDirectory.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btn_selectImageDirectory.Location = new System.Drawing.Point(18, 99); - this.btn_selectImageDirectory.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.btn_selectImageDirectory.Name = "btn_selectImageDirectory"; - this.btn_selectImageDirectory.Size = new System.Drawing.Size(98, 32); - this.btn_selectImageDirectory.TabIndex = 63; - this.btn_selectImageDirectory.Text = "选择路径"; - this.btn_selectImageDirectory.UseVisualStyleBackColor = true; - this.btn_selectImageDirectory.Click += new System.EventHandler(this.btn_selectImageDirectory_Click); - // - // lbl_imageNum - // - this.lbl_imageNum.AutoSize = true; - this.lbl_imageNum.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.lbl_imageNum.Location = new System.Drawing.Point(386, 70); - this.lbl_imageNum.Name = "lbl_imageNum"; - this.lbl_imageNum.RightToLeft = System.Windows.Forms.RightToLeft.Yes; - this.lbl_imageNum.Size = new System.Drawing.Size(39, 17); - this.lbl_imageNum.TabIndex = 62; - this.lbl_imageNum.Text = "共0张"; - this.lbl_imageNum.TextAlign = System.Drawing.ContentAlignment.MiddleRight; - // - // lbl_imageName - // - this.lbl_imageName.AutoSize = true; - this.lbl_imageName.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.lbl_imageName.Location = new System.Drawing.Point(15, 70); - this.lbl_imageName.Name = "lbl_imageName"; - this.lbl_imageName.Size = new System.Drawing.Size(0, 17); - this.lbl_imageName.TabIndex = 61; - // - // btn_lastImage - // - this.btn_lastImage.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btn_lastImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btn_lastImage.Location = new System.Drawing.Point(339, 99); - this.btn_lastImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.btn_lastImage.Name = "btn_lastImage"; - this.btn_lastImage.Size = new System.Drawing.Size(33, 32); - this.btn_lastImage.TabIndex = 9; - this.btn_lastImage.TabStop = false; - this.btn_lastImage.Text = "<<"; - this.btn_lastImage.UseVisualStyleBackColor = true; - this.btn_lastImage.Click += new System.EventHandler(this.btn_nextImage_Click); - // - // btn_nextImage - // - this.btn_nextImage.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btn_nextImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btn_nextImage.Location = new System.Drawing.Point(375, 99); - this.btn_nextImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.btn_nextImage.Name = "btn_nextImage"; - this.btn_nextImage.Size = new System.Drawing.Size(33, 32); - this.btn_nextImage.TabIndex = 8; - this.btn_nextImage.TabStop = false; - this.btn_nextImage.Text = ">>"; - this.btn_nextImage.UseVisualStyleBackColor = true; - this.btn_nextImage.Click += new System.EventHandler(this.btn_nextImage_Click); - // - // tbx_imageDirectory - // - this.tbx_imageDirectory.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.tbx_imageDirectory.Location = new System.Drawing.Point(18, 28); - this.tbx_imageDirectory.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.tbx_imageDirectory.Multiline = true; - this.tbx_imageDirectory.Name = "tbx_imageDirectory"; - this.tbx_imageDirectory.Size = new System.Drawing.Size(415, 38); - this.tbx_imageDirectory.TabIndex = 5; - // - // panelOneImage - // - this.panelOneImage.BackColor = System.Drawing.Color.White; - this.panelOneImage.Controls.Add(this.gpb_oneImage); - this.panelOneImage.Location = new System.Drawing.Point(79, 69); - this.panelOneImage.Name = "panelOneImage"; - this.panelOneImage.Size = new System.Drawing.Size(460, 176); - this.panelOneImage.TabIndex = 91; - // - // gpb_oneImage - // - this.gpb_oneImage.BackColor = System.Drawing.Color.White; - this.gpb_oneImage.Controls.Add(this.btn_readImage); - this.gpb_oneImage.Controls.Add(this.tbx_imagePath); - this.gpb_oneImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.gpb_oneImage.Location = new System.Drawing.Point(9, 10); - this.gpb_oneImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.gpb_oneImage.Name = "gpb_oneImage"; - this.gpb_oneImage.Padding = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.gpb_oneImage.Size = new System.Drawing.Size(440, 153); - this.gpb_oneImage.TabIndex = 83; - this.gpb_oneImage.TabStop = false; - this.gpb_oneImage.Text = "图像路径"; - // - // btn_readImage - // - this.btn_readImage.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btn_readImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btn_readImage.Location = new System.Drawing.Point(21, 95); - this.btn_readImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.btn_readImage.Name = "btn_readImage"; - this.btn_readImage.Size = new System.Drawing.Size(85, 32); - this.btn_readImage.TabIndex = 3; - this.btn_readImage.Text = "加载"; - this.btn_readImage.UseVisualStyleBackColor = true; - this.btn_readImage.Click += new System.EventHandler(this.btn_readImage_Click); - // - // tbx_imagePath - // - this.tbx_imagePath.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.tbx_imagePath.Location = new System.Drawing.Point(18, 28); - this.tbx_imagePath.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.tbx_imagePath.Name = "tbx_imagePath"; - this.tbx_imagePath.Size = new System.Drawing.Size(415, 23); - this.tbx_imagePath.TabIndex = 1; - // - // btn_browseImage - // - this.btn_browseImage.BackColor = System.Drawing.Color.White; - this.btn_browseImage.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btn_browseImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btn_browseImage.Location = new System.Drawing.Point(156, 357); - this.btn_browseImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.btn_browseImage.Name = "btn_browseImage"; - this.btn_browseImage.Size = new System.Drawing.Size(76, 26); - this.btn_browseImage.TabIndex = 90; - this.btn_browseImage.Text = "查看图像"; - this.btn_browseImage.UseVisualStyleBackColor = false; - // - // ckb_autoSwitch - // - this.ckb_autoSwitch.AutoSize = true; - this.ckb_autoSwitch.BackColor = System.Drawing.Color.White; - this.ckb_autoSwitch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.ckb_autoSwitch.Location = new System.Drawing.Point(74, 322); - this.ckb_autoSwitch.Margin = new System.Windows.Forms.Padding(2); - this.ckb_autoSwitch.Name = "ckb_autoSwitch"; - this.ckb_autoSwitch.Size = new System.Drawing.Size(99, 21); - this.ckb_autoSwitch.TabIndex = 82; - this.ckb_autoSwitch.Text = "图像自动切换"; - this.ckb_autoSwitch.UseVisualStyleBackColor = false; - // - // btn_runHalconInterfaceTool - // - this.btn_runHalconInterfaceTool.BackColor = System.Drawing.Color.White; - this.btn_runHalconInterfaceTool.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btn_runHalconInterfaceTool.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btn_runHalconInterfaceTool.Location = new System.Drawing.Point(436, 348); - this.btn_runHalconInterfaceTool.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.btn_runHalconInterfaceTool.Name = "btn_runHalconInterfaceTool"; - this.btn_runHalconInterfaceTool.Size = new System.Drawing.Size(98, 45); - this.btn_runHalconInterfaceTool.TabIndex = 88; - this.btn_runHalconInterfaceTool.TabStop = false; - this.btn_runHalconInterfaceTool.Text = "运行"; - this.btn_runHalconInterfaceTool.UseVisualStyleBackColor = false; - this.btn_runHalconInterfaceTool.Click += new System.EventHandler(this.btn_runHalconInterfaceTool_Click); - // - // btn_registImage - // - this.btn_registImage.BackColor = System.Drawing.Color.White; - this.btn_registImage.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btn_registImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btn_registImage.Location = new System.Drawing.Point(74, 357); - this.btn_registImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.btn_registImage.Name = "btn_registImage"; - this.btn_registImage.Size = new System.Drawing.Size(76, 26); - this.btn_registImage.TabIndex = 84; - this.btn_registImage.Text = "注册图像"; - this.btn_registImage.UseVisualStyleBackColor = false; - // - // rdo_readOneImage - // - this.rdo_readOneImage.AutoSize = true; - this.rdo_readOneImage.BackColor = System.Drawing.Color.White; - this.rdo_readOneImage.Checked = true; - this.rdo_readOneImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.rdo_readOneImage.Location = new System.Drawing.Point(365, 25); - this.rdo_readOneImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.rdo_readOneImage.Name = "rdo_readOneImage"; - this.rdo_readOneImage.Size = new System.Drawing.Size(74, 21); - this.rdo_readOneImage.TabIndex = 86; - this.rdo_readOneImage.TabStop = true; - this.rdo_readOneImage.Text = "单张图像"; - this.rdo_readOneImage.UseVisualStyleBackColor = false; - this.rdo_readOneImage.Click += new System.EventHandler(this.rdo_readMultImage_CheckedChanged); - // - // rdo_readMultImage - // - this.rdo_readMultImage.AutoSize = true; - this.rdo_readMultImage.BackColor = System.Drawing.Color.White; - this.rdo_readMultImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.rdo_readMultImage.Location = new System.Drawing.Point(139, 25); - this.rdo_readMultImage.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.rdo_readMultImage.Name = "rdo_readMultImage"; - this.rdo_readMultImage.Size = new System.Drawing.Size(74, 21); - this.rdo_readMultImage.TabIndex = 85; - this.rdo_readMultImage.Text = "多张图像"; - this.rdo_readMultImage.UseVisualStyleBackColor = false; - this.rdo_readMultImage.Click += new System.EventHandler(this.rdo_readMultImage_CheckedChanged); - // - // ckb_RGBToGray - // - this.ckb_RGBToGray.AutoSize = true; - this.ckb_RGBToGray.BackColor = System.Drawing.Color.White; - this.ckb_RGBToGray.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.ckb_RGBToGray.Location = new System.Drawing.Point(74, 297); - this.ckb_RGBToGray.Margin = new System.Windows.Forms.Padding(2); - this.ckb_RGBToGray.Name = "ckb_RGBToGray"; - this.ckb_RGBToGray.Size = new System.Drawing.Size(99, 21); - this.ckb_RGBToGray.TabIndex = 89; - this.ckb_RGBToGray.Text = "彩图转灰度图"; - this.ckb_RGBToGray.UseVisualStyleBackColor = false; - // - // tabReadFormLocal - // - this.tabReadFormLocal.AttachedControl = this.superTabControlPanel1; - this.tabReadFormLocal.GlobalItem = false; - this.tabReadFormLocal.Name = "tabReadFormLocal"; - this.tabReadFormLocal.Text = "本地读取"; - // - // superTabControlPanel2 - // - this.superTabControlPanel2.Controls.Add(this.checkBox1); - this.superTabControlPanel2.Controls.Add(this.btn_RealTime); - this.superTabControlPanel2.Controls.Add(this.cbx_deviceList); - this.superTabControlPanel2.Controls.Add(this.button1); - this.superTabControlPanel2.Controls.Add(this.label148); - this.superTabControlPanel2.Controls.Add(this.tbx_exposure); - this.superTabControlPanel2.Controls.Add(this.button2); - this.superTabControlPanel2.Controls.Add(this.label147); - this.superTabControlPanel2.Controls.Add(this.btn_saveImage); - this.superTabControlPanel2.Controls.Add(this.label123); - this.superTabControlPanel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.superTabControlPanel2.Location = new System.Drawing.Point(0, 36); - this.superTabControlPanel2.Name = "superTabControlPanel2"; - this.superTabControlPanel2.Size = new System.Drawing.Size(590, 441); - this.superTabControlPanel2.TabIndex = 0; - this.superTabControlPanel2.TabItem = this.tabReadFormCamera; - // - // checkBox1 - // - this.checkBox1.AutoSize = true; - this.checkBox1.BackColor = System.Drawing.Color.White; - this.checkBox1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.checkBox1.Location = new System.Drawing.Point(46, 164); - this.checkBox1.Margin = new System.Windows.Forms.Padding(2); - this.checkBox1.Name = "checkBox1"; - this.checkBox1.Size = new System.Drawing.Size(99, 21); - this.checkBox1.TabIndex = 113; - this.checkBox1.Text = "彩图转灰度图"; - this.checkBox1.UseVisualStyleBackColor = false; - // - // btn_RealTime - // - this.btn_RealTime.BackColor = System.Drawing.Color.White; - this.btn_RealTime.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btn_RealTime.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btn_RealTime.Location = new System.Drawing.Point(150, 200); - this.btn_RealTime.Margin = new System.Windows.Forms.Padding(2); - this.btn_RealTime.Name = "btn_RealTime"; - this.btn_RealTime.Size = new System.Drawing.Size(76, 26); - this.btn_RealTime.TabIndex = 110; - this.btn_RealTime.Text = "实时显示"; - this.btn_RealTime.UseVisualStyleBackColor = false; - // - // cbx_deviceList - // - this.cbx_deviceList.BackColor = System.Drawing.Color.Gainsboro; - this.cbx_deviceList.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; - this.cbx_deviceList.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.cbx_deviceList.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.cbx_deviceList.FormattingEnabled = true; - this.cbx_deviceList.Items.AddRange(new object[] { - ""}); - this.cbx_deviceList.Location = new System.Drawing.Point(49, 61); - this.cbx_deviceList.Margin = new System.Windows.Forms.Padding(2); - this.cbx_deviceList.Name = "cbx_deviceList"; - this.cbx_deviceList.Size = new System.Drawing.Size(522, 25); - this.cbx_deviceList.TabIndex = 104; - // - // button1 - // - this.button1.BackColor = System.Drawing.Color.White; - this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.button1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.button1.Location = new System.Drawing.Point(460, 288); - this.button1.Margin = new System.Windows.Forms.Padding(2); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(98, 45); - this.button1.TabIndex = 109; - this.button1.Text = "运行"; - this.button1.UseVisualStyleBackColor = false; - // - // label148 - // - this.label148.AutoSize = true; - this.label148.BackColor = System.Drawing.Color.White; - this.label148.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label148.Location = new System.Drawing.Point(170, 107); - this.label148.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label148.Name = "label148"; - this.label148.Size = new System.Drawing.Size(25, 17); - this.label148.TabIndex = 107; - this.label148.Text = "ms"; - // - // tbx_exposure - // - this.tbx_exposure.BackColor = System.Drawing.Color.White; - this.tbx_exposure.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.tbx_exposure.Location = new System.Drawing.Point(109, 103); - this.tbx_exposure.Margin = new System.Windows.Forms.Padding(2); - this.tbx_exposure.Name = "tbx_exposure"; - this.tbx_exposure.Size = new System.Drawing.Size(61, 23); - this.tbx_exposure.TabIndex = 106; - this.tbx_exposure.Text = "0"; - // - // button2 - // - this.button2.BackColor = System.Drawing.Color.White; - this.button2.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.button2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.button2.Location = new System.Drawing.Point(46, 200); - this.button2.Margin = new System.Windows.Forms.Padding(2); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(76, 26); - this.button2.TabIndex = 112; - this.button2.Text = "注册图像"; - this.button2.UseVisualStyleBackColor = false; - // - // label147 - // - this.label147.AutoSize = true; - this.label147.BackColor = System.Drawing.Color.White; - this.label147.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label147.Location = new System.Drawing.Point(46, 106); - this.label147.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label147.Name = "label147"; - this.label147.Size = new System.Drawing.Size(68, 17); - this.label147.TabIndex = 105; - this.label147.Text = "曝光时间:"; - // - // btn_saveImage - // - this.btn_saveImage.BackColor = System.Drawing.Color.White; - this.btn_saveImage.FlatStyle = System.Windows.Forms.FlatStyle.Flat; - this.btn_saveImage.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btn_saveImage.Location = new System.Drawing.Point(248, 200); - this.btn_saveImage.Margin = new System.Windows.Forms.Padding(2); - this.btn_saveImage.Name = "btn_saveImage"; - this.btn_saveImage.Size = new System.Drawing.Size(76, 26); - this.btn_saveImage.TabIndex = 111; - this.btn_saveImage.Text = "图像另存"; - this.btn_saveImage.UseVisualStyleBackColor = false; - // - // label123 - // - this.label123.AutoSize = true; - this.label123.BackColor = System.Drawing.Color.White; - this.label123.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label123.Location = new System.Drawing.Point(46, 42); - this.label123.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); - this.label123.Name = "label123"; - this.label123.Size = new System.Drawing.Size(56, 17); - this.label123.TabIndex = 108; - this.label123.Text = "设备列表"; - // - // tabReadFormCamera - // - this.tabReadFormCamera.AttachedControl = this.superTabControlPanel2; - this.tabReadFormCamera.GlobalItem = false; - this.tabReadFormCamera.Name = "tabReadFormCamera"; - this.tabReadFormCamera.Text = "相机读取"; - // - // superTabControl2 - // - this.superTabControl2.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(239)))), ((int)(((byte)(239)))), ((int)(((byte)(242))))); - // - // - // - // - // - // - this.superTabControl2.ControlBox.CloseBox.Name = ""; - // - // - // - this.superTabControl2.ControlBox.MenuBox.Name = ""; - this.superTabControl2.ControlBox.Name = ""; - this.superTabControl2.ControlBox.SubItems.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.superTabControl2.ControlBox.MenuBox, - this.superTabControl2.ControlBox.CloseBox}); - this.superTabControl2.Controls.Add(this.imageDispPanel); - this.superTabControl2.Dock = System.Windows.Forms.DockStyle.Fill; - this.superTabControl2.ForeColor = System.Drawing.Color.Black; - this.superTabControl2.Location = new System.Drawing.Point(0, 0); - this.superTabControl2.Name = "superTabControl2"; - this.superTabControl2.ReorderTabsEnabled = true; - this.superTabControl2.SelectedTabFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Bold); - this.superTabControl2.SelectedTabIndex = 0; - this.superTabControl2.Size = new System.Drawing.Size(502, 517); - this.superTabControl2.TabFont = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.superTabControl2.TabIndex = 0; - this.superTabControl2.Tabs.AddRange(new DevComponents.DotNetBar.BaseItem[] { - this.superTabItem1}); - this.superTabControl2.TabStyle = DevComponents.DotNetBar.eSuperTabStyle.OfficeMobile2014; - this.superTabControl2.Text = "显示图像"; - // - // imageDispPanel - // - this.imageDispPanel.Dock = System.Windows.Forms.DockStyle.Fill; - this.imageDispPanel.Location = new System.Drawing.Point(0, 36); - this.imageDispPanel.Name = "imageDispPanel"; - this.imageDispPanel.Size = new System.Drawing.Size(502, 481); - this.imageDispPanel.TabIndex = 1; - this.imageDispPanel.TabItem = this.superTabItem1; - // - // superTabItem1 - // - this.superTabItem1.AttachedControl = this.imageDispPanel; - this.superTabItem1.GlobalItem = false; - this.superTabItem1.Name = "superTabItem1"; - this.superTabItem1.Text = "显示图像"; - // // statusStrip // this.statusStrip.BackColor = System.Drawing.Color.White; @@ -643,6 +106,185 @@ namespace HalconTool this.lb_RunTime.Name = "lb_RunTime"; this.lb_RunTime.Size = new System.Drawing.Size(0, 19); // + // tabGrabImage + // + this.tabGrabImage.Controls.Add(this.grabFile); + this.tabGrabImage.Controls.Add(this.camera); + this.tabGrabImage.Dock = System.Windows.Forms.DockStyle.Fill; + this.tabGrabImage.DrawMode = System.Windows.Forms.TabDrawMode.OwnerDrawFixed; + this.tabGrabImage.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.tabGrabImage.ItemSize = new System.Drawing.Size(150, 40); + this.tabGrabImage.Location = new System.Drawing.Point(0, 0); + this.tabGrabImage.MainPage = ""; + this.tabGrabImage.Name = "tabGrabImage"; + this.tabGrabImage.SelectedIndex = 0; + this.tabGrabImage.Size = new System.Drawing.Size(605, 517); + this.tabGrabImage.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; + this.tabGrabImage.TabIndex = 0; + // + // grabFile + // + this.grabFile.Controls.Add(this.uiGroupBox3); + this.grabFile.Controls.Add(this.uiGroupBox2); + this.grabFile.Location = new System.Drawing.Point(0, 40); + this.grabFile.Name = "grabFile"; + this.grabFile.Size = new System.Drawing.Size(605, 477); + this.grabFile.TabIndex = 0; + this.grabFile.Text = "本地读取"; + this.grabFile.UseVisualStyleBackColor = true; + // + // camera + // + this.camera.Controls.Add(this.uiMarkLabel2); + this.camera.Location = new System.Drawing.Point(0, 40); + this.camera.Name = "camera"; + this.camera.Size = new System.Drawing.Size(605, 477); + this.camera.TabIndex = 2; + this.camera.Text = "相机"; + this.camera.UseVisualStyleBackColor = true; + // + // gbImageDisp + // + this.gbImageDisp.Dock = System.Windows.Forms.DockStyle.Fill; + this.gbImageDisp.FillColor = System.Drawing.Color.White; + this.gbImageDisp.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.gbImageDisp.IsScaled = false; + this.gbImageDisp.Location = new System.Drawing.Point(0, 0); + this.gbImageDisp.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.gbImageDisp.MinimumSize = new System.Drawing.Size(1, 1); + this.gbImageDisp.Name = "gbImageDisp"; + this.gbImageDisp.Padding = new System.Windows.Forms.Padding(0, 32, 0, 0); + this.gbImageDisp.Size = new System.Drawing.Size(502, 517); + this.gbImageDisp.Style = Sunny.UI.UIStyle.Custom; + this.gbImageDisp.TabIndex = 0; + this.gbImageDisp.Text = "显示图像"; + this.gbImageDisp.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; + // + // uiMarkLabel2 + // + this.uiMarkLabel2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiMarkLabel2.Location = new System.Drawing.Point(209, 206); + this.uiMarkLabel2.Name = "uiMarkLabel2"; + this.uiMarkLabel2.Padding = new System.Windows.Forms.Padding(5, 0, 0, 0); + this.uiMarkLabel2.Size = new System.Drawing.Size(189, 50); + this.uiMarkLabel2.TabIndex = 1; + this.uiMarkLabel2.Text = "该功能暂未实现"; + this.uiMarkLabel2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // uiLabel1 + // + this.uiLabel1.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiLabel1.Location = new System.Drawing.Point(27, 45); + this.uiLabel1.Name = "uiLabel1"; + this.uiLabel1.Size = new System.Drawing.Size(100, 23); + this.uiLabel1.TabIndex = 0; + this.uiLabel1.Text = "图像路径:"; + this.uiLabel1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // txbFilePath + // + this.txbFilePath.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.txbFilePath.ButtonSymbol = 61761; + this.txbFilePath.Cursor = System.Windows.Forms.Cursors.IBeam; + this.txbFilePath.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.txbFilePath.IsScaled = false; + this.txbFilePath.Location = new System.Drawing.Point(183, 42); + this.txbFilePath.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.txbFilePath.Maximum = 2147483647D; + this.txbFilePath.Minimum = -2147483648D; + this.txbFilePath.MinimumSize = new System.Drawing.Size(1, 16); + this.txbFilePath.Name = "txbFilePath"; + this.txbFilePath.Size = new System.Drawing.Size(405, 35); + this.txbFilePath.TabIndex = 1; + this.txbFilePath.TextAlignment = System.Drawing.ContentAlignment.MiddleLeft; + this.txbFilePath.TextChanged += new System.EventHandler(this.txbFilePath_TextChanged); + // + // btnSelectFilePath + // + this.btnSelectFilePath.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnSelectFilePath.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnSelectFilePath.IsScaled = false; + this.btnSelectFilePath.Location = new System.Drawing.Point(31, 129); + this.btnSelectFilePath.MinimumSize = new System.Drawing.Size(1, 1); + this.btnSelectFilePath.Name = "btnSelectFilePath"; + this.btnSelectFilePath.Size = new System.Drawing.Size(133, 35); + this.btnSelectFilePath.Symbol = 61462; + this.btnSelectFilePath.TabIndex = 2; + this.btnSelectFilePath.Text = "选择图像"; + this.btnSelectFilePath.Click += new System.EventHandler(this.btnSelectFilePath_Click); + // + // btnRun + // + this.btnRun.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.btnRun.Cursor = System.Windows.Forms.Cursors.Hand; + this.btnRun.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.btnRun.IsScaled = false; + this.btnRun.Location = new System.Drawing.Point(440, 129); + this.btnRun.MinimumSize = new System.Drawing.Size(1, 1); + this.btnRun.Name = "btnRun"; + this.btnRun.Size = new System.Drawing.Size(133, 35); + this.btnRun.Symbol = 61515; + this.btnRun.TabIndex = 2; + this.btnRun.Text = "运行工具"; + this.btnRun.Click += new System.EventHandler(this.btnRun_Click); + // + // uiGroupBox2 + // + this.uiGroupBox2.Controls.Add(this.chbRGB2Gray); + this.uiGroupBox2.Controls.Add(this.uiLabel1); + this.uiGroupBox2.Controls.Add(this.btnRun); + this.uiGroupBox2.Controls.Add(this.txbFilePath); + this.uiGroupBox2.Controls.Add(this.btnSelectFilePath); + this.uiGroupBox2.Dock = System.Windows.Forms.DockStyle.Top; + this.uiGroupBox2.FillColor = System.Drawing.Color.White; + this.uiGroupBox2.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiGroupBox2.IsScaled = false; + this.uiGroupBox2.Location = new System.Drawing.Point(0, 0); + this.uiGroupBox2.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.uiGroupBox2.MinimumSize = new System.Drawing.Size(1, 1); + this.uiGroupBox2.Name = "uiGroupBox2"; + this.uiGroupBox2.Padding = new System.Windows.Forms.Padding(0, 32, 0, 0); + this.uiGroupBox2.Size = new System.Drawing.Size(605, 188); + this.uiGroupBox2.Style = Sunny.UI.UIStyle.Custom; + this.uiGroupBox2.TabIndex = 3; + this.uiGroupBox2.Text = "单张图像"; + this.uiGroupBox2.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; + // + // uiGroupBox3 + // + this.uiGroupBox3.Dock = System.Windows.Forms.DockStyle.Fill; + this.uiGroupBox3.FillColor = System.Drawing.Color.White; + this.uiGroupBox3.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.uiGroupBox3.IsScaled = false; + this.uiGroupBox3.Location = new System.Drawing.Point(0, 188); + this.uiGroupBox3.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.uiGroupBox3.MinimumSize = new System.Drawing.Size(1, 1); + this.uiGroupBox3.Name = "uiGroupBox3"; + this.uiGroupBox3.Padding = new System.Windows.Forms.Padding(0, 32, 0, 0); + this.uiGroupBox3.Size = new System.Drawing.Size(605, 289); + this.uiGroupBox3.Style = Sunny.UI.UIStyle.Custom; + this.uiGroupBox3.TabIndex = 4; + this.uiGroupBox3.Text = "多组图像"; + this.uiGroupBox3.TextAlignment = System.Drawing.ContentAlignment.MiddleCenter; + // + // chbRGB2Gray + // + this.chbRGB2Gray.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.chbRGB2Gray.Checked = true; + this.chbRGB2Gray.Cursor = System.Windows.Forms.Cursors.Hand; + this.chbRGB2Gray.Font = new System.Drawing.Font("微软雅黑", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.chbRGB2Gray.IsScaled = false; + this.chbRGB2Gray.Location = new System.Drawing.Point(300, 133); + this.chbRGB2Gray.MinimumSize = new System.Drawing.Size(1, 1); + this.chbRGB2Gray.Name = "chbRGB2Gray"; + this.chbRGB2Gray.Padding = new System.Windows.Forms.Padding(22, 0, 0, 0); + this.chbRGB2Gray.Size = new System.Drawing.Size(111, 29); + this.chbRGB2Gray.Style = Sunny.UI.UIStyle.Custom; + this.chbRGB2Gray.TabIndex = 3; + this.chbRGB2Gray.Text = "彩色转灰度"; + this.chbRGB2Gray.CheckedChanged += new System.EventHandler(this.chbRGB2Gray_CheckedChanged); + // // FormHalconTool // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); @@ -658,22 +300,12 @@ namespace HalconTool this.splitContainer1.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); this.splitContainer1.ResumeLayout(false); - ((System.ComponentModel.ISupportInitialize)(this.superTabControl1)).EndInit(); - this.superTabControl1.ResumeLayout(false); - this.superTabControlPanel1.ResumeLayout(false); - this.superTabControlPanel1.PerformLayout(); - this.panelMultImage.ResumeLayout(false); - this.gpb_multImage.ResumeLayout(false); - this.gpb_multImage.PerformLayout(); - this.panelOneImage.ResumeLayout(false); - this.gpb_oneImage.ResumeLayout(false); - this.gpb_oneImage.PerformLayout(); - this.superTabControlPanel2.ResumeLayout(false); - this.superTabControlPanel2.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.superTabControl2)).EndInit(); - this.superTabControl2.ResumeLayout(false); this.statusStrip.ResumeLayout(false); this.statusStrip.PerformLayout(); + this.tabGrabImage.ResumeLayout(false); + this.grabFile.ResumeLayout(false); + this.camera.ResumeLayout(false); + this.uiGroupBox2.ResumeLayout(false); this.ResumeLayout(false); this.PerformLayout(); @@ -682,46 +314,21 @@ namespace HalconTool #endregion private System.Windows.Forms.SplitContainer splitContainer1; - private DevComponents.DotNetBar.SuperTabControl superTabControl1; - private DevComponents.DotNetBar.SuperTabControlPanel superTabControlPanel1; - private System.Windows.Forms.Panel panelMultImage; - public System.Windows.Forms.GroupBox gpb_multImage; - public System.Windows.Forms.Button btn_selectImageDirectory; - public System.Windows.Forms.Label lbl_imageNum; - public System.Windows.Forms.Label lbl_imageName; - internal System.Windows.Forms.Button btn_lastImage; - internal System.Windows.Forms.Button btn_nextImage; - internal System.Windows.Forms.TextBox tbx_imageDirectory; - private System.Windows.Forms.Panel panelOneImage; - public System.Windows.Forms.GroupBox gpb_oneImage; - internal System.Windows.Forms.Button btn_readImage; - internal System.Windows.Forms.TextBox tbx_imagePath; - public System.Windows.Forms.Button btn_browseImage; - public System.Windows.Forms.CheckBox ckb_autoSwitch; - public System.Windows.Forms.Button btn_runHalconInterfaceTool; - public System.Windows.Forms.Button btn_registImage; - public System.Windows.Forms.RadioButton rdo_readOneImage; - public System.Windows.Forms.RadioButton rdo_readMultImage; - public System.Windows.Forms.CheckBox ckb_RGBToGray; - private DevComponents.DotNetBar.SuperTabItem tabReadFormLocal; - private DevComponents.DotNetBar.SuperTabControlPanel superTabControlPanel2; - public System.Windows.Forms.CheckBox checkBox1; - internal System.Windows.Forms.Button btn_RealTime; - internal System.Windows.Forms.ComboBox cbx_deviceList; - internal System.Windows.Forms.Button button1; - private System.Windows.Forms.Label label148; - internal System.Windows.Forms.TextBox tbx_exposure; - internal System.Windows.Forms.Button button2; - private System.Windows.Forms.Label label147; - internal System.Windows.Forms.Button btn_saveImage; - private System.Windows.Forms.Label label123; - private DevComponents.DotNetBar.SuperTabItem tabReadFormCamera; - private DevComponents.DotNetBar.SuperTabControl superTabControl2; - private DevComponents.DotNetBar.SuperTabControlPanel imageDispPanel; - private DevComponents.DotNetBar.SuperTabItem superTabItem1; public System.Windows.Forms.StatusStrip statusStrip; public System.Windows.Forms.ToolStripStatusLabel lb_RunStatus; private System.Windows.Forms.ToolStripStatusLabel lb_Split; public System.Windows.Forms.ToolStripStatusLabel lb_RunTime; + private Sunny.UI.UITabControl tabGrabImage; + private System.Windows.Forms.TabPage grabFile; + private System.Windows.Forms.TabPage camera; + private Sunny.UI.UIGroupBox gbImageDisp; + private Sunny.UI.UIMarkLabel uiMarkLabel2; + private Sunny.UI.UITextBox txbFilePath; + private Sunny.UI.UILabel uiLabel1; + private Sunny.UI.UISymbolButton btnSelectFilePath; + private Sunny.UI.UISymbolButton btnRun; + private Sunny.UI.UIGroupBox uiGroupBox2; + private Sunny.UI.UIGroupBox uiGroupBox3; + private Sunny.UI.UICheckBox chbRGB2Gray; } } \ No newline at end of file diff --git a/HalconTool/FormHalconTool.cs b/HalconTool/FormHalconTool.cs index 393a29e..48efaf5 100644 --- a/HalconTool/FormHalconTool.cs +++ b/HalconTool/FormHalconTool.cs @@ -51,159 +51,199 @@ namespace HalconTool return _instance; } } - private void rdo_readMultImage_CheckedChanged(object sender, EventArgs e) - { - if (rdo_readOneImage.Checked) - { - this.ckb_autoSwitch.Visible = false; - this.panelOneImage.Visible = true; - this.panelMultImage.Visible = false; - this.btn_browseImage.Visible = false; - myHalconTool.workMode = WorkMode.ReadOneImage; - myHalconTool.outputImageFilePath = myHalconTool.imagePath; - } - else - { - if(myHalconTool.L_imageFile.Count > 0) - { - this.ckb_autoSwitch.Visible = true; - this.panelMultImage.Visible = true; - this.panelOneImage.Visible = false; - this.btn_browseImage.Visible = true; - myHalconTool.workMode = WorkMode.ReadMultImage; - myHalconTool.outputImageFilePath = myHalconTool.L_imageFile[myHalconTool.currentImageIndex]; - } - } - btn_runHalconInterfaceTool_Click(null, null); - } + //private void rdo_readMultImage_CheckedChanged(object sender, EventArgs e) + //{ + // if (rdo_readOneImage.Checked) + // { + // this.ckb_autoSwitch.Visible = false; + // this.panelOneImage.Visible = true; + // this.panelMultImage.Visible = false; + // this.btn_browseImage.Visible = false; + // myHalconTool.workMode = WorkMode.ReadOneImage; + // myHalconTool.outputImageFilePath = myHalconTool.imagePath; + // } + // else + // { + // if(myHalconTool.L_imageFile.Count > 0) + // { + // this.ckb_autoSwitch.Visible = true; + // this.panelMultImage.Visible = true; + // this.panelOneImage.Visible = false; + // this.btn_browseImage.Visible = true; + // myHalconTool.workMode = WorkMode.ReadMultImage; + // myHalconTool.outputImageFilePath = myHalconTool.L_imageFile[myHalconTool.currentImageIndex]; + // } + // } + // btn_runHalconInterfaceTool_Click(null, null); + //} private void FormHalconTool_Load(object sender, EventArgs e) { - rdo_readMultImage_CheckedChanged(null, null); - this.imageDispPanel.Controls.Add(myHwindow); + gbImageDisp.Controls.Add(myHwindow); myHwindow.Dock = DockStyle.Fill; InitTool(); } - private void btn_readImage_Click(object sender, EventArgs e) - { - myHalconTool.ReadImage(out myHalconTool.imagePath); - this.tbx_imagePath.Text = myHalconTool.imagePath; - btn_runHalconInterfaceTool_Click(null, null); - } + //private void btn_readImage_Click(object sender, EventArgs e) + //{ + // myHalconTool.ReadImage(out myHalconTool.imagePath); + // this.tbx_imagePath.Text = myHalconTool.imagePath; + // btn_runHalconInterfaceTool_Click(null, null); + //} - private void btn_runHalconInterfaceTool_Click(object sender, EventArgs e) - { - if(myHalconTool.workMode == WorkMode.ReadOneImage) - { + //private void btn_runHalconInterfaceTool_Click(object sender, EventArgs e) + //{ + // if(myHalconTool.workMode == WorkMode.ReadOneImage) + // { - } - if(myHalconTool.workMode == WorkMode.ReadMultImage) - { + // } + // if(myHalconTool.workMode == WorkMode.ReadMultImage) + // { - } - myHalconTool.Run(SoftwareRunState.Debug); - ParamsTrans(); - - } + // } + // if (File.Exists(this.tbx_imagePath.Text)) + // { + // myHalconTool.Run(SoftwareRunState.Debug); + // myHalconTool.imagePath = tbx_imagePath.Text; + // ParamsTrans(); + // } + //} + + + //private void btn_selectImageDirectory_Click(object sender, EventArgs e) + //{ + // myHalconTool.imageDirectoryPath = string.Empty; + // try + // { + // FolderBrowserDialog folderBrowseDialog = new FolderBrowserDialog(); + // if (Directory.Exists(myHalconTool.imageDirectoryPath)) + // folderBrowseDialog.SelectedPath = myHalconTool.imageDirectoryPath; + // folderBrowseDialog.Description = "请选择图像文件夹路径"; + // if (folderBrowseDialog.ShowDialog() == DialogResult.OK) + // { + // myHalconTool.imageDirectoryPath = folderBrowseDialog.SelectedPath; + // this.tbx_imageDirectory.Text = myHalconTool.imageDirectoryPath; + // myHalconTool.L_imageFile.Clear(); + // string[] files = Directory.GetFiles(folderBrowseDialog.SelectedPath); + // for (int i = 0; i < files.Length; i++) + // { + // FileInfo fileInfo = new FileInfo(files[i]); + // if (fileInfo.Extension == ".jpg" || fileInfo.Extension == ".bmp" || fileInfo.Extension == ".png" || fileInfo.Extension == ".tif") + // myHalconTool.L_imageFile.Add(files[i]); + // } + // if (myHalconTool.L_imageFile.Count > 0) + // { + // myHalconTool.currentImageIndex = 0; + // myHalconTool.outputImageFilePath = myHalconTool.L_imageFile[myHalconTool.currentImageIndex]; + // myHalconTool.DispImage(); + // myHalconTool.currentImageName = Path.GetFileName(myHalconTool.L_imageFile[0]); + // lbl_imageName.Text = myHalconTool.currentImageName; + + // } + // lbl_imageNum.Text = "共" + myHalconTool.L_imageFile.Count + "张"; + + // } + // } + // catch (Exception ex) + // { + // this.lb_RunStatus.Text = ex.Message; + // } + //} + + //private void btn_nextImage_Click(object sender, EventArgs e) + //{ + // try + // { + // HObject image = new HObject(); + // Button btnClick = sender as Button; + // if(btnClick.Name == "btn_nextImage") + // { + // myHalconTool.currentImageIndex = myHalconTool.currentImageIndex + 1; + // } + // else + // { + // myHalconTool.currentImageIndex = myHalconTool.currentImageIndex - 1; + // } + + // if (myHalconTool.currentImageIndex > myHalconTool.L_imageFile.Count - 1) + // { + // myHalconTool.currentImageIndex = 0; + // } + // try + // { + // myHalconTool.outputImageFilePath = myHalconTool.L_imageFile[myHalconTool.currentImageIndex]; + // } + // catch + // { + // lb_RunStatus.Text = "图像文件异常或路径不合法"; + // lb_RunStatus.BackColor = Color.Red; + // return; + // } + // myHalconTool.DispImage(); + // myHalconTool.currentImageName = Path.GetFileName(myHalconTool.L_imageFile[myHalconTool.currentImageIndex]); + // Instance.lbl_imageName.Text = myHalconTool.currentImageName; + // Instance.lbl_imageNum.Text = "共" + myHalconTool.L_imageFile.Count + "张"; + // } + // catch (Exception ex) + // { + // lb_RunStatus.Text = ex.Message; + // lb_RunStatus.BackColor = Color.Red; + // } + //} + + // 窗体载入时还原参数 public void InitTool() { - tbx_imagePath.Text = myHalconTool.imagePath; - tbx_imageDirectory.Text = myHalconTool.imageDirectoryPath; - ckb_RGBToGray.Checked = myHalconTool.RGBToGray; - ckb_autoSwitch.Checked = myHalconTool.autoSwitch; + txbFilePath.Text = myHalconTool.imagePath; + chbRGB2Gray.Checked = myHalconTool.RGBToGray; } - - private void btn_selectImageDirectory_Click(object sender, EventArgs e) - { - myHalconTool.imageDirectoryPath = string.Empty; - try - { - FolderBrowserDialog folderBrowseDialog = new FolderBrowserDialog(); - if (Directory.Exists(myHalconTool.imageDirectoryPath)) - folderBrowseDialog.SelectedPath = myHalconTool.imageDirectoryPath; - folderBrowseDialog.Description = "请选择图像文件夹路径"; - if (folderBrowseDialog.ShowDialog() == DialogResult.OK) - { - myHalconTool.imageDirectoryPath = folderBrowseDialog.SelectedPath; - this.tbx_imageDirectory.Text = myHalconTool.imageDirectoryPath; - myHalconTool.L_imageFile.Clear(); - string[] files = Directory.GetFiles(folderBrowseDialog.SelectedPath); - for (int i = 0; i < files.Length; i++) - { - FileInfo fileInfo = new FileInfo(files[i]); - if (fileInfo.Extension == ".jpg" || fileInfo.Extension == ".bmp" || fileInfo.Extension == ".png" || fileInfo.Extension == ".tif") - myHalconTool.L_imageFile.Add(files[i]); - } - if (myHalconTool.L_imageFile.Count > 0) - { - myHalconTool.currentImageIndex = 0; - myHalconTool.outputImageFilePath = myHalconTool.L_imageFile[myHalconTool.currentImageIndex]; - myHalconTool.DispImage(); - myHalconTool.currentImageName = Path.GetFileName(myHalconTool.L_imageFile[0]); - lbl_imageName.Text = myHalconTool.currentImageName; - - } - lbl_imageNum.Text = "共" + myHalconTool.L_imageFile.Count + "张"; - - } - } - catch (Exception ex) - { - this.lb_RunStatus.Text = ex.Message; - } - } - - private void btn_nextImage_Click(object sender, EventArgs e) - { - try - { - HObject image = new HObject(); - Button btnClick = sender as Button; - if(btnClick.Name == "btn_nextImage") - { - myHalconTool.currentImageIndex = myHalconTool.currentImageIndex + 1; - } - else - { - myHalconTool.currentImageIndex = myHalconTool.currentImageIndex - 1; - } - - if (myHalconTool.currentImageIndex > myHalconTool.L_imageFile.Count - 1) - { - myHalconTool.currentImageIndex = 0; - } - try - { - myHalconTool.outputImageFilePath = myHalconTool.L_imageFile[myHalconTool.currentImageIndex]; - } - catch - { - lb_RunStatus.Text = "图像文件异常或路径不合法"; - lb_RunStatus.BackColor = Color.Red; - return; - } - myHalconTool.DispImage(); - myHalconTool.currentImageName = Path.GetFileName(myHalconTool.L_imageFile[myHalconTool.currentImageIndex]); - Instance.lbl_imageName.Text = myHalconTool.currentImageName; - Instance.lbl_imageNum.Text = "共" + myHalconTool.L_imageFile.Count + "张"; - } - catch (Exception ex) - { - lb_RunStatus.Text = ex.Message; - lb_RunStatus.BackColor = Color.Red; - } - } - /// /// 将数据传递给HalconToolInterface /// private void ParamsTrans() { - myToolInfo.toolOutput.Clear(); - myToolInfo.toolOutput.Add(new ToolIO("OutputImage", myHalconTool.outputImage, DataType.Image)); + myToolInfo.toolOutput[0] = new ToolIO("OutputImage", myHalconTool.outputImage, DataType.Image); } + private void btnSelectFilePath_Click(object sender, EventArgs e) + { + HTuple channelCount = 0; + OpenFileDialog dig_openImage = new OpenFileDialog(); + dig_openImage.Title = "请选择图像文件路径"; + dig_openImage.Filter = "图像文件(*.*)|*.*|图像文件(*.png)|*.png|图像文件(*.jpg)|*.jpg|图像文件(*.tif)|*.tif"; + if (dig_openImage.ShowDialog() == DialogResult.OK) + { + myHalconTool.imagePath = dig_openImage.FileName; + myHalconTool.outputImageFilePath = dig_openImage.FileName; + txbFilePath.Text = dig_openImage.FileName; + } + } + + private void btnRun_Click(object sender, EventArgs e) + { + if (File.Exists(txbFilePath.Text)) + { + myHalconTool.outputImageFilePath = txbFilePath.Text; + myHalconTool.imagePath = txbFilePath.Text; + myHalconTool.Run(SoftwareRunState.Debug); + ParamsTrans(); + } + else + { + MessageBox.Show("文件不存在,请检查!"); + } + } + + private void txbFilePath_TextChanged(object sender, EventArgs e) + { + myHalconTool.outputImageFilePath = txbFilePath.Text; + myHalconTool.imagePath = txbFilePath.Text; + } + + private void chbRGB2Gray_CheckedChanged(object sender, EventArgs e) + { + myHalconTool.RGBToGray = chbRGB2Gray.Checked; + } } } diff --git a/HalconTool/FormHalconTool.resx b/HalconTool/FormHalconTool.resx index 93b2685..e539b60 100644 --- a/HalconTool/FormHalconTool.resx +++ b/HalconTool/FormHalconTool.resx @@ -118,7 +118,7 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 17, 17 + 27, 15 diff --git a/HalconTool/HalconTool.cs b/HalconTool/HalconTool.cs index 1570915..ae0d42e 100644 --- a/HalconTool/HalconTool.cs +++ b/HalconTool/HalconTool.cs @@ -84,21 +84,6 @@ namespace HalconTool /// internal WorkMode workMode = WorkMode.ReadMultImage; - public bool ReadImage(out string filePath) - { - filePath = string.Empty; - HTuple channelCount = 0; - OpenFileDialog dig_openImage = new OpenFileDialog(); - dig_openImage.Title = "请选择图像文件路径"; - dig_openImage.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); - dig_openImage.Filter = "图像文件(*.*)|*.*|图像文件(*.png)|*.png|图像文件(*.jpg)|*.jpg|图像文件(*.tif)|*.tif"; - if (dig_openImage.ShowDialog() == DialogResult.OK) - { - filePath = dig_openImage.FileName; - outputImageFilePath = dig_openImage.FileName; - } - return true; - } public override void Run(SoftwareRunState softwareState) { @@ -109,7 +94,6 @@ namespace HalconTool SetToolStatusDisp(); sw.Stop(); runTime = $"工具运行时间:{sw.ElapsedMilliseconds.ToString()} ms"; - } public override void DispImage() @@ -150,7 +134,8 @@ namespace HalconTool if (softwareRunState == SoftwareRunState.Debug) { FormHalconTool.Instance.myHwindow.DispImage(outputImage); - } + } + } else { diff --git a/HalconTool/HalconTool.csproj b/HalconTool/HalconTool.csproj index e2663b0..be28bfd 100644 --- a/HalconTool/HalconTool.csproj +++ b/HalconTool/HalconTool.csproj @@ -9,7 +9,7 @@ Properties HalconTool HalconTool - v4.5.2 + v4.6.1 512 @@ -31,12 +31,15 @@ 4 - - ..\VisionEdit\bin\Debug\DevComponents.DotNetBar2.dll - C:\Program Files\MVTec\HALCON-19.05-Progress\bin\dotnet20\halcondotnet.dll + + ..\VisionEdit\bin\Debug\ThirdLib\SunnyUI.dll + + + ..\VisionEdit\bin\Debug\ThirdLib\SunnyUI.Common.dll + @@ -58,11 +61,20 @@ + + True + True + Resources.resx + FormHalconTool.cs + + ResXFileCodeGenerator + Resources.Designer.cs + diff --git a/HalconTool/HalconToolRun.cs b/HalconTool/HalconToolRun.cs index c473b44..68d12dc 100644 --- a/HalconTool/HalconToolRun.cs +++ b/HalconTool/HalconToolRun.cs @@ -41,6 +41,7 @@ namespace HalconTool { myJob.FormLogDisp($"{L_toolList[toolIndex].toolName} 运行成功,{myHalconTool.runTime}", Color.Green, selectNode); FormImageWindow.Instance.myHWindow.DispHWindow.DispObj(myHalconTool.outputImage); + L_toolList[toolIndex].toolOutput[0] = new ToolIO("OutputImage", myHalconTool.outputImage, DataType.Image); } } } diff --git a/HalconTool/Properties/Resources.Designer.cs b/HalconTool/Properties/Resources.Designer.cs new file mode 100644 index 0000000..8e16703 --- /dev/null +++ b/HalconTool/Properties/Resources.Designer.cs @@ -0,0 +1,63 @@ +//------------------------------------------------------------------------------ +// +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 +// +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 +// +//------------------------------------------------------------------------------ + +namespace HalconTool.Properties { + using System; + + + /// + /// 一个强类型的资源类,用于查找本地化的字符串等。 + /// + // 此类是由 StronglyTypedResourceBuilder + // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 + // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen + // (以 /str 作为命令选项),或重新生成 VS 项目。 + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// 返回此类使用的缓存的 ResourceManager 实例。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("HalconTool.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// 使用此强类型资源类,为所有资源查找 + /// 重写当前线程的 CurrentUICulture 属性。 + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + } +} diff --git a/HalconTool/Properties/Resources.resx b/HalconTool/Properties/Resources.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/HalconTool/Properties/Resources.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/ImageWindow/HWindow_Tool.csproj b/ImageWindow/HWindow_Tool.csproj index b3d1e0f..60ad7a2 100644 --- a/ImageWindow/HWindow_Tool.csproj +++ b/ImageWindow/HWindow_Tool.csproj @@ -1,5 +1,5 @@ - - + + Debug x86 @@ -10,7 +10,7 @@ Properties ViewROI HWindow_Tool - v3.5 + v4.6.1 512 @@ -72,10 +72,12 @@ AnyCPU bin\Debug\ TRACE;DEBUG + false AnyCPU bin\Release\ + false diff --git a/ImageWindow/Properties/Resources.Designer.cs b/ImageWindow/Properties/Resources.Designer.cs index d035c1d..841ea06 100644 --- a/ImageWindow/Properties/Resources.Designer.cs +++ b/ImageWindow/Properties/Resources.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // 此代码由工具生成。 // 运行时版本:4.0.30319.42000 @@ -19,7 +19,7 @@ namespace ViewROI.Properties { // 类通过类似于 ResGen 或 Visual Studio 的工具自动生成的。 // 若要添加或移除成员,请编辑 .ResX 文件,然后重新运行 ResGen // (以 /str 作为命令选项),或重新生成 VS 项目。 - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Resources { @@ -47,8 +47,8 @@ namespace ViewROI.Properties { } /// - /// 使用此强类型资源类,为所有资源查找 - /// 重写当前线程的 CurrentUICulture 属性。 + /// 重写当前线程的 CurrentUICulture 属性,对 + /// 使用此强类型资源类的所有资源查找执行重写。 /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Globalization.CultureInfo Culture { diff --git a/ImageWindow/Properties/Settings.Designer.cs b/ImageWindow/Properties/Settings.Designer.cs index a909a68..878f3f5 100644 --- a/ImageWindow/Properties/Settings.Designer.cs +++ b/ImageWindow/Properties/Settings.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // 此代码由工具生成。 // 运行时版本:4.0.30319.42000 @@ -12,7 +12,7 @@ namespace ViewROI.Properties { [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.10.0.0")] internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); diff --git a/ImageWindow/app.config b/ImageWindow/app.config index e59af44..0dff63a 100644 --- a/ImageWindow/app.config +++ b/ImageWindow/app.config @@ -1,3 +1,3 @@ - + diff --git a/PMAlignTool/FormPMAlignTool.Designer.cs b/PMAlignTool/FormPMAlignTool.Designer.cs index 5605f39..893e087 100644 --- a/PMAlignTool/FormPMAlignTool.Designer.cs +++ b/PMAlignTool/FormPMAlignTool.Designer.cs @@ -44,6 +44,7 @@ namespace PMAlignTool this.label4 = new System.Windows.Forms.Label(); this.panel9 = new System.Windows.Forms.Panel(); this.label3 = new System.Windows.Forms.Label(); + this.hWindowTool_Smart1 = new ViewROI.HWindowTool_Smart(); this.panel3 = new System.Windows.Forms.Panel(); this.label1 = new System.Windows.Forms.Label(); this.panel8 = new System.Windows.Forms.Panel(); @@ -66,6 +67,12 @@ namespace PMAlignTool this.label8 = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); + this.cmbErsion2 = new Controls.CComboBox(); + this.cmbDilation = new Controls.CComboBox(); + this.cmbErsion1 = new Controls.CComboBox(); + this.cNumErosionValue2 = new Controls.CNumericUpDown(); + this.cNumDilationValue2 = new Controls.CNumericUpDown(); + this.cNumErosionValue1 = new Controls.CNumericUpDown(); this.cbCDilation1 = new System.Windows.Forms.CheckBox(); this.cbCErosion1 = new System.Windows.Forms.CheckBox(); this.cbCErosion2 = new System.Windows.Forms.CheckBox(); @@ -78,6 +85,16 @@ namespace PMAlignTool this.panel11 = new System.Windows.Forms.Panel(); this.label11 = new System.Windows.Forms.Label(); this.panel2 = new System.Windows.Forms.Panel(); + this.nud_angleRange = new Controls.CNumericUpDown(); + this.ckb_autoContrast = new Controls.CCheckBox(); + this.nud_ScaleRange = new Controls.CNumericUpDown(); + this.nud_ScaleStart = new Controls.CNumericUpDown(); + this.nud_angleStart = new Controls.CNumericUpDown(); + this.cbx_polarity = new Controls.CComboBox(); + this.nud_minScore = new Controls.CNumericUpDown(); + this.nud_Timeout = new Controls.CNumericUpDown(); + this.nud_angleStep = new Controls.CNumericUpDown(); + this.nud_matchNum = new Controls.CNumericUpDown(); this.tkb_contrast = new System.Windows.Forms.TrackBar(); this.lbl_contastValue = new System.Windows.Forms.Label(); this.label87 = new System.Windows.Forms.Label(); @@ -92,6 +109,7 @@ namespace PMAlignTool this.label15 = new System.Windows.Forms.Label(); this.label85 = new System.Windows.Forms.Label(); this.panel5 = new System.Windows.Forms.Panel(); + this.cbx_searchRegionType = new Controls.CComboBox(); this.label5 = new System.Windows.Forms.Label(); this.tabPage4 = new System.Windows.Forms.TabPage(); this.panel6 = new System.Windows.Forms.Panel(); @@ -108,24 +126,6 @@ namespace PMAlignTool this.Column9 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column10 = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.Column12 = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.hWindowTool_Smart1 = new ViewROI.HWindowTool_Smart(); - this.cmbErsion2 = new Controls.CComboBox(); - this.cmbDilation = new Controls.CComboBox(); - this.cmbErsion1 = new Controls.CComboBox(); - this.cNumErosionValue2 = new Controls.CNumericUpDown(); - this.cNumDilationValue2 = new Controls.CNumericUpDown(); - this.cNumErosionValue1 = new Controls.CNumericUpDown(); - this.nud_angleRange = new Controls.CNumericUpDown(); - this.ckb_autoContrast = new Controls.CCheckBox(); - this.nud_ScaleRange = new Controls.CNumericUpDown(); - this.nud_ScaleStart = new Controls.CNumericUpDown(); - this.nud_angleStart = new Controls.CNumericUpDown(); - this.cbx_polarity = new Controls.CComboBox(); - this.nud_minScore = new Controls.CNumericUpDown(); - this.numericUpDown3 = new Controls.CNumericUpDown(); - this.nud_angleStep = new Controls.CNumericUpDown(); - this.nud_matchNum = new Controls.CNumericUpDown(); - this.cbx_searchRegionType = new Controls.CComboBox(); this.statusStrip.SuspendLayout(); this.toolStrip1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); @@ -340,6 +340,18 @@ namespace PMAlignTool this.label3.TabIndex = 11; this.label3.Text = "模板ROI方式"; // + // hWindowTool_Smart1 + // + this.hWindowTool_Smart1.DispStatus = false; + this.hWindowTool_Smart1.Dock = System.Windows.Forms.DockStyle.Fill; + this.hWindowTool_Smart1.hv_Image = null; + this.hWindowTool_Smart1.Location = new System.Drawing.Point(4, 5); + this.hWindowTool_Smart1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); + this.hWindowTool_Smart1.Name = "hWindowTool_Smart1"; + this.tableLayoutPanel1.SetRowSpan(this.hWindowTool_Smart1, 3); + this.hWindowTool_Smart1.Size = new System.Drawing.Size(226, 169); + this.hWindowTool_Smart1.TabIndex = 0; + // // panel3 // this.panel3.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(26)))), ((int)(((byte)(106)))), ((int)(((byte)(175))))); @@ -654,6 +666,150 @@ namespace PMAlignTool this.label6.TabIndex = 176; this.label6.Text = "方式:"; // + // cmbErsion2 + // + this.cmbErsion2.BackColor = System.Drawing.Color.White; + this.cmbErsion2.CanEdit = false; + this.cmbErsion2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.cmbErsion2.Items = new string[] { + "octagon", + "rectangle", + "rhombus"}; + this.cmbErsion2.Location = new System.Drawing.Point(268, 91); + this.cmbErsion2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.cmbErsion2.Name = "cmbErsion2"; + this.cmbErsion2.SelectedIndex = 1; + this.cmbErsion2.Size = new System.Drawing.Size(95, 26); + this.cmbErsion2.TabIndex = 175; + this.cmbErsion2.TextStr = "rectangle"; + this.cmbErsion2.SelectedIndexChanged += new Controls.DSelectedIndexChanged(this.cmbErsion1_SelectedIndexChanged); + // + // cmbDilation + // + this.cmbDilation.BackColor = System.Drawing.Color.White; + this.cmbDilation.CanEdit = false; + this.cmbDilation.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.cmbDilation.Items = new string[] { + "octagon", + "rectangle", + "rhombus"}; + this.cmbDilation.Location = new System.Drawing.Point(268, 49); + this.cmbDilation.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.cmbDilation.Name = "cmbDilation"; + this.cmbDilation.SelectedIndex = 1; + this.cmbDilation.Size = new System.Drawing.Size(95, 26); + this.cmbDilation.TabIndex = 175; + this.cmbDilation.TextStr = "rectangle"; + this.cmbDilation.SelectedIndexChanged += new Controls.DSelectedIndexChanged(this.cmbErsion1_SelectedIndexChanged); + // + // cmbErsion1 + // + this.cmbErsion1.BackColor = System.Drawing.Color.White; + this.cmbErsion1.CanEdit = false; + this.cmbErsion1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.cmbErsion1.Items = new string[] { + "octagon", + "rectangle", + "rhombus"}; + this.cmbErsion1.Location = new System.Drawing.Point(268, 14); + this.cmbErsion1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.cmbErsion1.Name = "cmbErsion1"; + this.cmbErsion1.SelectedIndex = 1; + this.cmbErsion1.Size = new System.Drawing.Size(95, 26); + this.cmbErsion1.TabIndex = 175; + this.cmbErsion1.TextStr = "rectangle"; + this.cmbErsion1.SelectedIndexChanged += new Controls.DSelectedIndexChanged(this.cmbErsion1_SelectedIndexChanged); + // + // cNumErosionValue2 + // + this.cNumErosionValue2.BackColor = System.Drawing.Color.White; + this.cNumErosionValue2.DecimalPlaces = 0; + this.cNumErosionValue2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.cNumErosionValue2.Incremeent = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + this.cNumErosionValue2.Location = new System.Drawing.Point(71, 91); + this.cNumErosionValue2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.cNumErosionValue2.MaximumSize = new System.Drawing.Size(300, 26); + this.cNumErosionValue2.MaxValue = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + this.cNumErosionValue2.MinimumSize = new System.Drawing.Size(50, 26); + this.cNumErosionValue2.MinValue = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + this.cNumErosionValue2.Name = "cNumErosionValue2"; + this.cNumErosionValue2.Size = new System.Drawing.Size(127, 26); + this.cNumErosionValue2.TabIndex = 174; + this.cNumErosionValue2.Value = 1D; + this.cNumErosionValue2.ValueChanged += new Controls.DValueChanged(this.PreValueChanged); + // + // cNumDilationValue2 + // + this.cNumDilationValue2.BackColor = System.Drawing.Color.White; + this.cNumDilationValue2.DecimalPlaces = 0; + this.cNumDilationValue2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.cNumDilationValue2.Incremeent = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + this.cNumDilationValue2.Location = new System.Drawing.Point(71, 49); + this.cNumDilationValue2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.cNumDilationValue2.MaximumSize = new System.Drawing.Size(300, 26); + this.cNumDilationValue2.MaxValue = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + this.cNumDilationValue2.MinimumSize = new System.Drawing.Size(50, 26); + this.cNumDilationValue2.MinValue = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + this.cNumDilationValue2.Name = "cNumDilationValue2"; + this.cNumDilationValue2.Size = new System.Drawing.Size(127, 26); + this.cNumDilationValue2.TabIndex = 174; + this.cNumDilationValue2.Value = 1D; + this.cNumDilationValue2.ValueChanged += new Controls.DValueChanged(this.PreValueChanged); + // + // cNumErosionValue1 + // + this.cNumErosionValue1.BackColor = System.Drawing.Color.White; + this.cNumErosionValue1.DecimalPlaces = 0; + this.cNumErosionValue1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.cNumErosionValue1.Incremeent = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + this.cNumErosionValue1.Location = new System.Drawing.Point(71, 14); + this.cNumErosionValue1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.cNumErosionValue1.MaximumSize = new System.Drawing.Size(300, 26); + this.cNumErosionValue1.MaxValue = new decimal(new int[] { + 10000, + 0, + 0, + 0}); + this.cNumErosionValue1.MinimumSize = new System.Drawing.Size(50, 26); + this.cNumErosionValue1.MinValue = new decimal(new int[] { + 1, + 0, + 0, + 65536}); + this.cNumErosionValue1.Name = "cNumErosionValue1"; + this.cNumErosionValue1.Size = new System.Drawing.Size(127, 26); + this.cNumErosionValue1.TabIndex = 174; + this.cNumErosionValue1.Value = 1D; + this.cNumErosionValue1.ValueChanged += new Controls.DValueChanged(this.PreValueChanged); + // // cbCDilation1 // this.cbCDilation1.AutoSize = true; @@ -824,7 +980,7 @@ namespace PMAlignTool this.panel2.Controls.Add(this.nud_angleStart); this.panel2.Controls.Add(this.cbx_polarity); this.panel2.Controls.Add(this.nud_minScore); - this.panel2.Controls.Add(this.numericUpDown3); + this.panel2.Controls.Add(this.nud_Timeout); this.panel2.Controls.Add(this.nud_angleStep); this.panel2.Controls.Add(this.nud_matchNum); this.panel2.Controls.Add(this.tkb_contrast); @@ -846,483 +1002,6 @@ namespace PMAlignTool this.panel2.Size = new System.Drawing.Size(376, 301); this.panel2.TabIndex = 149; // - // tkb_contrast - // - this.tkb_contrast.AutoSize = false; - this.tkb_contrast.BackColor = System.Drawing.Color.White; - this.tkb_contrast.Cursor = System.Windows.Forms.Cursors.Hand; - this.tkb_contrast.Location = new System.Drawing.Point(80, 218); - this.tkb_contrast.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.tkb_contrast.Maximum = 244; - this.tkb_contrast.Minimum = 1; - this.tkb_contrast.Name = "tkb_contrast"; - this.tkb_contrast.Size = new System.Drawing.Size(239, 20); - this.tkb_contrast.TabIndex = 167; - this.tkb_contrast.TickStyle = System.Windows.Forms.TickStyle.None; - this.tkb_contrast.Value = 30; - // - // lbl_contastValue - // - this.lbl_contastValue.AutoSize = true; - this.lbl_contastValue.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.lbl_contastValue.Location = new System.Drawing.Point(273, 239); - this.lbl_contastValue.Name = "lbl_contastValue"; - this.lbl_contastValue.Size = new System.Drawing.Size(22, 17); - this.lbl_contastValue.TabIndex = 168; - this.lbl_contastValue.Text = "80"; - // - // label87 - // - this.label87.AutoSize = true; - this.label87.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label87.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.label87.Location = new System.Drawing.Point(249, 101); - this.label87.Name = "label87"; - this.label87.Size = new System.Drawing.Size(25, 17); - this.label87.TabIndex = 170; - this.label87.Text = "ms"; - // - // label26 - // - this.label26.AutoSize = true; - this.label26.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label26.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.label26.Location = new System.Drawing.Point(318, 160); - this.label26.Name = "label26"; - this.label26.Size = new System.Drawing.Size(31, 17); - this.label26.TabIndex = 171; - this.label26.Text = "deg"; - // - // label55 - // - this.label55.AutoSize = true; - this.label55.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label55.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); - this.label55.Location = new System.Drawing.Point(249, 72); - this.label55.Name = "label55"; - this.label55.Size = new System.Drawing.Size(31, 17); - this.label55.TabIndex = 169; - this.label55.Text = "deg"; - // - // label12 - // - this.label12.AutoSize = true; - this.label12.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label12.Location = new System.Drawing.Point(15, 189); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(44, 17); - this.label12.TabIndex = 157; - this.label12.Text = "缩放:"; - // - // label23 - // - this.label23.AutoSize = true; - this.label23.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label23.Location = new System.Drawing.Point(15, 160); - this.label23.Name = "label23"; - this.label23.Size = new System.Drawing.Size(44, 17); - this.label23.TabIndex = 156; - this.label23.Text = "角度:"; - // - // label90 - // - this.label90.AutoSize = true; - this.label90.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label90.Location = new System.Drawing.Point(15, 131); - this.label90.Name = "label90"; - this.label90.Size = new System.Drawing.Size(44, 17); - this.label90.TabIndex = 155; - this.label90.Text = "极性:"; - // - // label88 - // - this.label88.AutoSize = true; - this.label88.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label88.Location = new System.Drawing.Point(15, 102); - this.label88.Name = "label88"; - this.label88.Size = new System.Drawing.Size(44, 17); - this.label88.TabIndex = 154; - this.label88.Text = "超时:"; - // - // label56 - // - this.label56.AutoSize = true; - this.label56.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label56.Location = new System.Drawing.Point(15, 73); - this.label56.Name = "label56"; - this.label56.Size = new System.Drawing.Size(44, 17); - this.label56.TabIndex = 153; - this.label56.Text = "步长:"; - // - // label14 - // - this.label14.AutoSize = true; - this.label14.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label14.Location = new System.Drawing.Point(15, 15); - this.label14.Name = "label14"; - this.label14.Size = new System.Drawing.Size(44, 17); - this.label14.TabIndex = 150; - this.label14.Text = "分数:"; - // - // label15 - // - this.label15.AutoSize = true; - this.label15.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label15.Location = new System.Drawing.Point(15, 44); - this.label15.Name = "label15"; - this.label15.Size = new System.Drawing.Size(44, 17); - this.label15.TabIndex = 151; - this.label15.Text = "个数:"; - // - // label85 - // - this.label85.AutoSize = true; - this.label85.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label85.Location = new System.Drawing.Point(15, 218); - this.label85.Name = "label85"; - this.label85.Size = new System.Drawing.Size(44, 17); - this.label85.TabIndex = 152; - this.label85.Text = "阈值:"; - // - // panel5 - // - this.panel5.BackColor = System.Drawing.Color.White; - this.panel5.Controls.Add(this.cbx_searchRegionType); - this.panel5.Controls.Add(this.label5); - this.panel5.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel5.Location = new System.Drawing.Point(3, 378); - this.panel5.Name = "panel5"; - this.panel5.Size = new System.Drawing.Size(376, 181); - this.panel5.TabIndex = 151; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.label5.Location = new System.Drawing.Point(15, 18); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(68, 17); - this.label5.TabIndex = 121; - this.label5.Text = "搜索区域:"; - // - // tabPage4 - // - this.tabPage4.Controls.Add(this.panel6); - this.tabPage4.Location = new System.Drawing.Point(4, 29); - this.tabPage4.Name = "tabPage4"; - this.tabPage4.Size = new System.Drawing.Size(388, 568); - this.tabPage4.TabIndex = 3; - this.tabPage4.Text = "图形"; - this.tabPage4.UseVisualStyleBackColor = true; - // - // panel6 - // - this.panel6.Controls.Add(this.checkBox2); - this.panel6.Controls.Add(this.checkBox1); - this.panel6.Controls.Add(this.cbx_showTemplate); - this.panel6.Controls.Add(this.ckb_showFeature); - this.panel6.Controls.Add(this.ckb_showCross); - this.panel6.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel6.Location = new System.Drawing.Point(0, 0); - this.panel6.Name = "panel6"; - this.panel6.Size = new System.Drawing.Size(388, 568); - this.panel6.TabIndex = 0; - // - // checkBox2 - // - this.checkBox2.AutoSize = true; - this.checkBox2.Cursor = System.Windows.Forms.Cursors.Hand; - this.checkBox2.Location = new System.Drawing.Point(13, 73); - this.checkBox2.Margin = new System.Windows.Forms.Padding(2); - this.checkBox2.Name = "checkBox2"; - this.checkBox2.Size = new System.Drawing.Size(112, 24); - this.checkBox2.TabIndex = 21; - this.checkBox2.Text = "显示搜索区域"; - this.checkBox2.UseVisualStyleBackColor = true; - // - // checkBox1 - // - this.checkBox1.AutoSize = true; - this.checkBox1.Cursor = System.Windows.Forms.Cursors.Hand; - this.checkBox1.Location = new System.Drawing.Point(13, 98); - this.checkBox1.Margin = new System.Windows.Forms.Padding(2); - this.checkBox1.Name = "checkBox1"; - this.checkBox1.Size = new System.Drawing.Size(84, 24); - this.checkBox1.TabIndex = 19; - this.checkBox1.Text = "显示序号"; - this.checkBox1.UseVisualStyleBackColor = true; - // - // cbx_showTemplate - // - this.cbx_showTemplate.AutoSize = true; - this.cbx_showTemplate.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; - this.cbx_showTemplate.Cursor = System.Windows.Forms.Cursors.Hand; - this.cbx_showTemplate.Location = new System.Drawing.Point(13, 23); - this.cbx_showTemplate.Margin = new System.Windows.Forms.Padding(2); - this.cbx_showTemplate.Name = "cbx_showTemplate"; - this.cbx_showTemplate.Size = new System.Drawing.Size(84, 24); - this.cbx_showTemplate.TabIndex = 15; - this.cbx_showTemplate.Text = "显示模板"; - this.cbx_showTemplate.UseVisualStyleBackColor = true; - // - // ckb_showFeature - // - this.ckb_showFeature.AutoSize = true; - this.ckb_showFeature.Cursor = System.Windows.Forms.Cursors.Hand; - this.ckb_showFeature.Location = new System.Drawing.Point(13, 48); - this.ckb_showFeature.Margin = new System.Windows.Forms.Padding(2); - this.ckb_showFeature.Name = "ckb_showFeature"; - this.ckb_showFeature.Size = new System.Drawing.Size(84, 24); - this.ckb_showFeature.TabIndex = 14; - this.ckb_showFeature.Text = "显示特征"; - this.ckb_showFeature.UseVisualStyleBackColor = true; - // - // ckb_showCross - // - this.ckb_showCross.AutoSize = true; - this.ckb_showCross.Cursor = System.Windows.Forms.Cursors.Hand; - this.ckb_showCross.Location = new System.Drawing.Point(13, 124); - this.ckb_showCross.Margin = new System.Windows.Forms.Padding(2); - this.ckb_showCross.Name = "ckb_showCross"; - this.ckb_showCross.Size = new System.Drawing.Size(98, 24); - this.ckb_showCross.TabIndex = 13; - this.ckb_showCross.Text = "显示参考点"; - this.ckb_showCross.UseVisualStyleBackColor = true; - // - // tabPage5 - // - this.tabPage5.Controls.Add(this.panel7); - this.tabPage5.Location = new System.Drawing.Point(4, 29); - this.tabPage5.Name = "tabPage5"; - this.tabPage5.Size = new System.Drawing.Size(388, 568); - this.tabPage5.TabIndex = 4; - this.tabPage5.Text = "结果"; - this.tabPage5.UseVisualStyleBackColor = true; - // - // panel7 - // - this.panel7.Controls.Add(this.dgv_matchResult); - this.panel7.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel7.Location = new System.Drawing.Point(0, 0); - this.panel7.Name = "panel7"; - this.panel7.Size = new System.Drawing.Size(388, 568); - this.panel7.TabIndex = 0; - // - // dgv_matchResult - // - this.dgv_matchResult.AllowDrop = true; - this.dgv_matchResult.AllowUserToAddRows = false; - this.dgv_matchResult.AllowUserToDeleteRows = false; - this.dgv_matchResult.AllowUserToResizeRows = false; - this.dgv_matchResult.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; - this.dgv_matchResult.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { - this.Column7, - this.Column8, - this.Column9, - this.Column10, - this.Column12}); - this.dgv_matchResult.Dock = System.Windows.Forms.DockStyle.Fill; - this.dgv_matchResult.Location = new System.Drawing.Point(0, 0); - this.dgv_matchResult.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.dgv_matchResult.Name = "dgv_matchResult"; - this.dgv_matchResult.ReadOnly = true; - this.dgv_matchResult.RowHeadersVisible = false; - this.dgv_matchResult.RowTemplate.Height = 23; - this.dgv_matchResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; - this.dgv_matchResult.Size = new System.Drawing.Size(388, 568); - this.dgv_matchResult.TabIndex = 13; - // - // Column7 - // - this.Column7.HeaderText = "编号"; - this.Column7.Name = "Column7"; - this.Column7.ReadOnly = true; - this.Column7.Width = 70; - // - // Column8 - // - this.Column8.HeaderText = "分数"; - this.Column8.Name = "Column8"; - this.Column8.ReadOnly = true; - this.Column8.Width = 75; - // - // Column9 - // - this.Column9.HeaderText = "行"; - this.Column9.Name = "Column9"; - this.Column9.ReadOnly = true; - this.Column9.Width = 70; - // - // Column10 - // - this.Column10.HeaderText = "列"; - this.Column10.Name = "Column10"; - this.Column10.ReadOnly = true; - this.Column10.Width = 70; - // - // Column12 - // - this.Column12.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; - this.Column12.HeaderText = "角度(°)"; - this.Column12.Name = "Column12"; - this.Column12.ReadOnly = true; - // - // hWindowTool_Smart1 - // - this.hWindowTool_Smart1.DispStatus = false; - this.hWindowTool_Smart1.Dock = System.Windows.Forms.DockStyle.Fill; - this.hWindowTool_Smart1.hv_Image = null; - this.hWindowTool_Smart1.Location = new System.Drawing.Point(4, 5); - this.hWindowTool_Smart1.Margin = new System.Windows.Forms.Padding(4, 5, 4, 5); - this.hWindowTool_Smart1.Name = "hWindowTool_Smart1"; - this.tableLayoutPanel1.SetRowSpan(this.hWindowTool_Smart1, 3); - this.hWindowTool_Smart1.Size = new System.Drawing.Size(226, 169); - this.hWindowTool_Smart1.TabIndex = 0; - // - // cmbErsion2 - // - this.cmbErsion2.BackColor = System.Drawing.Color.White; - this.cmbErsion2.CanEdit = false; - this.cmbErsion2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.cmbErsion2.Items = new string[] { - "octagon", - "rectangle", - "rhombus"}; - this.cmbErsion2.Location = new System.Drawing.Point(268, 91); - this.cmbErsion2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.cmbErsion2.Name = "cmbErsion2"; - this.cmbErsion2.SelectedIndex = 1; - this.cmbErsion2.Size = new System.Drawing.Size(95, 26); - this.cmbErsion2.TabIndex = 175; - this.cmbErsion2.TextStr = "rectangle"; - this.cmbErsion2.SelectedIndexChanged += new Controls.DSelectedIndexChanged(this.cmbErsion1_SelectedIndexChanged); - // - // cmbDilation - // - this.cmbDilation.BackColor = System.Drawing.Color.White; - this.cmbDilation.CanEdit = false; - this.cmbDilation.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.cmbDilation.Items = new string[] { - "octagon", - "rectangle", - "rhombus"}; - this.cmbDilation.Location = new System.Drawing.Point(268, 49); - this.cmbDilation.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.cmbDilation.Name = "cmbDilation"; - this.cmbDilation.SelectedIndex = 1; - this.cmbDilation.Size = new System.Drawing.Size(95, 26); - this.cmbDilation.TabIndex = 175; - this.cmbDilation.TextStr = "rectangle"; - this.cmbDilation.SelectedIndexChanged += new Controls.DSelectedIndexChanged(this.cmbErsion1_SelectedIndexChanged); - // - // cmbErsion1 - // - this.cmbErsion1.BackColor = System.Drawing.Color.White; - this.cmbErsion1.CanEdit = false; - this.cmbErsion1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.cmbErsion1.Items = new string[] { - "octagon", - "rectangle", - "rhombus"}; - this.cmbErsion1.Location = new System.Drawing.Point(268, 14); - this.cmbErsion1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.cmbErsion1.Name = "cmbErsion1"; - this.cmbErsion1.SelectedIndex = 1; - this.cmbErsion1.Size = new System.Drawing.Size(95, 26); - this.cmbErsion1.TabIndex = 175; - this.cmbErsion1.TextStr = "rectangle"; - this.cmbErsion1.SelectedIndexChanged += new Controls.DSelectedIndexChanged(this.cmbErsion1_SelectedIndexChanged); - // - // cNumErosionValue2 - // - this.cNumErosionValue2.BackColor = System.Drawing.Color.White; - this.cNumErosionValue2.DecimalPlaces = 0; - this.cNumErosionValue2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.cNumErosionValue2.Incremeent = new decimal(new int[] { - 1, - 0, - 0, - 65536}); - this.cNumErosionValue2.Location = new System.Drawing.Point(71, 91); - this.cNumErosionValue2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.cNumErosionValue2.MaximumSize = new System.Drawing.Size(300, 26); - this.cNumErosionValue2.MaxValue = new decimal(new int[] { - 10000, - 0, - 0, - 0}); - this.cNumErosionValue2.MinimumSize = new System.Drawing.Size(50, 26); - this.cNumErosionValue2.MinValue = new decimal(new int[] { - 1, - 0, - 0, - 65536}); - this.cNumErosionValue2.Name = "cNumErosionValue2"; - this.cNumErosionValue2.Size = new System.Drawing.Size(127, 26); - this.cNumErosionValue2.TabIndex = 174; - this.cNumErosionValue2.Value = 1D; - this.cNumErosionValue2.ValueChanged += new Controls.DValueChanged(this.PreValueChanged); - // - // cNumDilationValue2 - // - this.cNumDilationValue2.BackColor = System.Drawing.Color.White; - this.cNumDilationValue2.DecimalPlaces = 0; - this.cNumDilationValue2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.cNumDilationValue2.Incremeent = new decimal(new int[] { - 1, - 0, - 0, - 65536}); - this.cNumDilationValue2.Location = new System.Drawing.Point(71, 49); - this.cNumDilationValue2.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.cNumDilationValue2.MaximumSize = new System.Drawing.Size(300, 26); - this.cNumDilationValue2.MaxValue = new decimal(new int[] { - 10000, - 0, - 0, - 0}); - this.cNumDilationValue2.MinimumSize = new System.Drawing.Size(50, 26); - this.cNumDilationValue2.MinValue = new decimal(new int[] { - 1, - 0, - 0, - 65536}); - this.cNumDilationValue2.Name = "cNumDilationValue2"; - this.cNumDilationValue2.Size = new System.Drawing.Size(127, 26); - this.cNumDilationValue2.TabIndex = 174; - this.cNumDilationValue2.Value = 1D; - this.cNumDilationValue2.ValueChanged += new Controls.DValueChanged(this.PreValueChanged); - // - // cNumErosionValue1 - // - this.cNumErosionValue1.BackColor = System.Drawing.Color.White; - this.cNumErosionValue1.DecimalPlaces = 0; - this.cNumErosionValue1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.cNumErosionValue1.Incremeent = new decimal(new int[] { - 1, - 0, - 0, - 65536}); - this.cNumErosionValue1.Location = new System.Drawing.Point(71, 14); - this.cNumErosionValue1.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.cNumErosionValue1.MaximumSize = new System.Drawing.Size(300, 26); - this.cNumErosionValue1.MaxValue = new decimal(new int[] { - 10000, - 0, - 0, - 0}); - this.cNumErosionValue1.MinimumSize = new System.Drawing.Size(50, 26); - this.cNumErosionValue1.MinValue = new decimal(new int[] { - 1, - 0, - 0, - 65536}); - this.cNumErosionValue1.Name = "cNumErosionValue1"; - this.cNumErosionValue1.Size = new System.Drawing.Size(127, 26); - this.cNumErosionValue1.TabIndex = 174; - this.cNumErosionValue1.Value = 1D; - this.cNumErosionValue1.ValueChanged += new Controls.DValueChanged(this.PreValueChanged); - // // nud_angleRange // this.nud_angleRange.BackColor = System.Drawing.Color.White; @@ -1498,34 +1177,34 @@ namespace PMAlignTool this.nud_minScore.TabIndex = 173; this.nud_minScore.Value = 0.8D; // - // numericUpDown3 + // nud_Timeout // - this.numericUpDown3.BackColor = System.Drawing.Color.White; - this.numericUpDown3.DecimalPlaces = 0; - this.numericUpDown3.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.numericUpDown3.Incremeent = new decimal(new int[] { + this.nud_Timeout.BackColor = System.Drawing.Color.White; + this.nud_Timeout.DecimalPlaces = 0; + this.nud_Timeout.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.nud_Timeout.Incremeent = new decimal(new int[] { 100, 0, 0, 0}); - this.numericUpDown3.Location = new System.Drawing.Point(84, 96); - this.numericUpDown3.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); - this.numericUpDown3.MaximumSize = new System.Drawing.Size(300, 28); - this.numericUpDown3.MaxValue = new decimal(new int[] { + this.nud_Timeout.Location = new System.Drawing.Point(84, 96); + this.nud_Timeout.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.nud_Timeout.MaximumSize = new System.Drawing.Size(300, 28); + this.nud_Timeout.MaxValue = new decimal(new int[] { 10000, 0, 0, 0}); - this.numericUpDown3.MinimumSize = new System.Drawing.Size(50, 28); - this.numericUpDown3.MinValue = new decimal(new int[] { + this.nud_Timeout.MinimumSize = new System.Drawing.Size(50, 28); + this.nud_Timeout.MinValue = new decimal(new int[] { 1, 0, 0, 0}); - this.numericUpDown3.Name = "numericUpDown3"; - this.numericUpDown3.Size = new System.Drawing.Size(227, 28); - this.numericUpDown3.TabIndex = 177; - this.numericUpDown3.Value = 100D; + this.nud_Timeout.Name = "nud_Timeout"; + this.nud_Timeout.Size = new System.Drawing.Size(227, 28); + this.nud_Timeout.TabIndex = 177; + this.nud_Timeout.Value = 500D; // // nud_angleStep // @@ -1585,6 +1264,156 @@ namespace PMAlignTool this.nud_matchNum.TabIndex = 174; this.nud_matchNum.Value = 1D; // + // tkb_contrast + // + this.tkb_contrast.AutoSize = false; + this.tkb_contrast.BackColor = System.Drawing.Color.White; + this.tkb_contrast.Cursor = System.Windows.Forms.Cursors.Hand; + this.tkb_contrast.Location = new System.Drawing.Point(80, 218); + this.tkb_contrast.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.tkb_contrast.Maximum = 244; + this.tkb_contrast.Minimum = 1; + this.tkb_contrast.Name = "tkb_contrast"; + this.tkb_contrast.Size = new System.Drawing.Size(239, 20); + this.tkb_contrast.TabIndex = 167; + this.tkb_contrast.TickStyle = System.Windows.Forms.TickStyle.None; + this.tkb_contrast.Value = 30; + this.tkb_contrast.Scroll += new System.EventHandler(this.tkb_contrast_Scroll); + // + // lbl_contastValue + // + this.lbl_contastValue.AutoSize = true; + this.lbl_contastValue.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lbl_contastValue.Location = new System.Drawing.Point(273, 239); + this.lbl_contastValue.Name = "lbl_contastValue"; + this.lbl_contastValue.Size = new System.Drawing.Size(22, 17); + this.lbl_contastValue.TabIndex = 168; + this.lbl_contastValue.Text = "80"; + // + // label87 + // + this.label87.AutoSize = true; + this.label87.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label87.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.label87.Location = new System.Drawing.Point(249, 101); + this.label87.Name = "label87"; + this.label87.Size = new System.Drawing.Size(25, 17); + this.label87.TabIndex = 170; + this.label87.Text = "ms"; + // + // label26 + // + this.label26.AutoSize = true; + this.label26.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label26.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.label26.Location = new System.Drawing.Point(318, 160); + this.label26.Name = "label26"; + this.label26.Size = new System.Drawing.Size(31, 17); + this.label26.TabIndex = 171; + this.label26.Text = "deg"; + // + // label55 + // + this.label55.AutoSize = true; + this.label55.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label55.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(64)))), ((int)(((byte)(64)))), ((int)(((byte)(64))))); + this.label55.Location = new System.Drawing.Point(249, 72); + this.label55.Name = "label55"; + this.label55.Size = new System.Drawing.Size(31, 17); + this.label55.TabIndex = 169; + this.label55.Text = "deg"; + // + // label12 + // + this.label12.AutoSize = true; + this.label12.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label12.Location = new System.Drawing.Point(15, 189); + this.label12.Name = "label12"; + this.label12.Size = new System.Drawing.Size(44, 17); + this.label12.TabIndex = 157; + this.label12.Text = "缩放:"; + // + // label23 + // + this.label23.AutoSize = true; + this.label23.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label23.Location = new System.Drawing.Point(15, 160); + this.label23.Name = "label23"; + this.label23.Size = new System.Drawing.Size(44, 17); + this.label23.TabIndex = 156; + this.label23.Text = "角度:"; + // + // label90 + // + this.label90.AutoSize = true; + this.label90.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label90.Location = new System.Drawing.Point(15, 131); + this.label90.Name = "label90"; + this.label90.Size = new System.Drawing.Size(44, 17); + this.label90.TabIndex = 155; + this.label90.Text = "极性:"; + // + // label88 + // + this.label88.AutoSize = true; + this.label88.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label88.Location = new System.Drawing.Point(15, 102); + this.label88.Name = "label88"; + this.label88.Size = new System.Drawing.Size(44, 17); + this.label88.TabIndex = 154; + this.label88.Text = "超时:"; + // + // label56 + // + this.label56.AutoSize = true; + this.label56.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label56.Location = new System.Drawing.Point(15, 73); + this.label56.Name = "label56"; + this.label56.Size = new System.Drawing.Size(44, 17); + this.label56.TabIndex = 153; + this.label56.Text = "步长:"; + // + // label14 + // + this.label14.AutoSize = true; + this.label14.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label14.Location = new System.Drawing.Point(15, 15); + this.label14.Name = "label14"; + this.label14.Size = new System.Drawing.Size(44, 17); + this.label14.TabIndex = 150; + this.label14.Text = "分数:"; + // + // label15 + // + this.label15.AutoSize = true; + this.label15.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label15.Location = new System.Drawing.Point(15, 44); + this.label15.Name = "label15"; + this.label15.Size = new System.Drawing.Size(44, 17); + this.label15.TabIndex = 151; + this.label15.Text = "个数:"; + // + // label85 + // + this.label85.AutoSize = true; + this.label85.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label85.Location = new System.Drawing.Point(15, 218); + this.label85.Name = "label85"; + this.label85.Size = new System.Drawing.Size(44, 17); + this.label85.TabIndex = 152; + this.label85.Text = "阈值:"; + // + // panel5 + // + this.panel5.BackColor = System.Drawing.Color.White; + this.panel5.Controls.Add(this.cbx_searchRegionType); + this.panel5.Controls.Add(this.label5); + this.panel5.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel5.Location = new System.Drawing.Point(3, 378); + this.panel5.Name = "panel5"; + this.panel5.Size = new System.Drawing.Size(376, 181); + this.panel5.TabIndex = 151; + // // cbx_searchRegionType // this.cbx_searchRegionType.BackColor = System.Drawing.Color.White; @@ -1604,6 +1433,178 @@ namespace PMAlignTool this.cbx_searchRegionType.TabIndex = 122; this.cbx_searchRegionType.TextStr = "整幅图像"; // + // label5 + // + this.label5.AutoSize = true; + this.label5.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.label5.Location = new System.Drawing.Point(15, 18); + this.label5.Name = "label5"; + this.label5.Size = new System.Drawing.Size(68, 17); + this.label5.TabIndex = 121; + this.label5.Text = "搜索区域:"; + // + // tabPage4 + // + this.tabPage4.Controls.Add(this.panel6); + this.tabPage4.Location = new System.Drawing.Point(4, 29); + this.tabPage4.Name = "tabPage4"; + this.tabPage4.Size = new System.Drawing.Size(388, 568); + this.tabPage4.TabIndex = 3; + this.tabPage4.Text = "图形"; + this.tabPage4.UseVisualStyleBackColor = true; + // + // panel6 + // + this.panel6.Controls.Add(this.checkBox2); + this.panel6.Controls.Add(this.checkBox1); + this.panel6.Controls.Add(this.cbx_showTemplate); + this.panel6.Controls.Add(this.ckb_showFeature); + this.panel6.Controls.Add(this.ckb_showCross); + this.panel6.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel6.Location = new System.Drawing.Point(0, 0); + this.panel6.Name = "panel6"; + this.panel6.Size = new System.Drawing.Size(388, 568); + this.panel6.TabIndex = 0; + // + // checkBox2 + // + this.checkBox2.AutoSize = true; + this.checkBox2.Cursor = System.Windows.Forms.Cursors.Hand; + this.checkBox2.Location = new System.Drawing.Point(13, 73); + this.checkBox2.Margin = new System.Windows.Forms.Padding(2); + this.checkBox2.Name = "checkBox2"; + this.checkBox2.Size = new System.Drawing.Size(112, 24); + this.checkBox2.TabIndex = 21; + this.checkBox2.Text = "显示搜索区域"; + this.checkBox2.UseVisualStyleBackColor = true; + // + // checkBox1 + // + this.checkBox1.AutoSize = true; + this.checkBox1.Cursor = System.Windows.Forms.Cursors.Hand; + this.checkBox1.Location = new System.Drawing.Point(13, 98); + this.checkBox1.Margin = new System.Windows.Forms.Padding(2); + this.checkBox1.Name = "checkBox1"; + this.checkBox1.Size = new System.Drawing.Size(84, 24); + this.checkBox1.TabIndex = 19; + this.checkBox1.Text = "显示序号"; + this.checkBox1.UseVisualStyleBackColor = true; + // + // cbx_showTemplate + // + this.cbx_showTemplate.AutoSize = true; + this.cbx_showTemplate.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom; + this.cbx_showTemplate.Cursor = System.Windows.Forms.Cursors.Hand; + this.cbx_showTemplate.Location = new System.Drawing.Point(13, 23); + this.cbx_showTemplate.Margin = new System.Windows.Forms.Padding(2); + this.cbx_showTemplate.Name = "cbx_showTemplate"; + this.cbx_showTemplate.Size = new System.Drawing.Size(84, 24); + this.cbx_showTemplate.TabIndex = 15; + this.cbx_showTemplate.Text = "显示模板"; + this.cbx_showTemplate.UseVisualStyleBackColor = true; + // + // ckb_showFeature + // + this.ckb_showFeature.AutoSize = true; + this.ckb_showFeature.Cursor = System.Windows.Forms.Cursors.Hand; + this.ckb_showFeature.Location = new System.Drawing.Point(13, 48); + this.ckb_showFeature.Margin = new System.Windows.Forms.Padding(2); + this.ckb_showFeature.Name = "ckb_showFeature"; + this.ckb_showFeature.Size = new System.Drawing.Size(84, 24); + this.ckb_showFeature.TabIndex = 14; + this.ckb_showFeature.Text = "显示特征"; + this.ckb_showFeature.UseVisualStyleBackColor = true; + // + // ckb_showCross + // + this.ckb_showCross.AutoSize = true; + this.ckb_showCross.Cursor = System.Windows.Forms.Cursors.Hand; + this.ckb_showCross.Location = new System.Drawing.Point(13, 124); + this.ckb_showCross.Margin = new System.Windows.Forms.Padding(2); + this.ckb_showCross.Name = "ckb_showCross"; + this.ckb_showCross.Size = new System.Drawing.Size(98, 24); + this.ckb_showCross.TabIndex = 13; + this.ckb_showCross.Text = "显示参考点"; + this.ckb_showCross.UseVisualStyleBackColor = true; + // + // tabPage5 + // + this.tabPage5.Controls.Add(this.panel7); + this.tabPage5.Location = new System.Drawing.Point(4, 29); + this.tabPage5.Name = "tabPage5"; + this.tabPage5.Size = new System.Drawing.Size(388, 568); + this.tabPage5.TabIndex = 4; + this.tabPage5.Text = "结果"; + this.tabPage5.UseVisualStyleBackColor = true; + // + // panel7 + // + this.panel7.Controls.Add(this.dgv_matchResult); + this.panel7.Dock = System.Windows.Forms.DockStyle.Fill; + this.panel7.Location = new System.Drawing.Point(0, 0); + this.panel7.Name = "panel7"; + this.panel7.Size = new System.Drawing.Size(388, 568); + this.panel7.TabIndex = 0; + // + // dgv_matchResult + // + this.dgv_matchResult.AllowDrop = true; + this.dgv_matchResult.AllowUserToAddRows = false; + this.dgv_matchResult.AllowUserToDeleteRows = false; + this.dgv_matchResult.AllowUserToResizeRows = false; + this.dgv_matchResult.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; + this.dgv_matchResult.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { + this.Column7, + this.Column8, + this.Column9, + this.Column10, + this.Column12}); + this.dgv_matchResult.Dock = System.Windows.Forms.DockStyle.Fill; + this.dgv_matchResult.Location = new System.Drawing.Point(0, 0); + this.dgv_matchResult.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4); + this.dgv_matchResult.Name = "dgv_matchResult"; + this.dgv_matchResult.ReadOnly = true; + this.dgv_matchResult.RowHeadersVisible = false; + this.dgv_matchResult.RowTemplate.Height = 23; + this.dgv_matchResult.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect; + this.dgv_matchResult.Size = new System.Drawing.Size(388, 568); + this.dgv_matchResult.TabIndex = 13; + // + // Column7 + // + this.Column7.HeaderText = "编号"; + this.Column7.Name = "Column7"; + this.Column7.ReadOnly = true; + this.Column7.Width = 70; + // + // Column8 + // + this.Column8.HeaderText = "分数"; + this.Column8.Name = "Column8"; + this.Column8.ReadOnly = true; + this.Column8.Width = 75; + // + // Column9 + // + this.Column9.HeaderText = "行"; + this.Column9.Name = "Column9"; + this.Column9.ReadOnly = true; + this.Column9.Width = 70; + // + // Column10 + // + this.Column10.HeaderText = "列"; + this.Column10.Name = "Column10"; + this.Column10.ReadOnly = true; + this.Column10.Width = 70; + // + // Column12 + // + this.Column12.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill; + this.Column12.HeaderText = "角度(°)"; + this.Column12.Name = "Column12"; + this.Column12.ReadOnly = true; + // // FormPMAlignTool // this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 17F); @@ -1700,7 +1701,7 @@ namespace PMAlignTool public Controls.CNumericUpDown nud_ScaleStart; public Controls.CComboBox cbx_polarity; public Controls.CNumericUpDown nud_minScore; - public Controls.CNumericUpDown numericUpDown3; + public Controls.CNumericUpDown nud_Timeout; public Controls.CNumericUpDown nud_angleStep; public Controls.CNumericUpDown nud_matchNum; internal System.Windows.Forms.TrackBar tkb_contrast; diff --git a/PMAlignTool/FormPMAlignTool.cs b/PMAlignTool/FormPMAlignTool.cs index d104b8b..a7378e4 100644 --- a/PMAlignTool/FormPMAlignTool.cs +++ b/PMAlignTool/FormPMAlignTool.cs @@ -77,6 +77,7 @@ namespace PMAlignTool private void InitTool() { isInitTool = true; + #region 图像预处理 cNumErosionValue1.Value = myPMAlign.imageProcess.erosionValue1.algValue; cbCErosion1.Checked = myPMAlign.imageProcess.erosionValue1.isEnable; cmbErsion1.TextStr = myPMAlign.imageProcess.erosionValue1.algName; @@ -88,7 +89,19 @@ namespace PMAlignTool cNumErosionValue2.Value = myPMAlign.imageProcess.erosionValue2.algValue; cbCErosion2.Checked = myPMAlign.imageProcess.erosionValue2.isEnable; cmbErsion2.TextStr = myPMAlign.imageProcess.erosionValue2.algName; - isInitTool = false; + #endregion + #region 界面参数 + nud_minScore.Value = myPMAlign.minScore; + nud_matchNum.Value = myPMAlign.matchNum; + nud_angleStep.Value = myPMAlign.angleStep; + nud_Timeout.Value = myPMAlign.timeOut; + nud_angleStart.Value = myPMAlign.startAngle; + nud_angleRange.Value = myPMAlign.angleRange; + nud_ScaleStart.Value = myPMAlign.minScale; + nud_ScaleRange.Value = myPMAlign.maxScale; + tkb_contrast.Value = myPMAlign.contrast; + + #endregion } private void btnAcqNewModelImage_Click(object sender, EventArgs e) @@ -287,5 +300,10 @@ namespace PMAlignTool { myPMAlign.Run(SoftwareRunState.Debug); } + + private void tkb_contrast_Scroll(object sender, EventArgs e) + { + lbl_contastValue.Text = tkb_contrast.Value.ToString(); + } } } diff --git a/PMAlignTool/FormPMAlignTool.resx b/PMAlignTool/FormPMAlignTool.resx index 836d7e6..e90db2b 100644 --- a/PMAlignTool/FormPMAlignTool.resx +++ b/PMAlignTool/FormPMAlignTool.resx @@ -211,6 +211,21 @@ True + + True + + + True + + + True + + + True + + + True + 71 diff --git a/PMAlignTool/PMAlign.cs b/PMAlignTool/PMAlign.cs index 28bb200..9422da9 100644 --- a/PMAlignTool/PMAlign.cs +++ b/PMAlignTool/PMAlign.cs @@ -98,7 +98,7 @@ namespace PMAlignTool /// /// 角度范围 /// - internal int angleRange { get; set; } = 30; + internal int angleRange { get; set; } = 360; /// /// 角度步长 /// @@ -108,10 +108,15 @@ namespace PMAlignTool /// internal int contrast { get; set; } = 30; /// + /// 超时处理 + /// + internal int timeOut { get; set; } = 500; + /// /// 训练时所使用的模板图像,不点击获取图像时,不进行更新 /// public HObject oldTrainImage { get; set; } public bool isCreateModel { get; set; } + internal string pmaModelName { get; set; } = Guid.NewGuid().ToString(); public override void DispMainWindow(HWindow dispHWindow) { @@ -151,11 +156,11 @@ namespace PMAlignTool public RegionType searchRegionType { get; set; } public HObject SearchRegion { get; private set; } - public override void Run(SoftwareRunState softwareRunState) + public override void Run(SoftwareRunState softwareState) { Stopwatch sw = new Stopwatch(); sw.Restart(); - + softwareRunState = softwareState; if (inputImage == null) { FormPMAlignTool.Instance.SetToolStatus("工具输入图像为空", ToolRunStatu.Not_Input_Image); @@ -180,15 +185,8 @@ namespace PMAlignTool //对预期线的找模板区域做放射变换 } - minScore = FormPMAlignTool.Instance.nud_minScore.Value; - startAngle = Convert.ToInt16(FormPMAlignTool.Instance.nud_angleStart.Value); - angleRange = Convert.ToInt16(FormPMAlignTool.Instance.nud_angleRange.Value); - angleStep = Convert.ToInt16(FormPMAlignTool.Instance.nud_angleStep.Value); - polarity = FormPMAlignTool.Instance.cbx_polarity.TextStr; - isAutoConstants = FormPMAlignTool.Instance.ckb_autoContrast.Checked; - minScale = FormPMAlignTool.Instance.nud_ScaleStart.Value; - maxScale = FormPMAlignTool.Instance.nud_ScaleRange.Value; - HObject findModelImg = ProcessImage(inputImage); + UpdateParamsFromUI(); // 操作前先将UI中参数写入类 + HObject findModelImg = ProcessImage(inputImage); int ret = FindModelTemplate(findModelImg); ToolRunStatu myState = ret == 0 ? ToolRunStatu.Succeed : ToolRunStatu.Model_UnFound; string retMsg = ret == 0 ? "工具运行成功,已找到匹配项!" : "未找到匹配项"; @@ -205,7 +203,19 @@ namespace PMAlignTool } } - + public void UpdateParamsFromUI() + { + minScore = FormPMAlignTool.Instance.nud_minScore.Value; + startAngle = Convert.ToInt16(FormPMAlignTool.Instance.nud_angleStart.Value); + angleRange = Convert.ToInt16(FormPMAlignTool.Instance.nud_angleRange.Value); + angleStep = Convert.ToInt16(FormPMAlignTool.Instance.nud_angleStep.Value); + polarity = FormPMAlignTool.Instance.cbx_polarity.TextStr; + isAutoConstants = FormPMAlignTool.Instance.ckb_autoContrast.Checked; + minScale = FormPMAlignTool.Instance.nud_ScaleStart.Value; + maxScale = FormPMAlignTool.Instance.nud_ScaleRange.Value; + timeOut = Convert.ToInt16(FormPMAlignTool.Instance.nud_Timeout.Value); + contrast = Convert.ToInt16(FormPMAlignTool.Instance.tkb_contrast.Value); + } public override void DispImage() { FormPMAlignTool.Instance.myHwindow.DispHWindow.ClearWindow(); @@ -244,11 +254,44 @@ namespace PMAlignTool HOperatorSet.GenEmptyObj(out createModelImg); createModelImg = ProcessImage(inputImage); HOperatorSet.ReduceDomain(createModelImg, templateRegion, out template); + minScore = FormPMAlignTool.Instance.nud_minScore.Value; + startAngle = Convert.ToInt16(FormPMAlignTool.Instance.nud_angleStart.Value); + angleRange = Convert.ToInt16(FormPMAlignTool.Instance.nud_angleRange.Value); + angleStep = Convert.ToInt16(FormPMAlignTool.Instance.nud_angleStep.Value); + polarity = FormPMAlignTool.Instance.cbx_polarity.TextStr; + isAutoConstants = FormPMAlignTool.Instance.ckb_autoContrast.Checked; + minScale = FormPMAlignTool.Instance.nud_ScaleStart.Value; + maxScale = FormPMAlignTool.Instance.nud_ScaleRange.Value; try { HTuple rows, cols, angles, scores, scale; if (matchMode == MatchMode.BasedShape) { + HOperatorSet.CreateShapeModel(template, + "auto", + 0, + 360, + "auto", + "auto", + polarity, + isAutoConstants ? (HTuple)"auto" : (HTuple)contrast, + "auto", + out modelID); + HOperatorSet.FindShapeModel(createModelImg, + (HTuple)modelID, + ((HTuple)startAngle).TupleRad(), + ((HTuple)angleRange - startAngle).TupleRad(), + (HTuple)minScore, + (HTuple)matchNum, + (HTuple)0.5, + (HTuple)"least_squares", + (HTuple)0, + (HTuple)0.9, + out rows, + out cols, + out angles, + out scores); + /* HOperatorSet.CreateScaledShapeModel(template, "auto", ((HTuple)startAngle).TupleRad(), @@ -262,7 +305,7 @@ namespace PMAlignTool isAutoConstants ? (HTuple)"auto" : (HTuple)contrast, "auto", out modelID); - HOperatorSet.FindScaledShapeModel(inputImage, + HOperatorSet.FindScaledShapeModel(createModelImg, (HTuple)modelID, ((HTuple)startAngle).TupleRad(), ((HTuple)angleRange - startAngle).TupleRad(), @@ -279,6 +322,7 @@ namespace PMAlignTool out angles, out scale, out scores); + */ } else { @@ -289,7 +333,7 @@ namespace PMAlignTool "auto", "use_polarity", out modelID); - HOperatorSet.FindNccModel(inputImage, + HOperatorSet.FindNccModel(createModelImg, (HTuple)modelID, ((HTuple)startAngle).TupleRad(), ((HTuple)angleRange - startAngle).TupleRad(), @@ -305,6 +349,7 @@ namespace PMAlignTool } isCreateModel = true; HOperatorSet.WriteRegion(templateRegion, FormPMAlignTool.Instance.myToolInfo.FormToolName + ".hobj"); + HOperatorSet.WriteShapeModel(modelID, pmaModelName + ".ShapeModel"); if (scores != null && scores.Type != HTupleType.EMPTY) { templatePose = new PosXYU { X = rows[0].D, Y = cols[0].D , U = angles[0].D }; @@ -331,11 +376,12 @@ namespace PMAlignTool LoggerClass.WriteLog("未创建或加载模板", MsgLevel.Exception); return -1; } - if (File.Exists(toolName + ".hobj")) + if (!File.Exists(pmaModelName + ".ShapeModel")) { - HOperatorSet.ReadRegion(out templateRegion, toolName + ".hobj"); - LoggerClass.WriteLog($"{FormPMAlignTool.Instance.myToolInfo.FormToolName} 已加载模板", MsgLevel.Info); + LoggerClass.WriteLog("未创建或加载模板", MsgLevel.Exception); + return -1; } + HOperatorSet.ReadShapeModel(pmaModelName + ".ShapeModel", out modelID); HObject image; if (searchRegionType == RegionType.AllImage) { @@ -350,10 +396,25 @@ namespace PMAlignTool L_resultList.Clear(); try { + image = ProcessImage(image); if (matchMode == MatchMode.BasedShape) { HTuple temp; - + HOperatorSet.FindShapeModel(image, + (HTuple)modelID, + ((HTuple)startAngle).TupleRad(), + ((HTuple)angleRange - startAngle).TupleRad(), + (HTuple)minScore, + (HTuple)matchNum, + (HTuple)0.5, + (HTuple)"least_squares", + (HTuple)0, + (HTuple)0.7, + out rows, + out cols, + out angles, + out scores); + /* HOperatorSet.FindScaledShapeModel(image, (HTuple)modelID, ((HTuple)startAngle).TupleRad(), @@ -371,7 +432,7 @@ namespace PMAlignTool out angles, out temp, out scores); - + */ } else { @@ -389,8 +450,7 @@ namespace PMAlignTool out angles, out scores); } - FormPMAlignTool.Instance.myHwindow.DispHWindow.ClearWindow(); - FormPMAlignTool.Instance.myHwindow.DispImage(inputImage); + if (rows.TupleLength() > 0) { for (int i = 0; i < rows.TupleLength(); i++) @@ -416,10 +476,18 @@ namespace PMAlignTool } } } - if(L_resultList.Count > 0) + if (softwareRunState == SoftwareRunState.Debug) + { + FormPMAlignTool.Instance.myHwindow.DispHWindow.ClearWindow(); + FormPMAlignTool.Instance.myHwindow.DispImage(inputImage); + } + if (L_resultList.Count > 0) { toolRunStatu = ToolRunStatu.Succeed; - ShowTemplate(FormPMAlignTool.Instance.myHwindow.DispHWindow); + if (softwareRunState == SoftwareRunState.Debug) + { + ShowTemplate(FormPMAlignTool.Instance.myHwindow.DispHWindow); + } return 0; } } @@ -448,25 +516,19 @@ namespace PMAlignTool dispHWindow.ClearWindow(); dispHWindow.DispObj(inputImage); } - if (matchMode == MatchMode.BasedShape) + if(L_resultList.Count > 0) { - HOperatorSet.GetShapeModelContours(out contour, modelID, new HTuple(1)); - HTuple area, row, col; - HOperatorSet.AreaCenter(templateRegion, out area, out row, out col); - HTuple homMat2D; - HOperatorSet.HomMat2dIdentity(out homMat2D); - HOperatorSet.HomMat2dTranslate(homMat2D, row, col, out homMat2D); - HOperatorSet.AffineTransContourXld(contour, out contour, homMat2D); - dispHWindow.SetColor("green"); - dispHWindow.DispObj(contour); + foreach (var item in L_resultList) + { + HTuple homMat2D; + HOperatorSet.GetShapeModelContours(out contour, modelID, new HTuple(1)); + HOperatorSet.VectorAngleToRigid(0, 0, 0, item.Row, item.Col, item.Angle,out homMat2D); + HOperatorSet.AffineTransContourXld(contour, out contour, homMat2D); + dispHWindow.SetColor("green"); + dispHWindow.DispObj(contour); + } } - HObject outBoundary, inBoundary; - HOperatorSet.Boundary(templateRegion, out outBoundary, "inner_filled"); - HOperatorSet.Boundary(templateRegion, out inBoundary, "outer"); - HOperatorSet.SetColor(FormPMAlignTool.Instance.myHwindow.DispHWindow, "green"); - HOperatorSet.SetLineStyle(FormPMAlignTool.Instance.myHwindow.DispHWindow, new HTuple()); - dispHWindow.DispObj(outBoundary); - dispHWindow.DispObj(inBoundary); + } catch (Exception ex) { diff --git a/PMAlignTool/PMAlignTool.csproj b/PMAlignTool/PMAlignTool.csproj index 9881c87..c1227f8 100644 --- a/PMAlignTool/PMAlignTool.csproj +++ b/PMAlignTool/PMAlignTool.csproj @@ -1,4 +1,4 @@ - + @@ -9,8 +9,9 @@ Properties PMAlignTool PMAlignTool - v4.5.2 + v4.6.1 512 + true diff --git a/PMAlignTool/PMAlignToolRun.cs b/PMAlignTool/PMAlignToolRun.cs index 03ea944..bf5bc9d 100644 --- a/PMAlignTool/PMAlignToolRun.cs +++ b/PMAlignTool/PMAlignToolRun.cs @@ -25,6 +25,7 @@ using System.Text.RegularExpressions; using HalconDotNet; using FormLib; using Logger; +using static DataStruct.DataStruct; namespace PMAlignTool { @@ -33,6 +34,7 @@ namespace PMAlignTool public void ToolRun(string jobName, int toolIndex, int inputItemNum, TreeNode selectNode, List L_toolList) { PMAlign myPMAlign = (PMAlign)L_toolList[toolIndex].tool; + VisionJob myJob = VisionJobParams.pVisionProject.Project[jobName]; for (int j = 0; j < inputItemNum; j++) { @@ -62,6 +64,17 @@ namespace PMAlignTool { myJob.FormLogDisp($"{L_toolList[toolIndex].toolName} 运行成功,{myPMAlign.runTime}", Color.Green, selectNode); myPMAlign.DispMainWindow(FormImageWindow.Instance.myHWindow.DispHWindow); + // 将输出值赋值到界面输出中 + if (myPMAlign.L_resultList.Count > 0) + { + L_toolList[toolIndex].toolOutput[0] = new ToolIO("GetPose", + new PosXYU { X = myPMAlign.L_resultList[0].Row, Y = myPMAlign.L_resultList[0].Col, U = myPMAlign.L_resultList[0].Angle }, + DataType.Pose); + L_toolList[toolIndex].toolOutput[1] = new ToolIO("GetPose.X", myPMAlign.L_resultList[0].Row, DataType.IntValue); + L_toolList[toolIndex].toolOutput[2] = new ToolIO("GetPose.Y", myPMAlign.L_resultList[0].Col, DataType.IntValue); + L_toolList[toolIndex].toolOutput[3] = new ToolIO("GetPose.Z", myPMAlign.L_resultList[0].Angle, DataType.DoubleValue); + L_toolList[toolIndex].toolOutput[4] = new ToolIO("GetPose.Score", myPMAlign.L_resultList[0].Socre, DataType.DoubleValue); + } } } } diff --git a/PMAlignTool/Properties/Resources.Designer.cs b/PMAlignTool/Properties/Resources.Designer.cs index 0bfe06a..69eb0c8 100644 --- a/PMAlignTool/Properties/Resources.Designer.cs +++ b/PMAlignTool/Properties/Resources.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // 此代码由工具生成。 // 运行时版本:4.0.30319.42000 diff --git a/ToolBase/ToolBase.csproj b/ToolBase/ToolBase.csproj index b2ee376..5e60034 100644 --- a/ToolBase/ToolBase.csproj +++ b/ToolBase/ToolBase.csproj @@ -1,4 +1,4 @@ - + @@ -9,8 +9,9 @@ Properties ToolBase ToolBase - v4.5.2 + v4.6.1 512 + true diff --git a/ToolLib.Log/Logger/Logger.csproj b/ToolLib.Log/Logger/Logger.csproj index e50ef45..f7ec09d 100644 --- a/ToolLib.Log/Logger/Logger.csproj +++ b/ToolLib.Log/Logger/Logger.csproj @@ -9,7 +9,7 @@ Properties Logger Logger - v4.5.2 + v4.6.1 512 @@ -31,9 +31,6 @@ 4 - - ..\..\VisionEdit\bin\Debug\log4net.dll - diff --git a/ToolLib.Log/Logger/LoggerClass.cs b/ToolLib.Log/Logger/LoggerClass.cs index 2bc29bb..ef8ba55 100644 --- a/ToolLib.Log/Logger/LoggerClass.cs +++ b/ToolLib.Log/Logger/LoggerClass.cs @@ -3,16 +3,12 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; -using log4net; using System.Windows.Forms; namespace Logger { public class LoggerClass { - private static readonly ILog loginfo = LogManager.GetLogger("loginfo"); - private static readonly ILog logerror = LogManager.GetLogger("logerror"); - /// /// Log队列 /// @@ -20,10 +16,6 @@ namespace Logger public static void WriteLog(string info, bool ShowMsgBox = false) { - if (loginfo.IsInfoEnabled) - { - loginfo.Info(info); - } logQueue.Enqueue(new LogInfo{ message = info, ex = null, logLevel = MsgLevel.Info}); if(ShowMsgBox) { @@ -32,10 +24,6 @@ namespace Logger } public static void WriteLog(string info, MsgLevel msgLevel, bool ShowMsgBox = false) { - if (loginfo.IsInfoEnabled) - { - loginfo.Info(info); - } logQueue.Enqueue(new LogInfo { message = info,ex = null, logLevel = msgLevel }); if (ShowMsgBox) { @@ -44,10 +32,6 @@ namespace Logger } public static void WriteLog(string info, MsgLevel msgLevel, Exception ex, bool ShowMsgBox = false) { - if (logerror.IsErrorEnabled) - { - logerror.Error(info, ex); - } logQueue.Enqueue(new LogInfo { message = info, ex = ex, logLevel = msgLevel }); if (ShowMsgBox) { @@ -56,10 +40,6 @@ namespace Logger } public static void WriteLog(string info, Exception ex, bool ShowMsgBox = false) { - if (logerror.IsErrorEnabled) - { - logerror.Error(info, ex); - } logQueue.Enqueue(new LogInfo { message = info, ex = ex, logLevel = MsgLevel.Exception }); if (ShowMsgBox) { diff --git a/ToolLib.Log/Logger/Properties/AssemblyInfo.cs b/ToolLib.Log/Logger/Properties/AssemblyInfo.cs index e01e056..9333185 100644 --- a/ToolLib.Log/Logger/Properties/AssemblyInfo.cs +++ b/ToolLib.Log/Logger/Properties/AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyCopyright("Copyright © 2020")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] -[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", ConfigFileExtension = "config", Watch = true)] +//[assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4net.config", ConfigFileExtension = "config", Watch = true)] //将 ComVisible 设置为 false 将使此程序集中的类型 //对 COM 组件不可见。 如果需要从 COM 访问此程序集中的类型, //请将此类型的 ComVisible 特性设置为 true。 diff --git a/ToolLib.Log/Logger/Properties/Resources.Designer.cs b/ToolLib.Log/Logger/Properties/Resources.Designer.cs index 67dbf08..c7a4fb5 100644 --- a/ToolLib.Log/Logger/Properties/Resources.Designer.cs +++ b/ToolLib.Log/Logger/Properties/Resources.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // 此代码由工具生成。 // 运行时版本:4.0.30319.42000 diff --git a/ToolLib.VisionJob/Properties/Resources.Designer.cs b/ToolLib.VisionJob/Properties/Resources.Designer.cs index a206c71..7adca04 100644 --- a/ToolLib.VisionJob/Properties/Resources.Designer.cs +++ b/ToolLib.VisionJob/Properties/Resources.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // 此代码由工具生成。 // 运行时版本:4.0.30319.42000 diff --git a/ToolLib.VisionJob/ToolLib.VisionJob.csproj b/ToolLib.VisionJob/ToolLib.VisionJob.csproj index 75bb705..c1bd7e7 100644 --- a/ToolLib.VisionJob/ToolLib.VisionJob.csproj +++ b/ToolLib.VisionJob/ToolLib.VisionJob.csproj @@ -9,8 +9,9 @@ Properties ToolLib.VisionJob ToolLib.VisionJob - v4.5.2 + v4.6.1 512 + true @@ -31,7 +32,7 @@ - ..\VisionEdit\bin\Debug\DevComponents.DotNetBar2.dll + ..\VisionEdit\bin\Debug\ThirdLib\DevComponents.DotNetBar2.dll @@ -82,6 +83,14 @@ {df3d4d4c-02df-4f92-9fd4-0a861f64b0ef} DataStruct + + {8c6fc8c6-8874-494b-8260-071f291aa33d} + FormLib + + + {9BAA53FD-89B5-43E2-AC59-A27B006DEBB6} + HWindow_Tool + {D4E052B9-E541-4B67-A1F9-273073EF1D4B} Logger diff --git a/ToolLib.VisionJob/VisionJob.cs b/ToolLib.VisionJob/VisionJob.cs index 4f71b36..a209c27 100644 --- a/ToolLib.VisionJob/VisionJob.cs +++ b/ToolLib.VisionJob/VisionJob.cs @@ -1,5 +1,6 @@ using CommonMethods; using CommonMethods.Interface; +using FormLib; using Logger; using System; using System.Collections.Generic; @@ -745,6 +746,7 @@ namespace ToolLib.VisionJob public void Run() { + FormImageWindow.Instance.ClearWindow(); for (int i = 0; i < L_toolList.Count; i++) { TreeNode treeNode = GetToolNodeByNodeText(L_toolList[i].toolName); diff --git a/ToolLib.VisionToolList/ToolLib.VisionToolList.csproj b/ToolLib.VisionToolList/ToolLib.VisionToolList.csproj index 991cd86..c10219c 100644 --- a/ToolLib.VisionToolList/ToolLib.VisionToolList.csproj +++ b/ToolLib.VisionToolList/ToolLib.VisionToolList.csproj @@ -1,4 +1,4 @@ - + @@ -9,8 +9,9 @@ Properties ToolLib.VisionToolList ToolLib.VisionToolList - v4.5.2 + v4.6.1 512 + true diff --git a/ToolLib.VisionToolList/VisionToolList.cs b/ToolLib.VisionToolList/VisionToolList.cs index 122df7d..6b57282 100644 --- a/ToolLib.VisionToolList/VisionToolList.cs +++ b/ToolLib.VisionToolList/VisionToolList.cs @@ -46,7 +46,7 @@ namespace VisionJobFactory public class FindLineToolInterface : IToolInfo { ToolIO inputImage = new ToolIO("InputImage", null, DataType.Image); - ToolIO inputPos = new ToolIO("InputPos", new object(), DataType.Pose); + ToolIO inputPos = new ToolIO("InputPos", null, DataType.Pose); ToolIO outputXld = new ToolIO("outputXld", null, DataType.Line); ToolIO startPointRow = new ToolIO("StartPointRow", null, DataType.IntValue); ToolIO startPointColumn = new ToolIO("StartPointColumn", null, DataType.IntValue); diff --git a/UsingControl/Controls/Controls.csproj b/UsingControl/Controls/Controls.csproj index fdfeae1..3147809 100644 --- a/UsingControl/Controls/Controls.csproj +++ b/UsingControl/Controls/Controls.csproj @@ -1,4 +1,4 @@ - + @@ -9,7 +9,7 @@ Properties Controls Controls - v4.5.2 + v4.6.1 512 diff --git a/UsingControl/Controls/Properties/Resources.Designer.cs b/UsingControl/Controls/Properties/Resources.Designer.cs index 89da773..6110779 100644 --- a/UsingControl/Controls/Properties/Resources.Designer.cs +++ b/UsingControl/Controls/Properties/Resources.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // 此代码由工具生成。 // 运行时版本:4.0.30319.42000 diff --git a/VisionEdit/App.config b/VisionEdit/App.config index 88fa402..bae5d6d 100644 --- a/VisionEdit/App.config +++ b/VisionEdit/App.config @@ -1,6 +1,6 @@ - + - + - \ No newline at end of file + diff --git a/VisionEdit/Properties/Resources.Designer.cs b/VisionEdit/Properties/Resources.Designer.cs index df7f764..dbd27ff 100644 --- a/VisionEdit/Properties/Resources.Designer.cs +++ b/VisionEdit/Properties/Resources.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // 此代码由工具生成。 // 运行时版本:4.0.30319.42000 diff --git a/VisionEdit/Properties/Settings.Designer.cs b/VisionEdit/Properties/Settings.Designer.cs index 0465eb3..06573f5 100644 --- a/VisionEdit/Properties/Settings.Designer.cs +++ b/VisionEdit/Properties/Settings.Designer.cs @@ -1,28 +1,24 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 +// 此代码由工具生成。 +// 运行时版本:4.0.30319.42000 // -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. +// 对此文件的更改可能会导致不正确的行为,并且如果 +// 重新生成代码,这些更改将会丢失。 // //------------------------------------------------------------------------------ -namespace VisionEdit.Properties -{ - - +namespace VisionEdit.Properties { + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] - [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")] - internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase - { - + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "14.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); - - public static Settings Default - { - get - { + + public static Settings Default { + get { return defaultInstance; } } diff --git a/VisionEdit/VisionEdit.csproj b/VisionEdit/VisionEdit.csproj index 0e37ef4..b8c2727 100644 --- a/VisionEdit/VisionEdit.csproj +++ b/VisionEdit/VisionEdit.csproj @@ -9,9 +9,10 @@ Properties VisionEdit VisionEdit - v4.5.2 + v4.6.1 512 true + x64 diff --git a/VisionEdit/bin/Debug/DockPanel.config b/VisionEdit/bin/Debug/DockPanel.config index 990869b..605611e 100644 Binary files a/VisionEdit/bin/Debug/DockPanel.config and b/VisionEdit/bin/Debug/DockPanel.config differ diff --git a/VisionEdit/bin/Debug/ThirdLib/DevComponents.DotNetBar2.dll b/VisionEdit/bin/Debug/ThirdLib/DevComponents.DotNetBar2.dll new file mode 100644 index 0000000..c9ac128 Binary files /dev/null and b/VisionEdit/bin/Debug/ThirdLib/DevComponents.DotNetBar2.dll differ diff --git a/VisionEdit/bin/Debug/ThirdLib/SunnyUI.Common.dll b/VisionEdit/bin/Debug/ThirdLib/SunnyUI.Common.dll new file mode 100644 index 0000000..7189065 Binary files /dev/null and b/VisionEdit/bin/Debug/ThirdLib/SunnyUI.Common.dll differ diff --git a/VisionEdit/bin/Debug/ThirdLib/SunnyUI.dll b/VisionEdit/bin/Debug/ThirdLib/SunnyUI.dll new file mode 100644 index 0000000..81defd8 Binary files /dev/null and b/VisionEdit/bin/Debug/ThirdLib/SunnyUI.dll differ diff --git a/VisionEdit/bin/Debug/ThirdLib/WeifenLuo.WinFormsUI.Docking.dll b/VisionEdit/bin/Debug/ThirdLib/WeifenLuo.WinFormsUI.Docking.dll new file mode 100644 index 0000000..bb35dc6 Binary files /dev/null and b/VisionEdit/bin/Debug/ThirdLib/WeifenLuo.WinFormsUI.Docking.dll differ diff --git a/VisionEdit/bin/Debug/log4net.dll b/VisionEdit/bin/Debug/ThirdLib/log4net.dll similarity index 100% rename from VisionEdit/bin/Debug/log4net.dll rename to VisionEdit/bin/Debug/ThirdLib/log4net.dll diff --git a/VisionEdit/bin/Debug/VisionEdit.vshost.exe.config b/VisionEdit/bin/Debug/VisionEdit.vshost.exe.config index 88fa402..bae5d6d 100644 --- a/VisionEdit/bin/Debug/VisionEdit.vshost.exe.config +++ b/VisionEdit/bin/Debug/VisionEdit.vshost.exe.config @@ -1,6 +1,6 @@ - + - + - \ No newline at end of file +